mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 03:55:28 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
7e8e3fef61
@ -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();
|
||||||
|
@ -313,7 +313,7 @@ public class WorldPackets {
|
|||||||
if (Via.getConfig().isShieldBlocking()) {
|
if (Via.getConfig().isShieldBlocking()) {
|
||||||
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
||||||
|
|
||||||
if (item != null && Protocol1_9TO1_8.isSword(item.getIdentifier())) {
|
if (item != null && Protocol1_9TO1_8.isSword(item.getId())) {
|
||||||
if (hand == 0) {
|
if (hand == 0) {
|
||||||
if (!tracker.isBlocking()) {
|
if (!tracker.isBlocking()) {
|
||||||
tracker.setBlocking(true);
|
tracker.setBlocking(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user