From 07942b4b532bd897f4fe6f41ba6a418b7617dee7 Mon Sep 17 00:00:00 2001 From: Pug <81167232+MerchantPug@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:01:53 +1100 Subject: [PATCH] Attempted fix for BeehiveBlockMixin inject failure. --- .../apugli/mixin/xplatform/common/BeehiveBlockMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); } }