Deprecated Block.getFace(Face) and Block.getFace(Face,int); use getRelative()

Dieser Commit ist enthalten in:
Erik Broes 2011-07-17 15:02:32 +02:00
Ursprung f3a86eaaca
Commit f7712eb20c
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -535,13 +535,13 @@ public abstract class Entity {
org.bukkit.block.Block block = this.world.getWorld().getBlockAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height), MathHelper.floor(this.locZ)); org.bukkit.block.Block block = this.world.getWorld().getBlockAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height), MathHelper.floor(this.locZ));
if (d5 > d0) { if (d5 > d0) {
block = block.getFace(BlockFace.SOUTH); block = block.getRelative(BlockFace.SOUTH);
} else if (d5 < d0) { } else if (d5 < d0) {
block = block.getFace(BlockFace.NORTH); block = block.getRelative(BlockFace.NORTH);
} else if (d7 > d2) { } else if (d7 > d2) {
block = block.getFace(BlockFace.WEST); block = block.getRelative(BlockFace.WEST);
} else if (d7 < d2) { } else if (d7 < d2) {
block = block.getFace(BlockFace.EAST); block = block.getRelative(BlockFace.EAST);
} }
VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(vehicle, block); VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(vehicle, block);

Datei anzeigen

@ -182,7 +182,7 @@ public class CraftBlock implements Block {
* @return Block at the given face * @return Block at the given face
*/ */
public Block getFace(final BlockFace face) { public Block getFace(final BlockFace face) {
return getFace(face, 1); return getRelative(face, 1);
} }
/** /**
@ -201,7 +201,7 @@ public class CraftBlock implements Block {
* @return Block at the given face * @return Block at the given face
*/ */
public Block getFace(final BlockFace face, final int distance) { public Block getFace(final BlockFace face, final int distance) {
return getRelative(face.getModX() * distance, face.getModY() * distance, face.getModZ() * distance); return getRelative(face, distance);
} }
/** /**