aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java15
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/ScreenNetworkingImpl.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/client/LibGuiClient.java4
-rw-r--r--src/main/resources/fabric.mod.json9
4 files changed, 2 insertions, 30 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();
}
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index 7870abc..1620133 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -24,14 +24,9 @@
},
"mixins": ["mixins.libgui.json"],
"depends": {
- "java": ">=17",
- "fabricloader": ">=0.14.22",
- "fabric-api-base": ">=0.4.4",
- "fabric-lifecycle-events-v1": "^2.0.2",
- "fabric-networking-api-v1": "^3.0.5",
- "fabric-rendering-v1": "^3.0.6",
+ "java": ">=21",
"fabric-resource-loader-v0": "*",
- "minecraft": ">=1.20.2",
+ "minecraft": ">=1.20.5",
"jankson": "^6.0.0",
"libninepatch": "^1.2.0"
},