mixin maintenance

This commit is contained in:
dfsek
2021-05-03 20:12:48 -07:00
parent a30859a3d4
commit 6209b86560
2 changed files with 3 additions and 7 deletions
@@ -20,12 +20,6 @@ public abstract class ItemStackMixin {
@Shadow @Shadow
public abstract net.minecraft.item.Item getItem(); public abstract net.minecraft.item.Item getItem();
@Shadow
public abstract boolean isDamageable();
@Shadow
public abstract ItemStack copy();
public int terra$getAmount() { public int terra$getAmount() {
return getCount(); return getCount();
} }
@@ -34,7 +28,7 @@ public abstract class ItemStackMixin {
setCount(i); setCount(i);
} }
public Item getType() { public Item terra$getType() {
return (Item) getItem(); return (Item) getItem();
} }
@@ -8,6 +8,7 @@ import net.minecraft.nbt.ListTag;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@@ -31,6 +32,7 @@ public abstract class ItemStackMetaMixin {
return this; return this;
} }
@Intrinsic(displace = true)
public Map<Enchantment, Integer> terra$getEnchantments() { public Map<Enchantment, Integer> terra$getEnchantments() {
if(!hasEnchantments()) return Collections.emptyMap(); if(!hasEnchantments()) return Collections.emptyMap();
Map<Enchantment, Integer> map = new HashMap<>(); Map<Enchantment, Integer> map = new HashMap<>();