Fixed for 1.4_00_01 and fixed typo.

This commit is contained in:
Wizjany 2011-04-22 01:09:16 +08:00 committed by MonsieurApple
parent 4ed1082309
commit 3f2afa9581
2 changed files with 9 additions and 9 deletions

View File

@ -312,7 +312,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public boolean generateTree(EditSession editSession, Vector pt) { public boolean generateTree(EditSession editSession, Vector pt) {
return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.TREE, return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.TREE,
new EditSessionBlockChangeDegate(editSession)); new EditSessionBlockChangeDelegate(editSession));
} }
/** /**
@ -324,7 +324,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public boolean generateBigTree(EditSession editSession, Vector pt) { public boolean generateBigTree(EditSession editSession, Vector pt) {
return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.BIG_TREE, return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.BIG_TREE,
new EditSessionBlockChangeDegate(editSession)); new EditSessionBlockChangeDelegate(editSession));
} }
/** /**
@ -336,7 +336,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public boolean generateBirchTree(EditSession editSession, Vector pt) { public boolean generateBirchTree(EditSession editSession, Vector pt) {
return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.BIRCH, return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.BIRCH,
new EditSessionBlockChangeDegate(editSession)); new EditSessionBlockChangeDelegate(editSession));
} }
/** /**
@ -348,7 +348,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public boolean generateRedwoodTree(EditSession editSession, Vector pt) { public boolean generateRedwoodTree(EditSession editSession, Vector pt) {
return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.REDWOOD, return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.REDWOOD,
new EditSessionBlockChangeDegate(editSession)); new EditSessionBlockChangeDelegate(editSession));
} }
/** /**
@ -360,7 +360,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) { public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) {
return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.TALL_REDWOOD, return world.generateTree(BukkitUtil.toLocation(world, pt), TreeType.TALL_REDWOOD,
new EditSessionBlockChangeDegate(editSession)); new EditSessionBlockChangeDelegate(editSession));
} }
/** /**

View File

@ -30,14 +30,14 @@ import com.sk89q.worldedit.blocks.BaseBlock;
* *
* @author sk89q * @author sk89q
*/ */
public class EditSessionBlockChangeDegate implements BlockChangeDelegate { public class EditSessionBlockChangeDelegate implements BlockChangeDelegate {
private EditSession editSession; private EditSession editSession;
public EditSessionBlockChangeDegate(EditSession editSession) { public EditSessionBlockChangeDelegate(EditSession editSession) {
this.editSession = editSession; this.editSession = editSession;
} }
public boolean setTypeId(int x, int y, int z, int typeId) { public boolean setRawTypeId(int x, int y, int z, int typeId) {
try { try {
return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId)); return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId));
} catch (MaxChangedBlocksException ex) { } catch (MaxChangedBlocksException ex) {
@ -45,7 +45,7 @@ public class EditSessionBlockChangeDegate implements BlockChangeDelegate {
} }
} }
public boolean setTypeIdAndData(int x, int y, int z, int typeId, int data) { public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data) {
try { try {
return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId, data)); return editSession.setBlock(new Vector(x, y, z), new BaseBlock(typeId, data));
} catch (MaxChangedBlocksException ex) { } catch (MaxChangedBlocksException ex) {