diff options
Diffstat (limited to 'GuiTest')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java | 2 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java (renamed from GuiTest/src/main/java/io/github/cottonmc/test/TestController.java) | 7 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java b/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java index 6d63688..90f3c92 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java @@ -38,7 +38,7 @@ public class LibGuiTest implements ModInitializer { ContainerProviderRegistry.INSTANCE.registerFactory(new Identifier(MODID, "gui"), (int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf)->{ - return new TestController(syncId, player.inventory, ScreenHandlerContext.create(player.getEntityWorld(), buf.readBlockPos())); + return new TestDescription(syncId, player.inventory, ScreenHandlerContext.create(player.getEntityWorld(), buf.readBlockPos())); }); Optional<ModContainer> containerOpt = FabricLoader.getInstance().getModContainer("jankson"); diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java index 68905ef..3d5e48c 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java @@ -1,15 +1,14 @@ package io.github.cottonmc.test; -import io.github.cottonmc.cotton.gui.CottonInventoryController; +import io.github.cottonmc.cotton.gui.SyncedGuiDescription; import io.github.cottonmc.cotton.gui.widget.*; -import io.github.cottonmc.cotton.gui.widget.data.Axis; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.screen.ScreenHandlerContext; import net.minecraft.text.LiteralText; -public class TestController extends CottonInventoryController { +public class TestDescription extends SyncedGuiDescription { - public TestController(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) { + public TestDescription(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) { super(syncId, playerInventory, getBlockInventory(context), null); WGridPanel root = (WGridPanel)this.getRootPanel(); diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java index a2a23fb..f0d3f27 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java @@ -2,7 +2,7 @@ package io.github.cottonmc.test.client; import io.github.cottonmc.cotton.gui.client.CottonInventoryScreen; import io.github.cottonmc.test.LibGuiTest; -import io.github.cottonmc.test.TestController; +import io.github.cottonmc.test.TestDescription; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.screen.ScreenProviderRegistry; import net.minecraft.screen.ScreenHandlerContext; @@ -12,7 +12,7 @@ public class LibGuiTestClient implements ClientModInitializer { @Override public void onInitializeClient() { - ScreenProviderRegistry.INSTANCE.registerFactory(new Identifier(LibGuiTest.MODID, "gui"), (syncId, identifier, player, buf)->new CottonInventoryScreen<TestController>(new TestController(syncId, player.inventory, ScreenHandlerContext.create(player.getEntityWorld(), buf.readBlockPos())), player)); + ScreenProviderRegistry.INSTANCE.registerFactory(new Identifier(LibGuiTest.MODID, "gui"), (syncId, identifier, player, buf)->new CottonInventoryScreen<TestDescription>(new TestDescription(syncId, player.inventory, ScreenHandlerContext.create(player.getEntityWorld(), buf.readBlockPos())), player)); } } |