2012-10-31 21:36:16 +05:00
|
|
|
package de.diddiz.worldedit;
|
|
|
|
|
|
2013-01-12 12:37:45 +05:00
|
|
|
import com.sk89q.worldedit.*;
|
2012-10-31 21:36:16 +05:00
|
|
|
import com.sk89q.worldedit.bags.BlockBag;
|
|
|
|
|
|
|
|
|
|
public class LogBlockEditSessionFactory extends EditSessionFactory {
|
2013-01-12 12:37:45 +05:00
|
|
|
|
2012-10-31 21:36:16 +05:00
|
|
|
@Override
|
2013-01-12 12:37:45 +05:00
|
|
|
public EditSession getEditSession(LocalWorld world, int maxBlocks, LocalPlayer player) {
|
|
|
|
|
return new LogBlockEditSession(world, maxBlocks, player);
|
2012-10-31 21:36:16 +05:00
|
|
|
}
|
2013-01-12 12:37:45 +05:00
|
|
|
|
2012-10-31 21:36:16 +05:00
|
|
|
@Override
|
2013-01-12 12:37:45 +05:00
|
|
|
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) {
|
|
|
|
|
|
|
|
|
|
}
|
2012-10-31 21:36:16 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|