2018-09-12 15:53:47 +00:00
|
|
|
package xyz.etztech.qol.listeners;
|
|
|
|
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.Listener;
|
|
|
|
import org.bukkit.event.block.BlockIgniteEvent;
|
|
|
|
import xyz.etztech.qol.QoL;
|
|
|
|
|
|
|
|
public class BlockIgniteListener implements Listener {
|
|
|
|
|
|
|
|
QoL plugin;
|
|
|
|
|
|
|
|
public BlockIgniteListener(QoL plugin) {
|
|
|
|
this.plugin = plugin;
|
2020-07-09 14:42:58 +00:00
|
|
|
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
2018-09-12 15:53:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void onBlockIgnite(BlockIgniteEvent event) {
|
|
|
|
BlockIgniteEvent.IgniteCause cause = event.getCause();
|
|
|
|
if (plugin.getConfig().getBoolean("disable-fire." + cause.name().toLowerCase())) {
|
|
|
|
event.setCancelled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|