diff --git a/src/main/java/net/ltxprogrammer/changed/entity/ChangedEntity.java b/src/main/java/net/ltxprogrammer/changed/entity/ChangedEntity.java index b55ca3531..c99f6bf17 100644 --- a/src/main/java/net/ltxprogrammer/changed/entity/ChangedEntity.java +++ b/src/main/java/net/ltxprogrammer/changed/entity/ChangedEntity.java @@ -757,16 +757,17 @@ public boolean tryTransfurTarget(Entity entity) { TransfurVariant variant = this.getTransfurVariant(); if (entity instanceof LivingEntity livingEntity) { - IAbstractChangedEntity source = IAbstractChangedEntity.forEither(maybeGetUnderlying()); - if (tryFuseWithTarget(livingEntity, source, damage)) + final var context = getAttackContext(); + damage = ProcessTransfur.checkBlocked(livingEntity, damage, context.source); + if (tryFuseWithTarget(livingEntity, context.source, damage)) return true; if (TransfurVariant.getEntityVariant(livingEntity) == null) { if (livingEntity instanceof Player player) { - ProcessTransfur.progressPlayerTransfur(player, damage, variant, getAttackContext()); + ProcessTransfur.progressPlayerTransfur(player, damage, variant, context); return true; } else if (livingEntity.getType().is(ChangedTags.EntityTypes.HUMANOIDS)) { - ProcessTransfur.progressTransfur(livingEntity, damage, variant, getAttackContext()); + ProcessTransfur.progressTransfur(livingEntity, damage, variant, context); return true; } } diff --git a/src/main/java/net/ltxprogrammer/changed/process/ProcessTransfur.java b/src/main/java/net/ltxprogrammer/changed/process/ProcessTransfur.java index cdef9b940..6b30938f0 100644 --- a/src/main/java/net/ltxprogrammer/changed/process/ProcessTransfur.java +++ b/src/main/java/net/ltxprogrammer/changed/process/ProcessTransfur.java @@ -75,7 +75,7 @@ public static float getPlayerTransfurProgress(Player player) { return ext.getTransfurProgress(); } - protected static float checkBlocked(LivingEntity blocker, float amount, IAbstractChangedEntity source) { + public static float checkBlocked(LivingEntity blocker, float amount, IAbstractChangedEntity source) { if (source == null || amount <= 0.0f) return amount; @@ -126,8 +126,6 @@ public static boolean progressPlayerTransfur(Player player, float amount, Transf return false; } - amount = checkBlocked(player, amount, context.source); - if (amount <= 0.0f) return false;