Added WorldEdit logging

This commit is contained in:
Ammar Askar
2013-01-12 12:37:45 +05:00
parent 208dcc0160
commit e361c39937
6 changed files with 67 additions and 59 deletions
@@ -1,20 +1,28 @@
package de.diddiz.worldedit;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.EditSessionFactory;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.bags.BlockBag;
public class LogBlockEditSessionFactory extends EditSessionFactory {
@Override
public EditSession getEditSession(LocalWorld world, int maxBlocks) {
return new LogBlockEditSession(world, maxBlocks);
public EditSession getEditSession(LocalWorld world, int maxBlocks, LocalPlayer player) {
return new LogBlockEditSession(world, maxBlocks, player);
}
@Override
public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag) {
return new LogBlockEditSession(world, maxBlocks, blockBag);
public EditSession getEditSession(LocalWorld world, int maxBlocks, BlockBag blockBag, LocalPlayer player) {
return new LogBlockEditSession(world, maxBlocks, blockBag, player);
}
public static void initialize() {
try {
// Check to see if the world edit version is compatible
Class.forName("com.sk89q.worldedit.EditSessionFactory").getDeclaredMethod("getEditSession", LocalWorld.class, int.class, BlockBag.class, LocalPlayer.class);
WorldEdit.getInstance().setEditSessionFactory(new LogBlockEditSessionFactory());
} catch (Throwable t) {
}
}
}