diff --git a/build.gradle b/build.gradle index 546e606..5b50303 100644 --- a/build.gradle +++ b/build.gradle @@ -104,12 +104,14 @@ dependencies { compileOnly fg.deobf("mezz.jei:${jei_version}:api") runtimeOnly fg.deobf("mezz.jei:${jei_version}") + /* compileOnly fg.deobf([ group: "vazkii.botania", name: "Botania", version: "${project.botania}", classifier: "api" ]) + */ } jar { diff --git a/gradle.properties b/gradle.properties index 379cdfb..40a8f6b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,14 +5,14 @@ author=thetadev modid=constructionwand mcversion=1.18.1 -forgeversion=39.1.0 +forgeversion=39.0.0 mcp_channel=official mcp_mappings=1.18.1 # Source: https://maven.blamejared.com/vazkii/botania/Botania/ -botania=1.18.1-429 +# botania=1.16.2-405 # Source: https://dvs1.progwml6.com/files/maven/mezz/jei/ jei_version=jei-1.18.1:9.1.0.41 version_major=2 -version_minor=7 \ No newline at end of file +version_minor=6 \ No newline at end of file diff --git a/src/main/java/thetadev/constructionwand/ConstructionWand.java b/src/main/java/thetadev/constructionwand/ConstructionWand.java index c5b9f76..e8e71af 100644 --- a/src/main/java/thetadev/constructionwand/ConstructionWand.java +++ b/src/main/java/thetadev/constructionwand/ConstructionWand.java @@ -53,9 +53,6 @@ public class ConstructionWand FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); MinecraftForge.EVENT_BUS.register(this); - // Register Item DeferredRegister - ModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); - // Config setup ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, ConfigServer.SPEC); ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ConfigClient.SPEC); diff --git a/src/main/java/thetadev/constructionwand/basics/ConfigServer.java b/src/main/java/thetadev/constructionwand/basics/ConfigServer.java index 6fc0de9..3e10b10 100644 --- a/src/main/java/thetadev/constructionwand/basics/ConfigServer.java +++ b/src/main/java/thetadev/constructionwand/basics/ConfigServer.java @@ -1,10 +1,8 @@ package thetadev.constructionwand.basics; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.Tiers; import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.registries.RegistryObject; import thetadev.constructionwand.items.ModItems; import java.util.Arrays; @@ -29,10 +27,10 @@ public class ConfigServer public static final ForgeConfigSpec.ConfigValue> TE_LIST; private static final String[] TE_LIST_DEFAULT = {"chiselsandbits"}; - private static final HashMap wandProperties = new HashMap<>(); + private static final HashMap wandProperties = new HashMap<>(); public static WandProperties getWandProperties(Item wand) { - return wandProperties.getOrDefault(wand.getRegistryName(), WandProperties.DEFAULT); + return wandProperties.getOrDefault(wand, WandProperties.DEFAULT); } public static class WandProperties @@ -55,10 +53,9 @@ public class ConfigServer this.upgradeable = upgradeable; } - public WandProperties(ForgeConfigSpec.Builder builder, RegistryObject wandSupplier, int defDurability, int defLimit, + public WandProperties(ForgeConfigSpec.Builder builder, Item wand, int defDurability, int defLimit, int defAngel, int defDestruction, boolean defUpgradeable) { - ResourceLocation registryName = wandSupplier.getId(); - builder.push(registryName.getPath()); + builder.push(wand.getRegistryName().getPath()); if(defDurability > 0) { builder.comment("Wand durability"); @@ -75,7 +72,7 @@ public class ConfigServer upgradeable = builder.define("upgradeable", defUpgradeable); builder.pop(); - wandProperties.put(registryName, this); + wandProperties.put(wand, this); } public int getDurability() { diff --git a/src/main/java/thetadev/constructionwand/basics/WandUtil.java b/src/main/java/thetadev/constructionwand/basics/WandUtil.java index aa98cbe..418ec5c 100644 --- a/src/main/java/thetadev/constructionwand/basics/WandUtil.java +++ b/src/main/java/thetadev/constructionwand/basics/WandUtil.java @@ -160,7 +160,7 @@ public class WandUtil List inventory = WandUtil.getFullInv(player); for(ItemStack stack : inventory) { - if(stack == null || stack.isEmpty()) continue; + if(stack == null) continue; if(WandUtil.stackEquals(stack, item)) { total += stack.getCount(); diff --git a/src/main/java/thetadev/constructionwand/containers/ContainerRegistrar.java b/src/main/java/thetadev/constructionwand/containers/ContainerRegistrar.java index e9e87f6..4c3b8e6 100644 --- a/src/main/java/thetadev/constructionwand/containers/ContainerRegistrar.java +++ b/src/main/java/thetadev/constructionwand/containers/ContainerRegistrar.java @@ -1,8 +1,6 @@ package thetadev.constructionwand.containers; -import net.minecraftforge.fml.ModList; import thetadev.constructionwand.ConstructionWand; -import thetadev.constructionwand.containers.handlers.HandlerBotania; import thetadev.constructionwand.containers.handlers.HandlerBundle; import thetadev.constructionwand.containers.handlers.HandlerCapability; import thetadev.constructionwand.containers.handlers.HandlerShulkerbox; @@ -14,9 +12,13 @@ public class ContainerRegistrar ConstructionWand.instance.containerManager.register(new HandlerShulkerbox()); ConstructionWand.instance.containerManager.register(new HandlerBundle()); + /* + TODO: Reenable this when Botania gets ported to 1.17 + if(ModList.get().isLoaded("botania")) { ConstructionWand.instance.containerManager.register(new HandlerBotania()); ConstructionWand.LOGGER.info("Botania integration added"); } + */ } } diff --git a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java index 8ffb651..2d41e4b 100644 --- a/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java +++ b/src/main/java/thetadev/constructionwand/containers/handlers/HandlerBotania.java @@ -1,28 +1,25 @@ +/* +TODO: Reenable this when Botania gets ported to 1.17 + package thetadev.constructionwand.containers.handlers; +import net.minecraft.world.level.block.Block; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; import thetadev.constructionwand.api.IContainerHandler; -import vazkii.botania.api.BotaniaForgeCapabilities; import vazkii.botania.api.item.IBlockProvider; -import java.util.Optional; - public class HandlerBotania implements IContainerHandler { @Override public boolean matches(Player player, ItemStack itemStack, ItemStack inventoryStack) { - return inventoryStack != null && inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).isPresent(); + return inventoryStack != null && inventoryStack.getCount() == 1 && inventoryStack.getItem() instanceof IBlockProvider; } @Override public int countItems(Player player, ItemStack itemStack, ItemStack inventoryStack) { - Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); - if(provOptional.isEmpty()) return 0; - - IBlockProvider prov = provOptional.get(); - int provCount = prov.getBlockCount(player, inventoryStack, Block.byItem(itemStack.getItem())); + IBlockProvider prov = (IBlockProvider) inventoryStack.getItem(); + int provCount = prov.getBlockCount(player, itemStack, inventoryStack, Block.byItem(itemStack.getItem())); if(provCount == -1) return Integer.MAX_VALUE; return provCount; @@ -30,12 +27,10 @@ public class HandlerBotania implements IContainerHandler @Override public int useItems(Player player, ItemStack itemStack, ItemStack inventoryStack, int count) { - Optional provOptional = inventoryStack.getCapability(BotaniaForgeCapabilities.BLOCK_PROVIDER).resolve(); - if(provOptional.isEmpty()) return 0; - - IBlockProvider prov = provOptional.get(); - if(prov.provideBlock(player, inventoryStack, Block.byItem(itemStack.getItem()), true)) + IBlockProvider prov = (IBlockProvider) inventoryStack.getItem(); + if(prov.provideBlock(player, itemStack, inventoryStack, Block.byItem(itemStack.getItem()), true)) return 0; return count; } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/src/main/java/thetadev/constructionwand/data/ItemModelGenerator.java b/src/main/java/thetadev/constructionwand/data/ItemModelGenerator.java index c007b70..b224ac8 100644 --- a/src/main/java/thetadev/constructionwand/data/ItemModelGenerator.java +++ b/src/main/java/thetadev/constructionwand/data/ItemModelGenerator.java @@ -5,7 +5,6 @@ import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.RegistryObject; import thetadev.constructionwand.ConstructionWand; import thetadev.constructionwand.items.ModItems; @@ -19,8 +18,7 @@ public class ItemModelGenerator extends ItemModelProvider @Override protected void registerModels() { - for(RegistryObject itemObject : ModItems.ITEMS.getEntries()) { - Item item = itemObject.get(); + for(Item item : ModItems.ALL_ITEMS) { String name = item.getRegistryName().getPath(); if(item instanceof ICustomItemModel) diff --git a/src/main/java/thetadev/constructionwand/data/RecipeGenerator.java b/src/main/java/thetadev/constructionwand/data/RecipeGenerator.java index aaff00c..4407958 100644 --- a/src/main/java/thetadev/constructionwand/data/RecipeGenerator.java +++ b/src/main/java/thetadev/constructionwand/data/RecipeGenerator.java @@ -27,13 +27,13 @@ public class RecipeGenerator extends RecipeProvider @Override protected void buildCraftingRecipes(@Nonnull Consumer consumer) { - wandRecipe(consumer, ModItems.WAND_STONE.get(), Inp.fromTag(ItemTags.STONE_TOOL_MATERIALS)); - wandRecipe(consumer, ModItems.WAND_IRON.get(), Inp.fromTag(Tags.Items.INGOTS_IRON)); - wandRecipe(consumer, ModItems.WAND_DIAMOND.get(), Inp.fromTag(Tags.Items.GEMS_DIAMOND)); - wandRecipe(consumer, ModItems.WAND_INFINITY.get(), Inp.fromTag(Tags.Items.NETHER_STARS)); + wandRecipe(consumer, ModItems.WAND_STONE, Inp.fromTag(ItemTags.STONE_TOOL_MATERIALS)); + wandRecipe(consumer, ModItems.WAND_IRON, Inp.fromTag(Tags.Items.INGOTS_IRON)); + wandRecipe(consumer, ModItems.WAND_DIAMOND, Inp.fromTag(Tags.Items.GEMS_DIAMOND)); + wandRecipe(consumer, ModItems.WAND_INFINITY, Inp.fromTag(Tags.Items.NETHER_STARS)); - coreRecipe(consumer, ModItems.CORE_ANGEL.get(), Inp.fromTag(Tags.Items.FEATHERS), Inp.fromTag(Tags.Items.INGOTS_GOLD)); - coreRecipe(consumer, ModItems.CORE_DESTRUCTION.get(), Inp.fromTag(Tags.Items.STORAGE_BLOCKS_DIAMOND), Inp.fromItem(Items.DIAMOND_PICKAXE)); + coreRecipe(consumer, ModItems.CORE_ANGEL, Inp.fromTag(Tags.Items.FEATHERS), Inp.fromTag(Tags.Items.INGOTS_GOLD)); + coreRecipe(consumer, ModItems.CORE_DESTRUCTION, Inp.fromTag(Tags.Items.STORAGE_BLOCKS_DIAMOND), Inp.fromItem(Items.DIAMOND_PICKAXE)); specialRecipe(consumer, RecipeWandUpgrade.SERIALIZER); } diff --git a/src/main/java/thetadev/constructionwand/integrations/jei/ConstructionWandJeiPlugin.java b/src/main/java/thetadev/constructionwand/integrations/jei/ConstructionWandJeiPlugin.java index ed0ca4d..682d758 100644 --- a/src/main/java/thetadev/constructionwand/integrations/jei/ConstructionWandJeiPlugin.java +++ b/src/main/java/thetadev/constructionwand/integrations/jei/ConstructionWandJeiPlugin.java @@ -11,7 +11,6 @@ import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.RegistryObject; import thetadev.constructionwand.ConstructionWand; import thetadev.constructionwand.basics.ConfigClient; import thetadev.constructionwand.basics.ConfigServer; @@ -44,11 +43,10 @@ public class ConstructionWandJeiPlugin implements IModPlugin Component wandModeComponent = keyComboComponent(ConfigClient.SHIFTOPT_MODE.get(), optkeyComponent); Component wandGuiComponent = keyComboComponent(ConfigClient.SHIFTOPT_GUI.get(), optkeyComponent); - for(RegistryObject wandSupplier : ModItems.WANDS) { - Item wand = wandSupplier.get(); + for(Item wand : ModItems.WANDS) { ConfigServer.WandProperties wandProperties = ConfigServer.getWandProperties(wand); - String durabilityKey = wand == ModItems.WAND_INFINITY.get() ? "unlimited" : "limited"; + String durabilityKey = wand == ModItems.WAND_INFINITY ? "unlimited" : "limited"; Component durabilityComponent = new TranslatableComponent(baseKey + "durability." + durabilityKey, wandProperties.getDurability()); registration.addIngredientInfo(new ItemStack(wand), VanillaTypes.ITEM, @@ -59,8 +57,7 @@ public class ConstructionWandJeiPlugin implements IModPlugin ); } - for(RegistryObject coreSupplier : ModItems.CORES) { - Item core = coreSupplier.get(); + for(Item core : ModItems.CORES) { registration.addIngredientInfo(new ItemStack(core), VanillaTypes.ITEM, new TranslatableComponent(baseKey + core.getRegistryName().getPath()), new TranslatableComponent(baseKey + "core", wandModeComponent) diff --git a/src/main/java/thetadev/constructionwand/items/ItemBase.java b/src/main/java/thetadev/constructionwand/items/ItemBase.java new file mode 100644 index 0000000..f47d0dc --- /dev/null +++ b/src/main/java/thetadev/constructionwand/items/ItemBase.java @@ -0,0 +1,12 @@ +package thetadev.constructionwand.items; + +import net.minecraft.world.item.Item; +import thetadev.constructionwand.ConstructionWand; + +public class ItemBase extends Item +{ + public ItemBase(String name, Properties properties) { + super(properties); + setRegistryName(ConstructionWand.MODID, name); + } +} diff --git a/src/main/java/thetadev/constructionwand/items/ModItems.java b/src/main/java/thetadev/constructionwand/items/ModItems.java index aabd39d..14c3255 100644 --- a/src/main/java/thetadev/constructionwand/items/ModItems.java +++ b/src/main/java/thetadev/constructionwand/items/ModItems.java @@ -12,7 +12,8 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.registries.*; +import net.minecraftforge.registries.IForgeRegistry; +import net.minecraftforge.registries.IForgeRegistryEntry; import thetadev.constructionwand.ConstructionWand; import thetadev.constructionwand.basics.option.WandOptions; import thetadev.constructionwand.crafting.RecipeWandUpgrade; @@ -22,24 +23,38 @@ import thetadev.constructionwand.items.wand.ItemWand; import thetadev.constructionwand.items.wand.ItemWandBasic; import thetadev.constructionwand.items.wand.ItemWandInfinity; +import java.util.Arrays; +import java.util.HashSet; + @Mod.EventBusSubscriber(modid = ConstructionWand.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModItems { - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ConstructionWand.MODID); - // Wands - public static final RegistryObject WAND_STONE = ITEMS.register("stone_wand", () -> new ItemWandBasic(propWand(), Tiers.STONE)); - public static final RegistryObject WAND_IRON = ITEMS.register("iron_wand", () -> new ItemWandBasic(propWand(), Tiers.IRON)); - public static final RegistryObject WAND_DIAMOND = ITEMS.register("diamond_wand", () -> new ItemWandBasic(propWand(), Tiers.DIAMOND)); - public static final RegistryObject WAND_INFINITY = ITEMS.register("infinity_wand", () -> new ItemWandInfinity(propWand())); + public static final Item WAND_STONE = new ItemWandBasic("stone_wand", propWand(), Tiers.STONE); + public static final Item WAND_IRON = new ItemWandBasic("iron_wand", propWand(), Tiers.IRON); + public static final Item WAND_DIAMOND = new ItemWandBasic("diamond_wand", propWand(), Tiers.DIAMOND); + public static final Item WAND_INFINITY = new ItemWandInfinity("infinity_wand", propWand()); // Cores - public static final RegistryObject CORE_ANGEL = ITEMS.register("core_angel", () -> new ItemCoreAngel(propUpgrade())); - public static final RegistryObject CORE_DESTRUCTION = ITEMS.register("core_destruction", () -> new ItemCoreDestruction(propUpgrade())); + public static final Item CORE_ANGEL = new ItemCoreAngel("core_angel", propUpgrade()); + public static final Item CORE_DESTRUCTION = new ItemCoreDestruction("core_destruction", propUpgrade()); // Collections - public static final RegistryObject[] WANDS = new RegistryObject[] {WAND_STONE, WAND_IRON, WAND_DIAMOND, WAND_INFINITY}; - public static final RegistryObject[] CORES = new RegistryObject[] {CORE_ANGEL, CORE_DESTRUCTION}; + public static final Item[] WANDS = {WAND_STONE, WAND_IRON, WAND_DIAMOND, WAND_INFINITY}; + public static final Item[] CORES = {CORE_ANGEL, CORE_DESTRUCTION}; + public static final HashSet ALL_ITEMS = new HashSet<>(); + + + @SubscribeEvent + public static void registerItems(RegistryEvent.Register event) { + IForgeRegistry r = event.getRegistry(); + + r.registerAll(WANDS); + ALL_ITEMS.addAll(Arrays.asList(WANDS)); + + registerItem(r, CORE_ANGEL); + registerItem(r, CORE_DESTRUCTION); + } public static Item.Properties propWand() { return new Item.Properties().tab(CreativeModeTab.TAB_TOOLS); @@ -49,6 +64,11 @@ public class ModItems return new Item.Properties().tab(CreativeModeTab.TAB_MISC).stacksTo(1); } + private static void registerItem(IForgeRegistry reg, Item item) { + reg.register(item); + ALL_ITEMS.add(item); + } + @SubscribeEvent public static void registerRecipeSerializers(RegistryEvent.Register> event) { IForgeRegistry> r = event.getRegistry(); @@ -57,8 +77,7 @@ public class ModItems @OnlyIn(Dist.CLIENT) public static void registerModelProperties() { - for(RegistryObject itemSupplier : WANDS) { - Item item = itemSupplier.get(); + for(Item item : WANDS) { ItemProperties.register( item, ConstructionWand.loc("using_core"), (stack, world, entity, n) -> entity == null || !(stack.getItem() instanceof ItemWand) ? 0 : @@ -71,8 +90,7 @@ public class ModItems public static void registerItemColors() { ItemColors colors = Minecraft.getInstance().getItemColors(); - for(RegistryObject itemSupplier : WANDS) { - Item item = itemSupplier.get(); + for(Item item : WANDS) { colors.register((stack, layer) -> (layer == 1 && stack.getItem() instanceof ItemWand) ? new WandOptions(stack).cores.get().getColor() : -1, item); } diff --git a/src/main/java/thetadev/constructionwand/items/core/ItemCore.java b/src/main/java/thetadev/constructionwand/items/core/ItemCore.java index 6b3362c..fb3b93b 100644 --- a/src/main/java/thetadev/constructionwand/items/core/ItemCore.java +++ b/src/main/java/thetadev/constructionwand/items/core/ItemCore.java @@ -3,7 +3,6 @@ package thetadev.constructionwand.items.core; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; @@ -11,14 +10,15 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import thetadev.constructionwand.ConstructionWand; import thetadev.constructionwand.api.IWandCore; +import thetadev.constructionwand.items.ItemBase; import javax.annotation.Nonnull; import java.util.List; -public abstract class ItemCore extends Item implements IWandCore +public abstract class ItemCore extends ItemBase implements IWandCore { - public ItemCore(Properties properties) { - super(properties); + public ItemCore(String name, Properties properties) { + super(name, properties); } @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/thetadev/constructionwand/items/core/ItemCoreAngel.java b/src/main/java/thetadev/constructionwand/items/core/ItemCoreAngel.java index 5062761..fc7a05a 100644 --- a/src/main/java/thetadev/constructionwand/items/core/ItemCoreAngel.java +++ b/src/main/java/thetadev/constructionwand/items/core/ItemCoreAngel.java @@ -5,8 +5,8 @@ import thetadev.constructionwand.wand.action.ActionAngel; public class ItemCoreAngel extends ItemCore { - public ItemCoreAngel(Properties properties) { - super(properties); + public ItemCoreAngel(String name, Properties properties) { + super(name, properties); } @Override diff --git a/src/main/java/thetadev/constructionwand/items/core/ItemCoreDestruction.java b/src/main/java/thetadev/constructionwand/items/core/ItemCoreDestruction.java index bb2b5d3..e243f06 100644 --- a/src/main/java/thetadev/constructionwand/items/core/ItemCoreDestruction.java +++ b/src/main/java/thetadev/constructionwand/items/core/ItemCoreDestruction.java @@ -5,8 +5,8 @@ import thetadev.constructionwand.wand.action.ActionDestruction; public class ItemCoreDestruction extends ItemCore { - public ItemCoreDestruction(Properties properties) { - super(properties); + public ItemCoreDestruction(String name, Properties properties) { + super(name, properties); } @Override diff --git a/src/main/java/thetadev/constructionwand/items/wand/ItemWand.java b/src/main/java/thetadev/constructionwand/items/wand/ItemWand.java index 4fa3529..5e19cc7 100644 --- a/src/main/java/thetadev/constructionwand/items/wand/ItemWand.java +++ b/src/main/java/thetadev/constructionwand/items/wand/ItemWand.java @@ -9,7 +9,6 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.context.UseOnContext; @@ -26,16 +25,17 @@ import thetadev.constructionwand.basics.option.IOption; import thetadev.constructionwand.basics.option.WandOptions; import thetadev.constructionwand.data.ICustomItemModel; import thetadev.constructionwand.data.ItemModelGenerator; +import thetadev.constructionwand.items.ItemBase; import thetadev.constructionwand.wand.WandJob; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; -public abstract class ItemWand extends Item implements ICustomItemModel +public abstract class ItemWand extends ItemBase implements ICustomItemModel { - public ItemWand(Properties properties) { - super(properties); + public ItemWand(String name, Properties properties) { + super(name, properties); } @Nonnull diff --git a/src/main/java/thetadev/constructionwand/items/wand/ItemWandBasic.java b/src/main/java/thetadev/constructionwand/items/wand/ItemWandBasic.java index 3db9d28..518954b 100644 --- a/src/main/java/thetadev/constructionwand/items/wand/ItemWandBasic.java +++ b/src/main/java/thetadev/constructionwand/items/wand/ItemWandBasic.java @@ -10,8 +10,8 @@ public class ItemWandBasic extends ItemWand { private final Tier tier; - public ItemWandBasic(Properties properties, Tier tier) { - super(properties.durability(tier.getUses())); + public ItemWandBasic(String name, Properties properties, Tier tier) { + super(name, properties.durability(tier.getUses())); this.tier = tier; } diff --git a/src/main/java/thetadev/constructionwand/items/wand/ItemWandInfinity.java b/src/main/java/thetadev/constructionwand/items/wand/ItemWandInfinity.java index 16bcc8a..8907001 100644 --- a/src/main/java/thetadev/constructionwand/items/wand/ItemWandInfinity.java +++ b/src/main/java/thetadev/constructionwand/items/wand/ItemWandInfinity.java @@ -3,7 +3,7 @@ package thetadev.constructionwand.items.wand; public class ItemWandInfinity extends ItemWand { - public ItemWandInfinity(Properties properties) { - super(properties.stacksTo(1).fireResistant()); + public ItemWandInfinity(String name, Properties properties) { + super(name, properties.stacksTo(1).fireResistant()); } } diff --git a/src/main/java/thetadev/constructionwand/wand/WandJob.java b/src/main/java/thetadev/constructionwand/wand/WandJob.java index b35f6f6..313b6c8 100644 --- a/src/main/java/thetadev/constructionwand/wand/WandJob.java +++ b/src/main/java/thetadev/constructionwand/wand/WandJob.java @@ -74,7 +74,7 @@ public class WandJob public void getSnapshots() { int limit; // Infinity wand gets enhanced limit in creative mode - if(player.isCreative() && wandItem == ModItems.WAND_INFINITY.get()) limit = ConfigServer.LIMIT_CREATIVE.get(); + if(player.isCreative() && wandItem == ModItems.WAND_INFINITY) limit = ConfigServer.LIMIT_CREATIVE.get(); else limit = Math.min(wandItem.remainingDurability(wand), wandAction.getLimit(wand)); if(rayTraceResult.getType() == HitResult.Type.BLOCK)