package nu.nerd.modmode;

import de.diddiz.LogBlock.Actor;
import de.diddiz.LogBlock.events.BlockChangePreLogEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.UUID;

// ------------------------------------------------------------------------
/**
 * The LogBlock event-handling class.
 */
public class LogBlockListener implements Listener {

    // ------------------------------------------------------------------------
    /**
     * Constructor.
     */
    LogBlockListener() {
        ModMode.PLUGIN.getServer().getPluginManager().registerEvents(this, ModMode.PLUGIN);
    }

    // ------------------------------------------------------------------------
    /**
     * Ensures edits made by players in ModMode are logged with that player's
     * ModMode name.
     */
    @EventHandler
    public void onLogBlockPreLogEvent(BlockChangePreLogEvent event) {
        UUID actorUUID = UUID.fromString(event.getOwnerActor().getUUID());
        Player player = ModMode.PLUGIN.getServer().getPlayer(actorUUID);
        if (player != null && ModMode.PLUGIN.isModMode(player)) {
            Actor actor = new Actor(ModMode.PLUGIN.getCleanModModeName(player));
            event.setOwner(actor);
        }
    }

} // LogBlockListener

@@ -933,24 +933,65 @@
 nt event) %7B%0A
+        Player player;%0A        try %7B%0A    
         UUID
@@ -1057,30 +1057,27 @@
 ));%0A        
-Player
+   
  player = Mo
@@ -1123,16 +1123,127 @@
 rUUID);%0A
+        %7D catch (Exception e) %7B%0A            // probably liquid flow or something%0A            return;%0A        %7D%0A
         

Use actors