diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5a13d9..13634c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,4 +3,5 @@ - Fixed priority on `modify_scale` Scale Modifiers being the same as a regular scale modifier. - Fixed flickering with `modify_scale` powers. - Fixed modify scale not stacking with a `delay` field higher than 0 and conditional. #61 -- Fixed a crash relating to explosions. #62 \ No newline at end of file +- Fixed a crash relating to explosions. #62 +- Fixed a crash relating to `prevent_bee_anger` and beehive blocks. #62 (part 2) \ No newline at end of file diff --git a/common/src/main/java/net/merchantpug/apugli/mixin/xplatform/common/BeehiveBlockMixin.java b/common/src/main/java/net/merchantpug/apugli/mixin/xplatform/common/BeehiveBlockMixin.java index aed69e20..61c9be20 100644 --- a/common/src/main/java/net/merchantpug/apugli/mixin/xplatform/common/BeehiveBlockMixin.java +++ b/common/src/main/java/net/merchantpug/apugli/mixin/xplatform/common/BeehiveBlockMixin.java @@ -19,9 +19,9 @@ @Mixin(BeehiveBlock.class) public class BeehiveBlockMixin { - @Inject(method = "angerNearbyBees", at = @At(value = "INVOKE", target = "Ljava/util/List;iterator()Ljava/util/Iterator;", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) + @Inject(method = "angerNearbyBees", at = @At(value = "INVOKE", target = "Ljava/util/List;isEmpty()Z", ordinal = 1), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) private void apugli$dontAngerBees(Level level, BlockPos pos, CallbackInfo ci, AABB aABB, List list, List list2) { - if (list2.stream().anyMatch(player -> Services.POWER.hasPower(player, ApugliPowers.PREVENT_BEE_ANGER.get()))) { + if (!list2.isEmpty() && list2.stream().anyMatch(player -> Services.POWER.hasPower(player, ApugliPowers.PREVENT_BEE_ANGER.get()))) { ci.cancel(); } }