Formatting

This commit is contained in:
Myles 2018-12-05 19:08:55 +00:00
parent fba0a59324
commit c1147cb9f7
35 changed files with 541 additions and 524 deletions

View File

@ -248,5 +248,7 @@ public class UserConnection {
*
* @param packet Raw packet to be sent
*/
public void sendRawPacketToServer(ByteBuf packet) { sendRawPacketToServer(packet, false); }
public void sendRawPacketToServer(ByteBuf packet) {
sendRawPacketToServer(packet, false);
}
}

View File

@ -12,6 +12,7 @@ public enum BlockFace {
NORTH(0, 0, -1, EnumAxis.Z), SOUTH(0, 0, 1, EnumAxis.Z), EAST(1, 0, 0, EnumAxis.X), WEST(-1, 0, 0, EnumAxis.X), TOP(0, 1, 0, EnumAxis.Y), BOTTOM(0, -1, 0, EnumAxis.Y);
private static Map<BlockFace, BlockFace> opposites = new HashMap<>();
static {
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);

View File

@ -40,10 +40,14 @@ public class RedstoneConnectionHandler extends ConnectionHandler {
private static int getState(String value) {
switch (value) {
case "none": return 0;
case "side" : return 1;
case "up" : return 2;
default: return 0;
case "none":
return 0;
case "side":
return 1;
case "up":
return 2;
default:
return 0;
}
}

View File

@ -32,7 +32,8 @@ public class WallConnectionHandler extends AbstractFenceConnectionHandler {
}
public boolean up(UserConnection user, Position position) {
if(isWall(getBlockData(user, position.getRelative(BlockFace.BOTTOM))) || isWall(getBlockData(user, position.getRelative(BlockFace.TOP))))return true;
if (isWall(getBlockData(user, position.getRelative(BlockFace.BOTTOM))) || isWall(getBlockData(user, position.getRelative(BlockFace.TOP))))
return true;
int blockFaces = getBlockFaces(user, position);
if (blockFaces == 0 || blockFaces == 0xF) return true;
for (int i = 0; i < BLOCK_FACES.length; i++) {

View File

@ -16,17 +16,25 @@ public class BlockConnectionProvider implements Provider {
return -1;
}
public void storeBlock(UserConnection connection, Position position, int blockState) {};
public void storeBlock(UserConnection connection, Position position, int blockState) {
public void removeBlock(UserConnection connection, Position position) {};
}
public void removeBlock(UserConnection connection, Position position) {
}
public void storeBlock(UserConnection connection, long x, long y, long z, int blockState) {
storeBlock(connection, new Position(x, y, z), blockState);
}
public void clearStorage(UserConnection connection) {};
public void clearStorage(UserConnection connection) {
public void unloadChunk(UserConnection connection, int x, int z) {};
}
public void unloadChunk(UserConnection connection, int x, int z) {
}
public boolean storesBlocks() {
return false;

View File

@ -66,6 +66,7 @@ public class BlockConnectionStorage extends StoredObject {
@Data
private class BlockPositon {
int x, y, z;
public BlockPositon(Position position) {
x = position.getX().intValue();
y = position.getY().intValue();