Curios be used as Ender Masks
Nyfaria opened this issue ยท 0 comments
Please describe the new feature or change.
Well the name describes it all really.
Please describe why you want this feature.
Mostly for personal use but im certain many people would love to not have to Mixin this themselves.
Here is my Mixin so you can go off it, im sure it wont look the same because im using the API and yours will be directly in the mod:
@Mixin(EnderMan.class)
public class EnderMaskMixin {
boolean found = false;
@Inject(method = "isLookingAtMe", at = @At("HEAD"), cancellable = true)
public void curioEnderMask(Player player, CallbackInfoReturnable<Boolean> cir) {
found = false;
CuriosApi.getCuriosHelper().getEquippedCurios(player).ifPresent(e -> {
for (int i = 0; i < e.getSlots(); i++) {
ItemStack itemStack = e.getStackInSlot(i);
if (itemStack.getItem().isEnderMask(itemStack, player, (EnderMan) (Object) this)) {
found = true;
}
}
});
if(found){
cir.setReturnValue(false);
}
}
}