From f6fa80af35bb1b4636ef54deb6b1c66477308b18 Mon Sep 17 00:00:00 2001 From: MisterJulsen Date: Tue, 27 Feb 2024 18:13:54 +0100 Subject: [PATCH] Added creative mode tab --- .../java/de/mrjulsen/crn/item/NavigatorItem.java | 5 ++--- .../item/creativemodetab/ModCreativeModeTab.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/main/java/de/mrjulsen/crn/item/creativemodetab/ModCreativeModeTab.java diff --git a/src/main/java/de/mrjulsen/crn/item/NavigatorItem.java b/src/main/java/de/mrjulsen/crn/item/NavigatorItem.java index 61f6a937..54d65b3c 100644 --- a/src/main/java/de/mrjulsen/crn/item/NavigatorItem.java +++ b/src/main/java/de/mrjulsen/crn/item/NavigatorItem.java @@ -1,8 +1,7 @@ package de.mrjulsen.crn.item; -import com.simibubi.create.AllCreativeModeTabs; - import de.mrjulsen.crn.client.ClientWrapper; +import de.mrjulsen.crn.client.ModCreativeModeTab; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; @@ -13,7 +12,7 @@ public class NavigatorItem extends Item { public NavigatorItem() { - super(new Properties().tab(AllCreativeModeTabs.BASE_CREATIVE_TAB).stacksTo(1)); + super(new Properties().tab(ModCreativeModeTab.MOD_TAB).stacksTo(1)); } @Override diff --git a/src/main/java/de/mrjulsen/crn/item/creativemodetab/ModCreativeModeTab.java b/src/main/java/de/mrjulsen/crn/item/creativemodetab/ModCreativeModeTab.java new file mode 100644 index 00000000..4c3c9f60 --- /dev/null +++ b/src/main/java/de/mrjulsen/crn/item/creativemodetab/ModCreativeModeTab.java @@ -0,0 +1,16 @@ +package de.mrjulsen.crn.item.creativemodetab; + +import de.mrjulsen.crn.item.ModItems; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.ItemStack; + +public class ModCreativeModeTab { + + public static final CreativeModeTab MOD_TAB = new CreativeModeTab("createrailwaysnavigatortab") { + @Override + public ItemStack makeIcon() { + return new ItemStack(ModItems.NAVIGATOR.get()); + }; + }; + +}