aboutsummaryrefslogtreecommitdiff
path: root/GuiTest
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-06-05 18:01:27 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-06-05 18:01:27 +0300
commitffa5a02e44381983ffdbddad0debc4569c1a1994 (patch)
treeb86b0d9f6353e715a203fd8b237a6fb89d63cd29 /GuiTest
parentd866f96541b03c80fbc417c5ab5e87d7189bb723 (diff)
downloadLibGui-ffa5a02e44381983ffdbddad0debc4569c1a1994.tar.gz
LibGui-ffa5a02e44381983ffdbddad0debc4569c1a1994.tar.bz2
LibGui-ffa5a02e44381983ffdbddad0debc4569c1a1994.zip
CottonInventoryController -> SyncedGuiDescription
Diffstat (limited to 'GuiTest')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java2
-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.java4
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));
}
}