3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-25 15:50:10 +01:00
Dieser Commit ist enthalten in:
Myles 2018-12-05 19:08:55 +00:00
Ursprung fba0a59324
Commit c1147cb9f7
35 geänderte Dateien mit 541 neuen und 524 gelöschten Zeilen

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -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++) {

Datei anzeigen

@ -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;

Datei anzeigen

@ -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();