Skip to content

Commit

Permalink
Merge pull request #51 from Nadwey/fix-cauldron-explosions
Browse files Browse the repository at this point in the history
Remove cauldrons properly upon explosion
  • Loading branch information
Jsinco authored Nov 14, 2024
2 parents 28cd69a + bda0485 commit a8138e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/dre/brewery/listeners/EntityListener.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.dre.brewery.listeners;

import com.dre.brewery.BCauldron;
import com.dre.brewery.Barrel;
import com.dre.brewery.Brew;
import com.dre.brewery.BreweryPlugin;
import com.dre.brewery.api.events.barrel.BarrelDestroyEvent;
import com.dre.brewery.utility.BUtil;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
Expand Down Expand Up @@ -58,6 +60,11 @@ public void onExplode(EntityExplodeEvent event) {
Block block;
blocks: while (iter.hasNext()) {
block = iter.next();
BCauldron cauldron = BCauldron.get(block);
if (cauldron != null) {
BUtil.blockDestroy(block, null, BarrelDestroyEvent.Reason.EXPLODED);
continue;
}
if (!breakEvents.isEmpty()) {
for (BarrelDestroyEvent breakEvent : breakEvents) {
if (breakEvent.getBarrel().hasBlock(block)) {
Expand Down

0 comments on commit a8138e6

Please sign in to comment.