Hi all,
I have the following mixin -
@Mixin(ContainerBeacon.class)
public abstract class MixinContainerBeacon extends Container {
@Shadow
@Final
private Slot beaconSlot;
@Inject(method = "onContainerClosed", at = @At("HEAD"))
public void onOnContainerClosed(EntityPlayer player, CallbackInfo ci) {
if (player instanceof EntityPlayerMP) {
if (beaconSlot.getStack().getCount() > 1) {
EnchantmentCracker.dropItemCheck();
}
}
}
}
However, the beaconSlot field is actually declared in ContainerBeacon as follows:
private final ContainerBeacon.BeaconSlot beaconSlot;
The class ContainerBeacon.BeaconSlot is private.
When I try to compile the code I get the following warning:
enchantment_cracking\build\sources\main\java\net\earthcomputer\enchcrack\mixin\MixinContainerBeacon.java:20: warning: Cannot find target for @Shadow field in net.minecraft.inventory.ContainerBeacon
@Shadow
^
I think this error is due to the shadow field’s type not matching the target field, but I’m unsure how to declare the shadow field to have the same type.
Any help appreciated