Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix beds exploding in the Nether & End dimensions with explosions off #243

Merged
merged 1 commit into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
import org.bukkit.entity.Tameable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockDispenseEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
Expand Down Expand Up @@ -116,6 +108,16 @@ public void onExplosionPrime(ExplosionPrimeEvent event)

event.setRadius(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue());
}

@EventHandler(priority = EventPriority.HIGH)
public void onBlockExplode(BlockExplodeEvent event) {
if(!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) {
event.setCancelled(true);
return;
}

event.setYield(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue());
}

@EventHandler(priority = EventPriority.HIGH)
public void onEntityCombust(EntityCombustEvent event)
Expand Down