forked from LogBlock/LogBlock
Check if EntityChangeBlockEvent is triggered by Enderman
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.diddiz.LogBlock.listeners;
|
||||
|
||||
import static de.diddiz.LogBlock.config.Config.isLogging;
|
||||
import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
@@ -15,7 +16,7 @@ public class EndermenLogging extends LoggingListener
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
|
||||
if (!event.isCancelled() && isLogging(event.getBlock().getWorld(), Logging.ENDERMEN))
|
||||
if (!event.isCancelled() && event.getEntity() instanceof Enderman && isLogging(event.getBlock().getWorld(), Logging.ENDERMEN))
|
||||
consumer.queueBlockReplace("Enderman", event.getBlock().getState(), event.getTo().getId(), (byte)0); // Figure out how to get the data of the placed block;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user