Properly disable explosions (#45)

* Remove unused import

* Properly disable explosions
This commit is contained in:
Allink 2022-06-05 21:29:49 +01:00 committed by GitHub
parent 5fe48cfd7f
commit 13acf7ba9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,6 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockRedstoneEvent;
public class BlockListener extends PlexListener public class BlockListener extends PlexListener
{ {

View File

@ -4,13 +4,23 @@ import dev.plex.listener.PlexListener;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
public class TogglesListener extends PlexListener public class TogglesListener extends PlexListener
{ {
@EventHandler @EventHandler
public void onEntityExplode(ExplosionPrimeEvent event) public void onBlockExplode(ExplosionPrimeEvent event)
{
if (!plugin.toggles.getBoolean("explosions"))
{
event.setCancelled(true);
}
}
@EventHandler
public void onEntityExplode(EntityExplodeEvent event)
{ {
if (!plugin.toggles.getBoolean("explosions")) if (!plugin.toggles.getBoolean("explosions"))
{ {