Skip to content

Commit

Permalink
fix tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Partonetrain committed Apr 10, 2024
1 parent 3ce0639 commit d41794e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void initAllowedEnchantments() {
}
}

public static boolean enchantmentAllowed(Enchantment enchantment){
public static boolean isEnchantmentAllowed(Enchantment enchantment){
return allowedEnchantments.contains(enchantment);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
import info.partonetrain.botaniacombat.item.SlaughtersawItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(Enchantment.class)
public abstract class EnchantmentMixin {

@Inject(method = "canEnchant", at = @At("RETURN"), cancellable = true)
@Inject(method = "canEnchant", at = @At("HEAD"), cancellable = true)
private void botaniaCombat$canEnchant(ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
if(stack.getItem() instanceof SlaughtersawItem){
cir.setReturnValue(SlaughtersawItem.enchantmentAllowed((Enchantment)(Object) this));
Enchantment self = (Enchantment) (Object) this;
cir.setReturnValue(SlaughtersawItem.isEnchantmentAllowed(self));
//NOTE: FDRF overrides Backstabbing's canEnchant method.
// As of writing, this code is ineffective for Backstabbing.
//See issue: https://github.com/MehVahdJukaar/FarmersDelight/issues/22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package info.partonetrain.botaniacombat.mixin.slaughtersaw;

import info.partonetrain.botaniacombat.BotaniaCombat;
import info.partonetrain.botaniacombat.item.SlaughtersawItem;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/data/c/tags/blocks/mineable/knife.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}

0 comments on commit d41794e

Please sign in to comment.