From fa41cc1ba904df18e7b2e4556fe691b49dd5df07 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Sun, 30 May 2021 11:26:27 +0200 Subject: [PATCH] Smelter can not be applied on Hoe any longer --- .../enchantments/HarvesterEnchantment.java | 2 +- .../enchantments/SmelterEnchantment.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/wonderfulenchantments/enchantments/HarvesterEnchantment.java b/src/main/java/com/wonderfulenchantments/enchantments/HarvesterEnchantment.java index a945f0b8..07ad9da7 100644 --- a/src/main/java/com/wonderfulenchantments/enchantments/HarvesterEnchantment.java +++ b/src/main/java/com/wonderfulenchantments/enchantments/HarvesterEnchantment.java @@ -44,7 +44,7 @@ public HarvesterEnchantment() { @Override public boolean canApplyAtEnchantingTable( ItemStack stack ) { - return stack.getItem() instanceof HoeItem && stack.canApplyAtEnchantingTable( this ); + return stack.getItem() instanceof HoeItem && super.canApplyAtEnchantingTable( stack ); } /** Adding possibility to harvest crops with right click. */ diff --git a/src/main/java/com/wonderfulenchantments/enchantments/SmelterEnchantment.java b/src/main/java/com/wonderfulenchantments/enchantments/SmelterEnchantment.java index 171a5c4c..ae92f12d 100644 --- a/src/main/java/com/wonderfulenchantments/enchantments/SmelterEnchantment.java +++ b/src/main/java/com/wonderfulenchantments/enchantments/SmelterEnchantment.java @@ -6,6 +6,8 @@ import net.minecraft.enchantment.EnchantmentType; import net.minecraft.enchantment.SilkTouchEnchantment; import net.minecraft.inventory.EquipmentSlotType; +import net.minecraft.item.HoeItem; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; /** Enchantment that automatically smelts destroyed blocks. (if possible) */ @@ -40,4 +42,9 @@ public boolean shouldIncreaseLoot( ResourceLocation blockLocation ) { public boolean canApplyTogether( Enchantment enchantment ) { return !( enchantment instanceof SilkTouchEnchantment ) && super.canApplyTogether( enchantment ); } + + @Override + public boolean canApplyAtEnchantingTable( ItemStack stack ) { + return !( stack.getItem() instanceof HoeItem ) && super.canApplyAtEnchantingTable( stack ); + } }