feat: support walls 1.16
--------- Co-authored-by: Koshak_Mine <52908036+KoshakMineDEV@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.reider745.block.wall;
|
||||
|
||||
public class BlockBlackstoneWall extends BlockWall {
|
||||
public BlockBlackstoneWall() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public BlockBlackstoneWall(int meta) {
|
||||
super(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WallType getWallType() {
|
||||
return WallType.BLACKSTONE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.reider745.block.wall;
|
||||
|
||||
public class BlockPolishedBlackstoneBrickWall extends BlockWall {
|
||||
public BlockPolishedBlackstoneBrickWall() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public BlockPolishedBlackstoneBrickWall(int meta) {
|
||||
super(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockWall.WallType getWallType() {
|
||||
return WallType.POLISHED_BLACKSTONE_BRICK;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.reider745.block.wall;
|
||||
|
||||
public class BlockPolishedBlackstoneWall extends BlockWall {
|
||||
public BlockPolishedBlackstoneWall() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public BlockPolishedBlackstoneWall(int meta) {
|
||||
super(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WallType getWallType() {
|
||||
return WallType.POLISHED_BLACKSTONE;
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,10 @@ public abstract class BlockWall extends BlockTransparentMeta {
|
||||
NETHER_BRICK(1234, "Nether brick wall"),
|
||||
PRISMARINE(1236, "Prismarine wall"),
|
||||
RED_SANDSTONE(1237, "Red sandstone wall"),
|
||||
RED_NETHER_BRICK(1238, "Ren nether brick wall");
|
||||
RED_NETHER_BRICK(1238, "Red nether brick wall"),
|
||||
BLACKSTONE(BlockID.BLACKSTONE_WALL, "Blackstone wall"),
|
||||
POLISHED_BLACKSTONE(BlockID.POLISHED_BLACKSTONE_WALL, "Polished blackstone wall"),
|
||||
POLISHED_BLACKSTONE_BRICK(BlockID.POLISHED_BLACKSTONE_BRICK_WALL, "Polished blackstone brick wall");
|
||||
|
||||
public final int id;
|
||||
public final String name;
|
||||
|
||||
@@ -213,7 +213,7 @@ public class BlockPalette {
|
||||
doorMeta = doorMeta | BlockDoor.DOOR_HINGE_BIT;
|
||||
|
||||
legacyId = (blockId << Block.DATA_BITS) | doorMeta;
|
||||
} else if(blockId == 139) {
|
||||
} else if(blockId == 139 || blockId == 532 || blockId == 552 || blockId == 533) {
|
||||
int wallMeta = 0;
|
||||
|
||||
wallMeta = ((wallMeta & ~BlockWall.NORTH_MASK) | ((description.states.getInt("wall_connection_type_north") << Integer.numberOfTrailingZeros(BlockWall.NORTH_MASK)) & BlockWall.NORTH_MASK));
|
||||
@@ -222,7 +222,8 @@ public class BlockPalette {
|
||||
wallMeta = ((wallMeta & ~BlockWall.SOUTH_MASK) | ((description.states.getInt("wall_connection_type_south") << Integer.numberOfTrailingZeros(BlockWall.SOUTH_MASK)) & BlockWall.SOUTH_MASK));
|
||||
wallMeta = ((wallMeta & ~BlockWall.POST_MASK) | ((description.states.getInt("wall_post_bit") << Integer.numberOfTrailingZeros(BlockWall.POST_MASK)) & BlockWall.POST_MASK));
|
||||
|
||||
blockId = BlockWall.WallType.values()[description.states.getInt("wall_block_type")].id;
|
||||
if(description.states.has("wall_block_type"))
|
||||
blockId = BlockWall.WallType.values()[description.states.getInt("wall_block_type")].id;
|
||||
legacyId = (blockId << Block.DATA_BITS) | wallMeta;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,9 @@ public class BlocksHooks {
|
||||
registerWall(BlockWall.WallType.MOSSY_STONE_BRICK, BlockMossyStoneBrickWall.class);
|
||||
registerWall(BlockWall.WallType.MOSSY_COBBLESTONE, BlockMossyCobblestoneWall.class);
|
||||
registerWall(BlockWall.WallType.RED_SANDSTONE, BlockRedSandstoneWall.class);
|
||||
registerWall(BlockWall.WallType.BLACKSTONE, BlockBlackstoneWall.class);
|
||||
registerWall(BlockWall.WallType.POLISHED_BLACKSTONE, BlockPolishedBlackstoneWall.class);
|
||||
registerWall(BlockWall.WallType.POLISHED_BLACKSTONE_BRICK, BlockPolishedBlackstoneBrickWall.class);
|
||||
}
|
||||
|
||||
@ShadowGetField(className = "cn.nukkit.item.Item", field = "block")
|
||||
|
||||
Reference in New Issue
Block a user