forked from LogBlock/LogBlock
Add cauldron interact logging
This commit is contained in:
@ -161,6 +161,9 @@ public class LogBlock extends JavaPlugin {
|
||||
if (isLogging(Logging.SCAFFOLDING)) {
|
||||
pm.registerEvents(scaffoldingLogging = new ScaffoldingLogging(this), this);
|
||||
}
|
||||
if (isLogging(Logging.CAULDRONINTERACT)) {
|
||||
pm.registerEvents(new CauldronLogging(this), this);
|
||||
}
|
||||
if (isLogging(Logging.CREEPEREXPLOSION) || isLogging(Logging.TNTEXPLOSION) || isLogging(Logging.GHASTFIREBALLEXPLOSION) || isLogging(Logging.ENDERDRAGON) || isLogging(Logging.MISCEXPLOSION)) {
|
||||
pm.registerEvents(new ExplosionLogging(this), this);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ public enum Logging {
|
||||
COMPARATORINTERACT,
|
||||
PRESUREPLATEINTERACT,
|
||||
TRIPWIREINTERACT,
|
||||
CAULDRONINTERACT(true),
|
||||
CREATURECROPTRAMPLE,
|
||||
CROPTRAMPLE,
|
||||
NATURALSTRUCTUREGROW,
|
||||
|
@ -0,0 +1,27 @@
|
||||
package de.diddiz.LogBlock.listeners;
|
||||
|
||||
import de.diddiz.LogBlock.Actor;
|
||||
import de.diddiz.LogBlock.LogBlock;
|
||||
import de.diddiz.LogBlock.Logging;
|
||||
import de.diddiz.LogBlock.config.Config;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
||||
|
||||
public class CauldronLogging extends LoggingListener {
|
||||
public CauldronLogging(LogBlock lb) {
|
||||
super(lb);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onCauldronLevelChange(CauldronLevelChangeEvent event) {
|
||||
if (Config.isLogging(event.getBlock().getWorld(), Logging.CAULDRONINTERACT)) {
|
||||
Entity causingEntity = event.getEntity();
|
||||
if (causingEntity instanceof Player) {
|
||||
consumer.queueBlockReplace(Actor.actorFromEntity(causingEntity), event.getBlock().getBlockData(), event.getNewState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user