mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-10-31 23:59:33 +01:00
Formatting
This commit is contained in:
parent
fba0a59324
commit
c1147cb9f7
@ -248,5 +248,7 @@ public class UserConnection {
|
|||||||
*
|
*
|
||||||
* @param packet Raw packet to be sent
|
* @param packet Raw packet to be sent
|
||||||
*/
|
*/
|
||||||
public void sendRawPacketToServer(ByteBuf packet) { sendRawPacketToServer(packet, false); }
|
public void sendRawPacketToServer(ByteBuf packet) {
|
||||||
|
sendRawPacketToServer(packet, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
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<>();
|
private static Map<BlockFace, BlockFace> opposites = new HashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
|
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
|
||||||
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);
|
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);
|
||||||
|
@ -40,10 +40,14 @@ public class RedstoneConnectionHandler extends ConnectionHandler {
|
|||||||
|
|
||||||
private static int getState(String value) {
|
private static int getState(String value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "none": return 0;
|
case "none":
|
||||||
case "side" : return 1;
|
return 0;
|
||||||
case "up" : return 2;
|
case "side":
|
||||||
default: return 0;
|
return 1;
|
||||||
|
case "up":
|
||||||
|
return 2;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ public class WallConnectionHandler extends AbstractFenceConnectionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean up(UserConnection user, Position position) {
|
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);
|
int blockFaces = getBlockFaces(user, position);
|
||||||
if (blockFaces == 0 || blockFaces == 0xF) return true;
|
if (blockFaces == 0 || blockFaces == 0xF) return true;
|
||||||
for (int i = 0; i < BLOCK_FACES.length; i++) {
|
for (int i = 0; i < BLOCK_FACES.length; i++) {
|
||||||
|
@ -16,17 +16,25 @@ public class BlockConnectionProvider implements Provider {
|
|||||||
return -1;
|
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) {
|
public void storeBlock(UserConnection connection, long x, long y, long z, int blockState) {
|
||||||
storeBlock(connection, new Position(x, y, z), 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() {
|
public boolean storesBlocks() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -66,6 +66,7 @@ public class BlockConnectionStorage extends StoredObject {
|
|||||||
@Data
|
@Data
|
||||||
private class BlockPositon {
|
private class BlockPositon {
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
|
|
||||||
public BlockPositon(Position position) {
|
public BlockPositon(Position position) {
|
||||||
x = position.getX().intValue();
|
x = position.getX().intValue();
|
||||||
y = position.getY().intValue();
|
y = position.getY().intValue();
|
||||||
|
Loading…
Reference in New Issue
Block a user