diff options
Diffstat (limited to 'src/main/java')
3 files changed, 0 insertions, 23 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java index b64ffce..d64e3d6 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java @@ -170,21 +170,6 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio /** WILL MODIFY toInsert! Returns true if anything was inserted. */ private boolean insertIntoExisting(ItemStack toInsert, Slot slot, PlayerEntity player) { ItemStack curSlotStack = slot.getStack(); - if (!curSlotStack.isEmpty() && ItemStack.canCombine(toInsert, curSlotStack) && slot.canInsert(toInsert)) { - int combinedAmount = curSlotStack.getCount() + toInsert.getCount(); - int maxAmount = Math.min(toInsert.getMaxCount(), slot.getMaxItemCount(toInsert)); - if (combinedAmount <= maxAmount) { - toInsert.setCount(0); - curSlotStack.setCount(combinedAmount); - slot.markDirty(); - return true; - } else if (curSlotStack.getCount() < maxAmount) { - toInsert.decrement(maxAmount - curSlotStack.getCount()); - curSlotStack.setCount(maxAmount); - slot.markDirty(); - return true; - } - } return false; } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/ScreenNetworkingImpl.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/ScreenNetworkingImpl.java index b20fcec..45a5e04 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/impl/ScreenNetworkingImpl.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/impl/ScreenNetworkingImpl.java @@ -61,13 +61,9 @@ public class ScreenNetworkingImpl implements ScreenNetworking { buf.writeVarInt(description.syncId); buf.writeIdentifier(message); writer.accept(buf); - description.getPacketSender().sendPacket(side == NetworkSide.SERVER ? SCREEN_MESSAGE_S2C : SCREEN_MESSAGE_C2S, buf); } public static void init() { - ServerPlayNetworking.registerGlobalReceiver(SCREEN_MESSAGE_C2S, (server, player, networkHandler, buf, responseSender) -> { - handle(server, player, buf); - }); } public static void handle(Executor executor, PlayerEntity player, PacketByteBuf buf) { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/LibGuiClient.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/client/LibGuiClient.java index d6f8f4f..fbb2844 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/LibGuiClient.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/impl/client/LibGuiClient.java @@ -28,10 +28,6 @@ public class LibGuiClient implements ClientModInitializer { public void onInitializeClient() { config = loadConfig(); - ClientPlayNetworking.registerGlobalReceiver(ScreenNetworkingImpl.SCREEN_MESSAGE_S2C, (client, networkHandler, buf, responseSender) -> { - ScreenNetworkingImpl.handle(client, client.player, buf); - }); - LibGuiShaders.register(); Proxy.proxy = new ClientProxy(); } |