Skip to content

Commit

Permalink
fix: Do not send the conduit selection packet on the server.
Browse files Browse the repository at this point in the history
Closes: #738
  • Loading branch information
Rover656 committed Jul 17, 2024
1 parent a416538 commit bf53126
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.enderio.conduits.common.network.ConduitSelectionPacket;
import com.enderio.core.common.menu.SyncedMenu;
import com.enderio.core.common.network.CoreNetwork;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.Direction;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
Expand Down Expand Up @@ -38,7 +40,6 @@ public List<ConduitSlot> getConduitSlots() {
private Direction direction;
private ConduitType<?> type;


public ConduitMenu(@Nullable ConduitBlockEntity blockEntity, Inventory inventory, int pContainerId, Direction direction, ConduitType type) {
super(blockEntity, inventory, ConduitMenus.CONDUIT_MENU.get(), pContainerId);
this.direction = direction;
Expand Down Expand Up @@ -116,7 +117,10 @@ public ConduitType<?> getConduitType() {

public void setConduitType(ConduitType<?> type) {
this.type = type;
CoreNetwork.sendToServer(new ConduitSelectionPacket(EIOConduitTypes.getConduitId(type)));

if (getBlockEntity().getLevel() != null && getBlockEntity().getLevel().isClientSide) {
CoreNetwork.sendToServer(new ConduitSelectionPacket(EIOConduitTypes.getConduitId(type)));
}
}

public Direction getDirection() {
Expand Down

0 comments on commit bf53126

Please sign in to comment.