From 2c1fb17c189653c9a464952f2257d14d5ec8a346 Mon Sep 17 00:00:00 2001 From: ArkoSammy12 Date: Sat, 17 Aug 2024 21:40:43 -0500 Subject: [PATCH] Small tweaks --- .../creeperhealing/mixin/ExplosionMixin.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/xd/arkosammy/creeperhealing/mixin/ExplosionMixin.java b/src/main/java/xd/arkosammy/creeperhealing/mixin/ExplosionMixin.java index 4478465..f9f671f 100644 --- a/src/main/java/xd/arkosammy/creeperhealing/mixin/ExplosionMixin.java +++ b/src/main/java/xd/arkosammy/creeperhealing/mixin/ExplosionMixin.java @@ -124,13 +124,7 @@ private void setThreadLocals(boolean particles, CallbackInfo ci) { private void emitExplosionContext(boolean particles, CallbackInfo ci) { ExplosionUtils.DROP_BLOCK_ITEMS.set(true); ExplosionUtils.DROP_CONTAINER_INVENTORY_ITEMS.set(true); - if (world.isClient()) { - this.vanillaAffectedPositions.clear(); - this.affectedStatesAndBlockEntities.clear(); - this.indirectlyAffectedPositions.clear(); - return; - } - if (!this.creeperhealing$shouldHeal()) { + if (world.isClient() || !this.creeperhealing$shouldHeal()) { this.vanillaAffectedPositions.clear(); this.affectedStatesAndBlockEntities.clear(); this.indirectlyAffectedPositions.clear(); @@ -154,8 +148,12 @@ private void emitExplosionContext(boolean particles, CallbackInfo ci) { } List filteredAffectedPositions = new ArrayList<>(); for (BlockPos pos : this.vanillaAffectedPositions) { + Pair pair = this.affectedStatesAndBlockEntities.get(pos); + if (pair == null) { + continue; + } + BlockState state = pair.getLeft(); // Hardcoded exception, place before all other logic - BlockState state = this.affectedStatesAndBlockEntities.get(pos).getLeft(); if (ExcludedBlocks.isExcluded(state)) { continue; }