3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 04:50:06 +01:00

Changed BlockFace enum to match coding standards

Dieser Commit ist enthalten in:
Dinnerbone 2011-01-15 20:16:30 +00:00
Ursprung 5aa1bc269d
Commit 2184d240db
8 geänderte Dateien mit 18 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -165,7 +165,7 @@ public class BlockButton extends Block {
//Allow the lever to change the current //Allow the lever to change the current
int old = (j1 != 8) ? 1 : 0; int old = (j1 != 8) ? 1 : 0;
int current = (j1 == 8) ? 1 : 0; int current = (j1 == 8) ? 1 : 0;
BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.Self, old, current); BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.SELF, old, current);
((WorldServer) world).getServer().getPluginManager().callEvent(bre); ((WorldServer) world).getServer().getPluginManager().callEvent(bre);
if ((bre.getNewCurrent() > 0) == (j1 == 8)) { if ((bre.getNewCurrent() > 0) == (j1 == 8)) {
world.c(i, j, k, i1 + j1); world.c(i, j, k, i1 + j1);

Datei anzeigen

@ -92,7 +92,7 @@ public class BlockFlowing extends BlockFluids {
CraftBlock source = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i1, j1, k1); CraftBlock source = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i1, j1, k1);
if (l(world, i1, j1 - 1, k1)) { if (l(world, i1, j1 - 1, k1)) {
// Craftbucket send "down" to the server // Craftbucket send "down" to the server
BlockFromToEvent blockFlow = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.Down); BlockFromToEvent blockFlow = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.DOWN);
((WorldServer) world).getServer().getPluginManager().callEvent(blockFlow); ((WorldServer) world).getServer().getPluginManager().callEvent(blockFlow);
if (!blockFlow.isCancelled()) { if (!blockFlow.isCancelled()) {
@ -114,7 +114,7 @@ public class BlockFlowing extends BlockFluids {
return; return;
} }
// CraftBukkit start - all four cardinal directions. Do not change the order! // CraftBukkit start - all four cardinal directions. Do not change the order!
BlockFace[] faces = new BlockFace[]{ BlockFace.North, BlockFace.South, BlockFace.East, BlockFace.West }; BlockFace[] faces = new BlockFace[]{ BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST };
int index = 0; int index = 0;
for (BlockFace currentFace: faces) { for (BlockFace currentFace: faces) {
if (aflag[index]) { if (aflag[index]) {

Datei anzeigen

@ -164,7 +164,7 @@ public class BlockLever extends Block {
// Craftbukkit start // Craftbukkit start
int old = (j1 != 8) ? 1 : 0; int old = (j1 != 8) ? 1 : 0;
int current = (j1 == 8) ? 1 : 0; int current = (j1 == 8) ? 1 : 0;
BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.Self, old, current); BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.SELF, old, current);
((WorldServer) world).getServer().getPluginManager().callEvent(bre); ((WorldServer) world).getServer().getPluginManager().callEvent(bre);
// Craftbukkit end // Craftbukkit end

Datei anzeigen

@ -120,7 +120,7 @@ public class BlockPressurePlate extends Block {
// Craftbukkit start // Craftbukkit start
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k); CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.Self, flag ? 15 : 0, flag1 ? 15 : 0); BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.SELF, flag ? 15 : 0, flag1 ? 15 : 0);
((WorldServer) world).getServer().getPluginManager().callEvent(bre); ((WorldServer) world).getServer().getPluginManager().callEvent(bre);
flag1 = bre.getNewCurrent() > 0; flag1 = bre.getNewCurrent() > 0;
// Craftbukkit end // Craftbukkit end

Datei anzeigen

@ -111,7 +111,7 @@ public class BlockRedstoneTorch extends BlockTorch {
// Craftbukkit start // Craftbukkit start
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k); CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.Self, flag ? 15 : 0, flag ? 0 : 15); BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.SELF, flag ? 15 : 0, flag ? 0 : 15);
((WorldServer) world).getServer().getPluginManager().callEvent(bre); ((WorldServer) world).getServer().getPluginManager().callEvent(bre);
if ((bre.getNewCurrent() != 0) == flag) { if ((bre.getNewCurrent() != 0) == flag) {
return; return;

Datei anzeigen

@ -97,7 +97,7 @@ public class BlockRedstoneWire extends Block {
// Craftbukkit start // Craftbukkit start
if (k1 != l1) { if (k1 != l1) {
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k); CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.Self, k1, l1); BlockRedstoneEvent bre = new BlockRedstoneEvent(block, BlockFace.SELF, k1, l1);
((WorldServer) world).getServer().getPluginManager().callEvent(bre); ((WorldServer) world).getServer().getPluginManager().callEvent(bre);
l1 = bre.getNewCurrent(); l1 = bre.getNewCurrent();
} }

Datei anzeigen

@ -385,7 +385,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (blockClicked != null && itemstack != null) { if (blockClicked != null && itemstack != null) {
blockFace = CraftBlock.notchToBlockFace(packet15place.d); blockFace = CraftBlock.notchToBlockFace(packet15place.d);
} else { } else {
blockFace = BlockFace.Self; blockFace = BlockFace.SELF;
} }
// CraftBukkit if rightclick decremented the item, always send the update packet. // CraftBukkit if rightclick decremented the item, always send the update packet.

Datei anzeigen

@ -168,7 +168,7 @@ public class CraftBlock implements Block {
* above 100,100,100. * above 100,100,100.
* <pre> * <pre>
* Block block = world.getBlockAt(100,100,100); * Block block = world.getBlockAt(100,100,100);
* Block shower = block.getFace(BlockFace.Up, 2); * Block shower = block.getFace(BlockFace.UP, 2);
* shower.setType(Material.WATER); * shower.setType(Material.WATER);
* </pre> * </pre>
* *
@ -201,7 +201,7 @@ public class CraftBlock implements Block {
* Block current = world.getBlockAt(100, 100, 100); * Block current = world.getBlockAt(100, 100, 100);
* Block target = world.getBlockAt(100, 101, 100); * Block target = world.getBlockAt(100, 101, 100);
* *
* current.getFace(target) == BlockFace.Up; * current.getFace(target) == BlockFace.UP;
* </pre> * </pre>
* <br /> * <br />
* If the given block is not connected to this block, null may be returned * If the given block is not connected to this block, null may be returned
@ -231,7 +231,7 @@ public class CraftBlock implements Block {
} }
/** /**
* Notch uses a 0-5 to mean Down, Up, East, West, North, South * Notch uses a 0-5 to mean DOWN, UP, EAST, WEST, NORTH, SOUTH
* in that order all over. This method is convenience to convert for us. * in that order all over. This method is convenience to convert for us.
* *
* @return BlockFace the BlockFace represented by this number * @return BlockFace the BlockFace represented by this number
@ -239,19 +239,19 @@ public class CraftBlock implements Block {
public static BlockFace notchToBlockFace(int notch) { public static BlockFace notchToBlockFace(int notch) {
switch (notch) { switch (notch) {
case 0: case 0:
return BlockFace.Down; return BlockFace.DOWN;
case 1: case 1:
return BlockFace.Up; return BlockFace.UP;
case 2: case 2:
return BlockFace.East; return BlockFace.EAST;
case 3: case 3:
return BlockFace.West; return BlockFace.WEST;
case 4: case 4:
return BlockFace.North; return BlockFace.NORTH;
case 5: case 5:
return BlockFace.South; return BlockFace.SOUTH;
default: default:
return BlockFace.Self; return BlockFace.SELF;
} }
} }