aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java7
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java6
-rw-r--r--gradle.properties10
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java2
-rw-r--r--src/main/resources/fabric.mod.json6
5 files changed, 16 insertions, 15 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 f938749..8a3fe4b 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java
@@ -2,7 +2,6 @@ package io.github.cottonmc.test;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
-import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.block.AbstractBlock;
@@ -47,11 +46,13 @@ public class LibGuiTest implements ModInitializer {
GUI_BLOCKENTITY_TYPE = FabricBlockEntityTypeBuilder.create(GuiBlockEntity::new, GUI_BLOCK).build(null);
Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(MODID, "gui"), GUI_BLOCKENTITY_TYPE);
- GUI_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(new Identifier(MODID, "gui"), (int syncId, PlayerInventory inventory) -> {
+ GUI_SCREEN_HANDLER_TYPE = new ScreenHandlerType<>((int syncId, PlayerInventory inventory) -> {
return new TestDescription(GUI_SCREEN_HANDLER_TYPE, syncId, inventory, ScreenHandlerContext.EMPTY);
});
+ Registry.register(Registry.SCREEN_HANDLER, new Identifier(MODID, "gui"), GUI_SCREEN_HANDLER_TYPE);
- REALLY_SIMPLE_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(new Identifier(MODID, "really_simple"), ReallySimpleDescription::new);
+ REALLY_SIMPLE_SCREEN_HANDLER_TYPE = new ScreenHandlerType<>(ReallySimpleDescription::new);
+ Registry.register(Registry.SCREEN_HANDLER, new Identifier(MODID, "really_simple"), REALLY_SIMPLE_SCREEN_HANDLER_TYPE);
Optional<ModContainer> containerOpt = FabricLoader.getInstance().getModContainer("jankson");
if (containerOpt.isPresent()) {
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 38545fa..fd031f5 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
@@ -4,8 +4,8 @@ import com.mojang.brigadier.Command;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
-import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.text.LiteralText;
import io.github.cottonmc.cotton.gui.client.CottonClientScreen;
@@ -26,12 +26,12 @@ public class LibGuiTestClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
- ScreenRegistry.<TestDescription, CottonInventoryScreen<TestDescription>>register(
+ HandledScreens.<TestDescription, CottonInventoryScreen<TestDescription>>register(
LibGuiTest.GUI_SCREEN_HANDLER_TYPE,
CottonInventoryScreen::new
);
- ScreenRegistry.<ReallySimpleDescription, CottonInventoryScreen<ReallySimpleDescription>>register(
+ HandledScreens.<ReallySimpleDescription, CottonInventoryScreen<ReallySimpleDescription>>register(
LibGuiTest.REALLY_SIMPLE_SCREEN_HANDLER_TYPE,
CottonInventoryScreen::new
);
diff --git a/gradle.properties b/gradle.properties
index 332a741..10be66a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
- minecraft_version=1.18
- yarn_mappings=1.18+build.1
- loader_version=0.12.8
+ minecraft_version=1.18.2
+ yarn_mappings=1.18.2+build.2
+ loader_version=0.13.3
# Mod Properties
mod_version = 5.3.1
@@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx1G
archives_base_name = LibGui
# Dependencies
- fabric_version=0.43.1+1.18
+ fabric_version=0.48.0+1.18.2
jankson_version=4.0.0+j1.2.0
- modmenu_version=3.0.0
+ modmenu_version=3.1.0
libninepatch_version=1.1.0
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
index 53fbcba..af11018 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
@@ -173,7 +173,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
}
@Override
- public boolean isPauseScreen() {
+ public boolean shouldPause() {
//...yeah, we're going to go ahead and override that.
return false;
}
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index abca72c..466944f 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -24,9 +24,9 @@
},
"depends": {
"java": ">=17",
- "fabricloader": ">=0.12.5",
- "fabric": ">=0.42.4",
- "minecraft": "~1.18-beta.2",
+ "fabricloader": ">=0.13.3",
+ "fabric": ">=0.48.0",
+ "minecraft": "~1.18.2",
"jankson": "^4.0.0",
"libninepatch": "^1.1.0"
},