diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2022-12-11 14:12:49 +0200 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2022-12-11 14:12:49 +0200 |
commit | e0bcfebef37e727ccea046138b6c633c57056d96 (patch) | |
tree | 5e0b70af68bb073ce54dee874f0b72121aa6e92f /GuiTest | |
parent | 2aa6d47f648274137cd346115245c28a11ff1723 (diff) | |
download | LibGui-e0bcfebef37e727ccea046138b6c633c57056d96.tar.gz LibGui-e0bcfebef37e727ccea046138b6c633c57056d96.tar.bz2 LibGui-e0bcfebef37e727ccea046138b6c633c57056d96.zip |
Update to Minecraft 1.19.3, part 2
Diffstat (limited to 'GuiTest')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java | 8 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java | 22 |
2 files changed, 15 insertions, 15 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java index 278ddb9..d629b68 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java @@ -1,13 +1,10 @@ package io.github.cottonmc.test; -import io.github.cottonmc.cotton.gui.client.CottonClientScreen; -import io.github.cottonmc.test.client.TestClientGui; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -15,10 +12,13 @@ import net.minecraft.util.Rarity; import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; +import io.github.cottonmc.cotton.gui.client.CottonClientScreen; +import io.github.cottonmc.test.client.TestClientGui; + public class GuiItem extends Item { public GuiItem() { - super(new Item.Settings().group(ItemGroup.TOOLS).rarity(Rarity.EPIC)); + super(new Item.Settings().rarity(Rarity.EPIC)); } @Override 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 8a3fe4b..009ea23 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/LibGuiTest.java @@ -11,11 +11,11 @@ import net.minecraft.block.entity.BlockEntityType; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.screen.ScreenHandlerContext; import net.minecraft.screen.ScreenHandlerType; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import java.io.IOException; import java.nio.file.Files; @@ -34,25 +34,25 @@ public class LibGuiTest implements ModInitializer { @Override public void onInitialize() { - Registry.register(Registry.ITEM, new Identifier(MODID, "client_gui"), new GuiItem()); + Registry.register(Registries.ITEM, new Identifier(MODID, "client_gui"), new GuiItem()); GUI_BLOCK = new GuiBlock(); - Registry.register(Registry.BLOCK, new Identifier(MODID, "gui"), GUI_BLOCK); - GUI_BLOCK_ITEM = new BlockItem(GUI_BLOCK, new Item.Settings().group(ItemGroup.MISC)); - Registry.register(Registry.ITEM, new Identifier(MODID, "gui"), GUI_BLOCK_ITEM); + Registry.register(Registries.BLOCK, new Identifier(MODID, "gui"), GUI_BLOCK); + GUI_BLOCK_ITEM = new BlockItem(GUI_BLOCK, new Item.Settings()); + Registry.register(Registries.ITEM, new Identifier(MODID, "gui"), GUI_BLOCK_ITEM); NO_BLOCK_INVENTORY_BLOCK = new NoBlockInventoryBlock(AbstractBlock.Settings.copy(Blocks.STONE)); - Registry.register(Registry.BLOCK, new Identifier(MODID, "no_block_inventory"), NO_BLOCK_INVENTORY_BLOCK); - Registry.register(Registry.ITEM, new Identifier(MODID, "no_block_inventory"), new BlockItem(NO_BLOCK_INVENTORY_BLOCK, new Item.Settings().group(ItemGroup.MISC))); + Registry.register(Registries.BLOCK, new Identifier(MODID, "no_block_inventory"), NO_BLOCK_INVENTORY_BLOCK); + Registry.register(Registries.ITEM, new Identifier(MODID, "no_block_inventory"), new BlockItem(NO_BLOCK_INVENTORY_BLOCK, new Item.Settings())); GUI_BLOCKENTITY_TYPE = FabricBlockEntityTypeBuilder.create(GuiBlockEntity::new, GUI_BLOCK).build(null); - Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(MODID, "gui"), GUI_BLOCKENTITY_TYPE); + Registry.register(Registries.BLOCK_ENTITY_TYPE, new Identifier(MODID, "gui"), GUI_BLOCKENTITY_TYPE); 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); + Registry.register(Registries.SCREEN_HANDLER, new Identifier(MODID, "gui"), GUI_SCREEN_HANDLER_TYPE); REALLY_SIMPLE_SCREEN_HANDLER_TYPE = new ScreenHandlerType<>(ReallySimpleDescription::new); - Registry.register(Registry.SCREEN_HANDLER, new Identifier(MODID, "really_simple"), REALLY_SIMPLE_SCREEN_HANDLER_TYPE); + Registry.register(Registries.SCREEN_HANDLER, new Identifier(MODID, "really_simple"), REALLY_SIMPLE_SCREEN_HANDLER_TYPE); Optional<ModContainer> containerOpt = FabricLoader.getInstance().getModContainer("jankson"); if (containerOpt.isPresent()) { |