Fixed for new SpoutAPI version.

This commit is contained in:
TomyLobo 2012-01-24 03:48:14 +01:00
parent 483edd76bd
commit a7c75285d9
2 changed files with 11 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public class SpoutWorld extends LocalWorld {
*/ */
@Override @Override
public boolean setBlockType(Vector pt, int type) { public boolean setBlockType(Vector pt, int type) {
world.setBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short)type); world.setBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short)type, WorldEditPlugin.getInstance());
return world.getBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()) != type; return world.getBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()) != type;
} }
@ -96,7 +96,7 @@ public class SpoutWorld extends LocalWorld {
@Override @Override
public boolean setTypeIdAndData(Vector pt, int type, int data) { public boolean setTypeIdAndData(Vector pt, int type, int data) {
int origType = getBlockType(pt), origData = getBlockData(pt); int origType = getBlockType(pt), origData = getBlockData(pt);
world.setBlockIdAndData(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short) type, (short) data); world.setBlockIdAndData(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short) type, (short) data, WorldEditPlugin.getInstance());
return origType != type && origData != data; return origType != type && origData != data;
} }

View File

@ -66,6 +66,11 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
*/ */
private YAMLConfiguration config; private YAMLConfiguration config;
private static WorldEditPlugin instance;
{
instance = this;
}
/** /**
* Called on plugin enable. * Called on plugin enable.
*/ */
@ -351,4 +356,8 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
public String getName() { public String getName() {
return getDescription().getName(); return getDescription().getName();
} }
static WorldEditPlugin getInstance() {
return instance;
}
} }