Skip to content

Commit

Permalink
Smelter can not be applied on Hoe any longer
Browse files Browse the repository at this point in the history
  • Loading branch information
Majrusz committed May 30, 2021
1 parent 682ca20 commit fa41cc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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 );
}
}

0 comments on commit fa41cc1

Please sign in to comment.