Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public LandingBlock(BoundingBox3D boundingBox) {

@InfoString.Getter
public Vector3D getOffset() {
if (offsets.size() == 0) return null;
if (offsets.isEmpty()) return null;
return offsets.get(offsets.size() - 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import io.github.kurrycat.mpkmod.compatibility.MCClasses.Minecraft;
import io.github.kurrycat.mpkmod.events.EventAPI;
import io.github.kurrycat.mpkmod.events.OnModuleMessageEvent;
import io.github.kurrycat.mpkmod.gui.screens.LandingBlockGuiScreen;
import io.github.kurrycat.mpkmod.landingblock.LandingBlock;
import io.github.kurrycat.mpkmod.modules.ModuleManager;
import io.github.kurrycat.mpkmod.util.BoundingBox3D;
import io.github.kurrycat.mpkmod.util.Vector3D;
import io.github.kurrycat.mpknetapi.common.network.packet.impl.clientbound.*;
import io.github.kurrycat.mpknetapi.common.network.packet.impl.serverbound.MPKPacketModuleUpdate;
import io.github.kurrycat.mpknetapi.common.network.packet.impl.shared.MPKPacketModuleMessage;
Expand All @@ -29,6 +33,13 @@ public void handleModuleMessage(MPKPacketModuleMessage packet) {
EventAPI.postEvent(new OnModuleMessageEvent(packet));
}

@Override
public void handleSetLandingBlock(MPKPacketSetLandingBlock packet) {
LandingBlockGuiScreen.lbs.add(new LandingBlock(
BoundingBox3D.asBlockPos(new Vector3D(packet.getX(), packet.getY(), packet.getZ()))
));
}

private void sendModuleUpdate() {
List<String> modules = new ArrayList<>();
ModuleManager.moduleMap.forEach((id, module) -> modules.add(id));
Expand Down
Loading