mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-22 06:24:59 +01:00
Update Properties/Blocks, re-include neoforge, target 1.21.4 release
This commit is contained in:
parent
d114ab9ad1
commit
db246ffb3b
24 changed files with 94 additions and 106 deletions
|
@ -33,7 +33,6 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.geysermc.geyser.adapters.WorldAdapter;
|
import org.geysermc.geyser.adapters.WorldAdapter;
|
||||||
import org.geysermc.geyser.adapters.paper.PaperAdapters;
|
import org.geysermc.geyser.adapters.paper.PaperAdapters;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
|
||||||
import org.geysermc.geyser.level.block.type.Block;
|
import org.geysermc.geyser.level.block.type.Block;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
|
|
|
@ -398,9 +398,10 @@ public final class Blocks {
|
||||||
.booleanState(WEST)));
|
.booleanState(WEST)));
|
||||||
public static final Block SOUL_FIRE = register(new Block("soul_fire", builder().pushReaction(PistonBehavior.DESTROY)));
|
public static final Block SOUL_FIRE = register(new Block("soul_fire", builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
public static final Block SPAWNER = register(new SpawnerBlock("spawner", builder().setBlockEntity(BlockEntityType.MOB_SPAWNER).requiresCorrectToolForDrops().destroyTime(5.0f)));
|
public static final Block SPAWNER = register(new SpawnerBlock("spawner", builder().setBlockEntity(BlockEntityType.MOB_SPAWNER).requiresCorrectToolForDrops().destroyTime(5.0f)));
|
||||||
public static final Block CREAKING_HEART = register(new Block("creaking_heart", builder().setBlockEntity(BlockEntityType.CREAKING_HEART).destroyTime(5.0f)
|
public static final Block CREAKING_HEART = register(new Block("creaking_heart", builder().setBlockEntity(BlockEntityType.CREAKING_HEART).destroyTime(10.0f)
|
||||||
|
.booleanState(ACTIVE)
|
||||||
.enumState(AXIS, Axis.VALUES)
|
.enumState(AXIS, Axis.VALUES)
|
||||||
.enumState(CREAKING)));
|
.booleanState(NATURAL)));
|
||||||
public static final Block OAK_STAIRS = register(new Block("oak_stairs", builder().destroyTime(2.0f)
|
public static final Block OAK_STAIRS = register(new Block("oak_stairs", builder().destroyTime(2.0f)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(HALF)
|
.enumState(HALF)
|
||||||
|
@ -592,9 +593,9 @@ public final class Blocks {
|
||||||
.enumState(ATTACH_FACE)
|
.enumState(ATTACH_FACE)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block STONE_PRESSURE_PLATE = register(new Block("stone_pressure_plate", builder().requiresCorrectToolForDrops().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block STONE_PRESSURE_PLATE = register(new Block("stone_pressure_plate", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block IRON_DOOR = register(new DoorBlock("iron_door", builder().requiresCorrectToolForDrops().destroyTime(5.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block IRON_DOOR = register(new DoorBlock("iron_door", builder().destroyTime(5.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
|
@ -822,6 +823,14 @@ public final class Blocks {
|
||||||
.booleanState(UP)
|
.booleanState(UP)
|
||||||
.booleanState(WATERLOGGED)
|
.booleanState(WATERLOGGED)
|
||||||
.booleanState(WEST)));
|
.booleanState(WEST)));
|
||||||
|
public static final Block RESIN_CLUMP = register(new Block("resin_clump", builder().pushReaction(PistonBehavior.DESTROY)
|
||||||
|
.booleanState(DOWN)
|
||||||
|
.booleanState(EAST)
|
||||||
|
.booleanState(NORTH)
|
||||||
|
.booleanState(SOUTH)
|
||||||
|
.booleanState(UP)
|
||||||
|
.booleanState(WATERLOGGED)
|
||||||
|
.booleanState(WEST)));
|
||||||
public static final Block OAK_FENCE_GATE = register(new Block("oak_fence_gate", builder().destroyTime(2.0f)
|
public static final Block OAK_FENCE_GATE = register(new Block("oak_fence_gate", builder().destroyTime(2.0f)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.booleanState(IN_WALL)
|
.booleanState(IN_WALL)
|
||||||
|
@ -845,6 +854,24 @@ public final class Blocks {
|
||||||
public static final Block MYCELIUM = register(new Block("mycelium", builder().destroyTime(0.6f)
|
public static final Block MYCELIUM = register(new Block("mycelium", builder().destroyTime(0.6f)
|
||||||
.booleanState(SNOWY)));
|
.booleanState(SNOWY)));
|
||||||
public static final Block LILY_PAD = register(new Block("lily_pad", builder().pushReaction(PistonBehavior.DESTROY)));
|
public static final Block LILY_PAD = register(new Block("lily_pad", builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
|
public static final Block RESIN_BLOCK = register(new Block("resin_block", builder()));
|
||||||
|
public static final Block RESIN_BRICKS = register(new Block("resin_bricks", builder().requiresCorrectToolForDrops().destroyTime(1.5f)));
|
||||||
|
public static final Block RESIN_BRICK_STAIRS = register(new Block("resin_brick_stairs", builder().requiresCorrectToolForDrops().destroyTime(1.5f)
|
||||||
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
|
.enumState(HALF)
|
||||||
|
.enumState(STAIRS_SHAPE)
|
||||||
|
.booleanState(WATERLOGGED)));
|
||||||
|
public static final Block RESIN_BRICK_SLAB = register(new Block("resin_brick_slab", builder().requiresCorrectToolForDrops().destroyTime(1.5f)
|
||||||
|
.enumState(SLAB_TYPE)
|
||||||
|
.booleanState(WATERLOGGED)));
|
||||||
|
public static final Block RESIN_BRICK_WALL = register(new Block("resin_brick_wall", builder().requiresCorrectToolForDrops().destroyTime(1.5f)
|
||||||
|
.enumState(EAST_WALL)
|
||||||
|
.enumState(NORTH_WALL)
|
||||||
|
.enumState(SOUTH_WALL)
|
||||||
|
.booleanState(UP)
|
||||||
|
.booleanState(WATERLOGGED)
|
||||||
|
.enumState(WEST_WALL)));
|
||||||
|
public static final Block CHISELED_RESIN_BRICKS = register(new Block("chiseled_resin_bricks", builder().requiresCorrectToolForDrops().destroyTime(1.5f)));
|
||||||
public static final Block NETHER_BRICKS = register(new Block("nether_bricks", builder().requiresCorrectToolForDrops().destroyTime(2.0f)));
|
public static final Block NETHER_BRICKS = register(new Block("nether_bricks", builder().requiresCorrectToolForDrops().destroyTime(2.0f)));
|
||||||
public static final Block NETHER_BRICK_FENCE = register(new Block("nether_brick_fence", builder().requiresCorrectToolForDrops().destroyTime(2.0f)
|
public static final Block NETHER_BRICK_FENCE = register(new Block("nether_brick_fence", builder().requiresCorrectToolForDrops().destroyTime(2.0f)
|
||||||
.booleanState(EAST)
|
.booleanState(EAST)
|
||||||
|
@ -860,7 +887,7 @@ public final class Blocks {
|
||||||
public static final Block NETHER_WART = register(new Block("nether_wart", builder().pushReaction(PistonBehavior.DESTROY)
|
public static final Block NETHER_WART = register(new Block("nether_wart", builder().pushReaction(PistonBehavior.DESTROY)
|
||||||
.intState(AGE_3)));
|
.intState(AGE_3)));
|
||||||
public static final Block ENCHANTING_TABLE = register(new Block("enchanting_table", builder().setBlockEntity(BlockEntityType.ENCHANTING_TABLE).requiresCorrectToolForDrops().destroyTime(5.0f)));
|
public static final Block ENCHANTING_TABLE = register(new Block("enchanting_table", builder().setBlockEntity(BlockEntityType.ENCHANTING_TABLE).requiresCorrectToolForDrops().destroyTime(5.0f)));
|
||||||
public static final Block BREWING_STAND = register(new Block("brewing_stand", builder().setBlockEntity(BlockEntityType.BREWING_STAND).requiresCorrectToolForDrops().destroyTime(0.5f)
|
public static final Block BREWING_STAND = register(new Block("brewing_stand", builder().setBlockEntity(BlockEntityType.BREWING_STAND).destroyTime(0.5f)
|
||||||
.booleanState(HAS_BOTTLE_0)
|
.booleanState(HAS_BOTTLE_0)
|
||||||
.booleanState(HAS_BOTTLE_1)
|
.booleanState(HAS_BOTTLE_1)
|
||||||
.booleanState(HAS_BOTTLE_2)));
|
.booleanState(HAS_BOTTLE_2)));
|
||||||
|
@ -888,7 +915,7 @@ public final class Blocks {
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block EMERALD_ORE = register(new Block("emerald_ore", builder().requiresCorrectToolForDrops().destroyTime(3.0f)));
|
public static final Block EMERALD_ORE = register(new Block("emerald_ore", builder().requiresCorrectToolForDrops().destroyTime(3.0f)));
|
||||||
public static final Block DEEPSLATE_EMERALD_ORE = register(new Block("deepslate_emerald_ore", builder().requiresCorrectToolForDrops().destroyTime(4.5f)));
|
public static final Block DEEPSLATE_EMERALD_ORE = register(new Block("deepslate_emerald_ore", builder().requiresCorrectToolForDrops().destroyTime(4.5f)));
|
||||||
public static final Block ENDER_CHEST = register(new Block("ender_chest", builder().setBlockEntity(BlockEntityType.ENDER_CHEST).requiresCorrectToolForDrops().destroyTime(22.5f)
|
public static final Block ENDER_CHEST = register(new Block("ender_chest", builder().setBlockEntity(BlockEntityType.ENDER_CHEST).destroyTime(22.5f)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block TRIPWIRE_HOOK = register(new Block("tripwire_hook", builder().pushReaction(PistonBehavior.DESTROY)
|
public static final Block TRIPWIRE_HOOK = register(new Block("tripwire_hook", builder().pushReaction(PistonBehavior.DESTROY)
|
||||||
|
@ -1062,9 +1089,9 @@ public final class Blocks {
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(CHEST_TYPE, ChestType.VALUES)
|
.enumState(CHEST_TYPE, ChestType.VALUES)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register(new Block("light_weighted_pressure_plate", builder().requiresCorrectToolForDrops().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register(new Block("light_weighted_pressure_plate", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.intState(POWER)));
|
.intState(POWER)));
|
||||||
public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register(new Block("heavy_weighted_pressure_plate", builder().requiresCorrectToolForDrops().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register(new Block("heavy_weighted_pressure_plate", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.intState(POWER)));
|
.intState(POWER)));
|
||||||
public static final Block COMPARATOR = register(new Block("comparator", builder().setBlockEntity(BlockEntityType.COMPARATOR).pushReaction(PistonBehavior.DESTROY)
|
public static final Block COMPARATOR = register(new Block("comparator", builder().setBlockEntity(BlockEntityType.COMPARATOR).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
|
@ -2096,14 +2123,14 @@ public final class Blocks {
|
||||||
public static final Block SMITHING_TABLE = register(new Block("smithing_table", builder().destroyTime(2.5f)));
|
public static final Block SMITHING_TABLE = register(new Block("smithing_table", builder().destroyTime(2.5f)));
|
||||||
public static final Block STONECUTTER = register(new Block("stonecutter", builder().requiresCorrectToolForDrops().destroyTime(3.5f)
|
public static final Block STONECUTTER = register(new Block("stonecutter", builder().requiresCorrectToolForDrops().destroyTime(3.5f)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)));
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)));
|
||||||
public static final Block BELL = register(new Block("bell", builder().setBlockEntity(BlockEntityType.BELL).requiresCorrectToolForDrops().destroyTime(5.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block BELL = register(new Block("bell", builder().setBlockEntity(BlockEntityType.BELL).destroyTime(5.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(BELL_ATTACHMENT)
|
.enumState(BELL_ATTACHMENT)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block LANTERN = register(new Block("lantern", builder().requiresCorrectToolForDrops().destroyTime(3.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block LANTERN = register(new Block("lantern", builder().destroyTime(3.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.booleanState(HANGING)
|
.booleanState(HANGING)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block SOUL_LANTERN = register(new Block("soul_lantern", builder().requiresCorrectToolForDrops().destroyTime(3.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block SOUL_LANTERN = register(new Block("soul_lantern", builder().destroyTime(3.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.booleanState(HANGING)
|
.booleanState(HANGING)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block CAMPFIRE = register(new Block("campfire", builder().setBlockEntity(BlockEntityType.CAMPFIRE).destroyTime(2.0f)
|
public static final Block CAMPFIRE = register(new Block("campfire", builder().setBlockEntity(BlockEntityType.CAMPFIRE).destroyTime(2.0f)
|
||||||
|
@ -2307,7 +2334,7 @@ public final class Blocks {
|
||||||
public static final Block POLISHED_BLACKSTONE_SLAB = register(new Block("polished_blackstone_slab", builder().requiresCorrectToolForDrops().destroyTime(2.0f)
|
public static final Block POLISHED_BLACKSTONE_SLAB = register(new Block("polished_blackstone_slab", builder().requiresCorrectToolForDrops().destroyTime(2.0f)
|
||||||
.enumState(SLAB_TYPE)
|
.enumState(SLAB_TYPE)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block POLISHED_BLACKSTONE_PRESSURE_PLATE = register(new Block("polished_blackstone_pressure_plate", builder().requiresCorrectToolForDrops().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block POLISHED_BLACKSTONE_PRESSURE_PLATE = register(new Block("polished_blackstone_pressure_plate", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block POLISHED_BLACKSTONE_BUTTON = register(new Block("polished_blackstone_button", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block POLISHED_BLACKSTONE_BUTTON = register(new Block("polished_blackstone_button", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(ATTACH_FACE)
|
.enumState(ATTACH_FACE)
|
||||||
|
@ -2606,49 +2633,49 @@ public final class Blocks {
|
||||||
public static final Block WAXED_CUT_COPPER_SLAB = register(new Block("waxed_cut_copper_slab", builder().requiresCorrectToolForDrops().destroyTime(3.0f)
|
public static final Block WAXED_CUT_COPPER_SLAB = register(new Block("waxed_cut_copper_slab", builder().requiresCorrectToolForDrops().destroyTime(3.0f)
|
||||||
.enumState(SLAB_TYPE)
|
.enumState(SLAB_TYPE)
|
||||||
.booleanState(WATERLOGGED)));
|
.booleanState(WATERLOGGED)));
|
||||||
public static final Block COPPER_DOOR = register(new DoorBlock("copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block COPPER_DOOR = register(new DoorBlock("copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block EXPOSED_COPPER_DOOR = register(new DoorBlock("exposed_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block EXPOSED_COPPER_DOOR = register(new DoorBlock("exposed_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block OXIDIZED_COPPER_DOOR = register(new DoorBlock("oxidized_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block OXIDIZED_COPPER_DOOR = register(new DoorBlock("oxidized_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block WEATHERED_COPPER_DOOR = register(new DoorBlock("weathered_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block WEATHERED_COPPER_DOOR = register(new DoorBlock("weathered_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block WAXED_COPPER_DOOR = register(new DoorBlock("waxed_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block WAXED_COPPER_DOOR = register(new DoorBlock("waxed_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block WAXED_EXPOSED_COPPER_DOOR = register(new DoorBlock("waxed_exposed_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block WAXED_EXPOSED_COPPER_DOOR = register(new DoorBlock("waxed_exposed_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block WAXED_OXIDIZED_COPPER_DOOR = register(new DoorBlock("waxed_oxidized_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block WAXED_OXIDIZED_COPPER_DOOR = register(new DoorBlock("waxed_oxidized_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
.booleanState(OPEN)
|
.booleanState(OPEN)
|
||||||
.booleanState(POWERED)));
|
.booleanState(POWERED)));
|
||||||
public static final Block WAXED_WEATHERED_COPPER_DOOR = register(new DoorBlock("waxed_weathered_copper_door", builder().requiresCorrectToolForDrops().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block WAXED_WEATHERED_COPPER_DOOR = register(new DoorBlock("waxed_weathered_copper_door", builder().destroyTime(3.0f).pushReaction(PistonBehavior.DESTROY)
|
||||||
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
.enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST)
|
||||||
.enumState(DOUBLE_BLOCK_HALF)
|
.enumState(DOUBLE_BLOCK_HALF)
|
||||||
.enumState(DOOR_HINGE)
|
.enumState(DOOR_HINGE)
|
||||||
|
@ -2888,8 +2915,12 @@ public final class Blocks {
|
||||||
.enumState(NORTH_WALL)
|
.enumState(NORTH_WALL)
|
||||||
.enumState(SOUTH_WALL)
|
.enumState(SOUTH_WALL)
|
||||||
.enumState(WEST_WALL)));
|
.enumState(WEST_WALL)));
|
||||||
public static final Block PALE_HANGING_MOSS = register(new Block("pale_hanging_moss", builder().destroyTime(0.1f).pushReaction(PistonBehavior.DESTROY)
|
public static final Block PALE_HANGING_MOSS = register(new Block("pale_hanging_moss", builder().pushReaction(PistonBehavior.DESTROY)
|
||||||
.booleanState(TIP)));
|
.booleanState(TIP)));
|
||||||
|
public static final Block OPEN_EYEBLOSSOM = register(new Block("open_eyeblossom", builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
|
public static final Block CLOSED_EYEBLOSSOM = register(new Block("closed_eyeblossom", builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
|
public static final Block POTTED_OPEN_EYEBLOSSOM = register(new FlowerPotBlock("potted_open_eyeblossom", OPEN_EYEBLOSSOM, builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
|
public static final Block POTTED_CLOSED_EYEBLOSSOM = register(new FlowerPotBlock("potted_closed_eyeblossom", CLOSED_EYEBLOSSOM, builder().pushReaction(PistonBehavior.DESTROY)));
|
||||||
|
|
||||||
private static <T extends Block> T register(T block) {
|
private static <T extends Block> T register(T block) {
|
||||||
block.setJavaId(BlockRegistries.JAVA_BLOCKS.get().size());
|
block.setJavaId(BlockRegistries.JAVA_BLOCKS.get().size());
|
||||||
|
|
|
@ -29,8 +29,12 @@ import org.geysermc.geyser.level.physics.Axis;
|
||||||
import org.geysermc.geyser.level.physics.Direction;
|
import org.geysermc.geyser.level.physics.Direction;
|
||||||
|
|
||||||
public final class Properties {
|
public final class Properties {
|
||||||
|
public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
|
||||||
public static final BooleanProperty ATTACHED = BooleanProperty.create("attached");
|
public static final BooleanProperty ATTACHED = BooleanProperty.create("attached");
|
||||||
|
public static final BooleanProperty BERRIES = BooleanProperty.create("berries");
|
||||||
|
public static final BooleanProperty BLOOM = BooleanProperty.create("bloom");
|
||||||
public static final BooleanProperty BOTTOM = BooleanProperty.create("bottom");
|
public static final BooleanProperty BOTTOM = BooleanProperty.create("bottom");
|
||||||
|
public static final BooleanProperty CAN_SUMMON = BooleanProperty.create("can_summon");
|
||||||
public static final BooleanProperty CONDITIONAL = BooleanProperty.create("conditional");
|
public static final BooleanProperty CONDITIONAL = BooleanProperty.create("conditional");
|
||||||
public static final BooleanProperty DISARMED = BooleanProperty.create("disarmed");
|
public static final BooleanProperty DISARMED = BooleanProperty.create("disarmed");
|
||||||
public static final BooleanProperty DRAG = BooleanProperty.create("drag");
|
public static final BooleanProperty DRAG = BooleanProperty.create("drag");
|
||||||
|
@ -47,22 +51,20 @@ public final class Properties {
|
||||||
public static final BooleanProperty INVERTED = BooleanProperty.create("inverted");
|
public static final BooleanProperty INVERTED = BooleanProperty.create("inverted");
|
||||||
public static final BooleanProperty IN_WALL = BooleanProperty.create("in_wall");
|
public static final BooleanProperty IN_WALL = BooleanProperty.create("in_wall");
|
||||||
public static final BooleanProperty LIT = BooleanProperty.create("lit");
|
public static final BooleanProperty LIT = BooleanProperty.create("lit");
|
||||||
public static final BooleanProperty TIP = BooleanProperty.create("tip");
|
|
||||||
public static final BooleanProperty LOCKED = BooleanProperty.create("locked");
|
public static final BooleanProperty LOCKED = BooleanProperty.create("locked");
|
||||||
|
public static final BooleanProperty NATURAL = BooleanProperty.create("natural");
|
||||||
public static final BooleanProperty OCCUPIED = BooleanProperty.create("occupied");
|
public static final BooleanProperty OCCUPIED = BooleanProperty.create("occupied");
|
||||||
public static final BooleanProperty OPEN = BooleanProperty.create("open");
|
public static final BooleanProperty OPEN = BooleanProperty.create("open");
|
||||||
public static final BooleanProperty PERSISTENT = BooleanProperty.create("persistent");
|
public static final BooleanProperty PERSISTENT = BooleanProperty.create("persistent");
|
||||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||||
public static final BooleanProperty SHORT = BooleanProperty.create("short");
|
public static final BooleanProperty SHORT = BooleanProperty.create("short");
|
||||||
|
public static final BooleanProperty SHRIEKING = BooleanProperty.create("shrieking");
|
||||||
public static final BooleanProperty SIGNAL_FIRE = BooleanProperty.create("signal_fire");
|
public static final BooleanProperty SIGNAL_FIRE = BooleanProperty.create("signal_fire");
|
||||||
public static final BooleanProperty SNOWY = BooleanProperty.create("snowy");
|
public static final BooleanProperty SNOWY = BooleanProperty.create("snowy");
|
||||||
|
public static final BooleanProperty TIP = BooleanProperty.create("tip");
|
||||||
public static final BooleanProperty TRIGGERED = BooleanProperty.create("triggered");
|
public static final BooleanProperty TRIGGERED = BooleanProperty.create("triggered");
|
||||||
public static final BooleanProperty UNSTABLE = BooleanProperty.create("unstable");
|
public static final BooleanProperty UNSTABLE = BooleanProperty.create("unstable");
|
||||||
public static final BooleanProperty WATERLOGGED = BooleanProperty.create("waterlogged");
|
public static final BooleanProperty WATERLOGGED = BooleanProperty.create("waterlogged");
|
||||||
public static final BooleanProperty BERRIES = BooleanProperty.create("berries");
|
|
||||||
public static final BooleanProperty BLOOM = BooleanProperty.create("bloom");
|
|
||||||
public static final BooleanProperty SHRIEKING = BooleanProperty.create("shrieking");
|
|
||||||
public static final BooleanProperty CAN_SUMMON = BooleanProperty.create("can_summon");
|
|
||||||
public static final EnumProperty<Axis> HORIZONTAL_AXIS = EnumProperty.create("axis", Axis.X, Axis.Z);
|
public static final EnumProperty<Axis> HORIZONTAL_AXIS = EnumProperty.create("axis", Axis.X, Axis.Z);
|
||||||
public static final EnumProperty<Axis> AXIS = EnumProperty.create("axis", Axis.VALUES);
|
public static final EnumProperty<Axis> AXIS = EnumProperty.create("axis", Axis.VALUES);
|
||||||
public static final BooleanProperty UP = BooleanProperty.create("up");
|
public static final BooleanProperty UP = BooleanProperty.create("up");
|
||||||
|
@ -143,6 +145,5 @@ public final class Properties {
|
||||||
public static final BooleanProperty CRAFTING = BooleanProperty.create("crafting");
|
public static final BooleanProperty CRAFTING = BooleanProperty.create("crafting");
|
||||||
public static final BasicEnumProperty TRIAL_SPAWNER_STATE = BasicEnumProperty.create("trial_spawner_state", "inactive", "waiting_for_players", "active", "waiting_for_reward_ejection", "ejecting_reward", "cooldown");
|
public static final BasicEnumProperty TRIAL_SPAWNER_STATE = BasicEnumProperty.create("trial_spawner_state", "inactive", "waiting_for_players", "active", "waiting_for_reward_ejection", "ejecting_reward", "cooldown");
|
||||||
public static final BasicEnumProperty VAULT_STATE = BasicEnumProperty.create("vault_state", "inactive", "active", "unlocking", "ejecting");
|
public static final BasicEnumProperty VAULT_STATE = BasicEnumProperty.create("vault_state", "inactive", "active", "unlocking", "ejecting");
|
||||||
public static final BasicEnumProperty CREAKING = BasicEnumProperty.create("creaking", "disabled", "dormant", "active");
|
|
||||||
public static final BooleanProperty OMINOUS = BooleanProperty.create("ominous");
|
public static final BooleanProperty OMINOUS = BooleanProperty.create("ominous");
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class AnvilInventoryTranslator extends AbstractBlockInventoryTranslator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case ANVIL_INPUT -> 0;
|
case ANVIL_INPUT -> 0;
|
||||||
case ANVIL_MATERIAL -> 1;
|
case ANVIL_MATERIAL -> 1;
|
||||||
case ANVIL_RESULT, CREATED_OUTPUT -> 2;
|
case ANVIL_RESULT, CREATED_OUTPUT -> 2;
|
||||||
|
|
|
@ -44,7 +44,7 @@ public abstract class BaseInventoryTranslator extends InventoryTranslator {
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
int slotnum = slotInfoData.getSlot();
|
int slotnum = slotInfoData.getSlot();
|
||||||
switch (slotInfoData.getContainer()) {
|
switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case HOTBAR_AND_INVENTORY:
|
case HOTBAR_AND_INVENTORY:
|
||||||
case HOTBAR:
|
case HOTBAR:
|
||||||
case INVENTORY:
|
case INVENTORY:
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class BeaconInventoryTranslator extends AbstractBlockInventoryTranslator
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.BEACON_PAYMENT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BEACON_PAYMENT) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(slotInfoData);
|
return super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -74,11 +74,11 @@ public class BrewingInventoryTranslator extends AbstractBlockInventoryTranslator
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.BREWING_INPUT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BREWING_INPUT) {
|
||||||
// Ingredient
|
// Ingredient
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.BREWING_RESULT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BREWING_RESULT) {
|
||||||
// Potions
|
// Potions
|
||||||
return slotInfoData.getSlot() - 1;
|
return slotInfoData.getSlot() - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class CartographyInventoryTranslator extends AbstractBlockInventoryTransl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case CARTOGRAPHY_INPUT -> 0;
|
case CARTOGRAPHY_INPUT -> 0;
|
||||||
case CARTOGRAPHY_ADDITIONAL -> 1;
|
case CARTOGRAPHY_ADDITIONAL -> 1;
|
||||||
case CARTOGRAPHY_RESULT, CREATED_OUTPUT -> 2;
|
case CARTOGRAPHY_RESULT, CREATED_OUTPUT -> 2;
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class CrafterInventoryTranslator extends AbstractBlockInventoryTranslator
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
int slot = slotInfoData.getSlot();
|
int slot = slotInfoData.getSlot();
|
||||||
switch (slotInfoData.getContainer()) {
|
switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case HOTBAR_AND_INVENTORY, HOTBAR, INVENTORY -> {
|
case HOTBAR_AND_INVENTORY, HOTBAR, INVENTORY -> {
|
||||||
//hotbar
|
//hotbar
|
||||||
if (slot >= 9) {
|
if (slot >= 9) {
|
||||||
|
|
|
@ -64,12 +64,12 @@ public class CraftingInventoryTranslator extends AbstractBlockInventoryTranslato
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.CRAFTING_INPUT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.CRAFTING_INPUT) {
|
||||||
// Java goes from 1 - 9, left to right then up to down
|
// Java goes from 1 - 9, left to right then up to down
|
||||||
// Bedrock is the same, but it starts from 32.
|
// Bedrock is the same, but it starts from 32.
|
||||||
return slotInfoData.getSlot() - 31;
|
return slotInfoData.getSlot() - 31;
|
||||||
}
|
}
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.CRAFTING_OUTPUT || slotInfoData.getContainer() == ContainerSlotType.CREATED_OUTPUT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.CRAFTING_OUTPUT || slotInfoData.getContainerName().getContainer() == ContainerSlotType.CREATED_OUTPUT) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(slotInfoData);
|
return super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -135,10 +135,10 @@ public class EnchantingInventoryTranslator extends AbstractBlockInventoryTransla
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.ENCHANTING_INPUT) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.ENCHANTING_INPUT) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.ENCHANTING_MATERIAL) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.ENCHANTING_MATERIAL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(slotInfoData);
|
return super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class GrindstoneInventoryTranslator extends AbstractBlockInventoryTransla
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case GRINDSTONE_INPUT -> 0;
|
case GRINDSTONE_INPUT -> 0;
|
||||||
case GRINDSTONE_ADDITIONAL -> 1;
|
case GRINDSTONE_ADDITIONAL -> 1;
|
||||||
case GRINDSTONE_RESULT, CREATED_OUTPUT -> 2;
|
case GRINDSTONE_RESULT, CREATED_OUTPUT -> 2;
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class LoomInventoryTranslator extends AbstractBlockInventoryTranslator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case LOOM_INPUT -> 0;
|
case LOOM_INPUT -> 0;
|
||||||
case LOOM_DYE -> 1;
|
case LOOM_DYE -> 1;
|
||||||
case LOOM_MATERIAL -> 2;
|
case LOOM_MATERIAL -> 2;
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case TRADE2_INGREDIENT_1 -> 0;
|
case TRADE2_INGREDIENT_1 -> 0;
|
||||||
case TRADE2_INGREDIENT_2 -> 1;
|
case TRADE2_INGREDIENT_2 -> 1;
|
||||||
case TRADE2_RESULT, CREATED_OUTPUT -> 2;
|
case TRADE2_RESULT, CREATED_OUTPUT -> 2;
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class OldSmithingTableTranslator extends AbstractBlockInventoryTranslator
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case SMITHING_TABLE_INPUT -> 0;
|
case SMITHING_TABLE_INPUT -> 0;
|
||||||
case SMITHING_TABLE_MATERIAL -> 1;
|
case SMITHING_TABLE_MATERIAL -> 1;
|
||||||
case SMITHING_TABLE_RESULT, CREATED_OUTPUT -> 2;
|
case SMITHING_TABLE_RESULT, CREATED_OUTPUT -> 2;
|
||||||
|
@ -130,7 +130,7 @@ public class OldSmithingTableTranslator extends AbstractBlockInventoryTranslator
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInvalidAction(ItemStackRequestSlotData slotData) {
|
private boolean isInvalidAction(ItemStackRequestSlotData slotData) {
|
||||||
return slotData.getContainer().equals(ContainerSlotType.SMITHING_TABLE_TEMPLATE);
|
return slotData.getContainerName().getContainer().equals(ContainerSlotType.SMITHING_TABLE_TEMPLATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -184,7 +184,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
int slotnum = slotInfoData.getSlot();
|
int slotnum = slotInfoData.getSlot();
|
||||||
switch (slotInfoData.getContainer()) {
|
switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case HOTBAR_AND_INVENTORY:
|
case HOTBAR_AND_INVENTORY:
|
||||||
case HOTBAR:
|
case HOTBAR:
|
||||||
case INVENTORY:
|
case INVENTORY:
|
||||||
|
@ -462,7 +462,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
}
|
}
|
||||||
craftState = CraftState.TRANSFER;
|
craftState = CraftState.TRANSFER;
|
||||||
|
|
||||||
if (transferAction.getSource().getContainer() != ContainerSlotType.CREATED_OUTPUT) {
|
if (transferAction.getSource().getContainerName().getContainer() != ContainerSlotType.CREATED_OUTPUT) {
|
||||||
return rejectRequest(request);
|
return rejectRequest(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
}
|
}
|
||||||
|
|
||||||
DropAction dropAction = (DropAction) action;
|
DropAction dropAction = (DropAction) action;
|
||||||
if (dropAction.getSource().getContainer() != ContainerSlotType.CREATED_OUTPUT || dropAction.getSource().getSlot() != 50) {
|
if (dropAction.getSource().getContainerName().getContainer() != ContainerSlotType.CREATED_OUTPUT || dropAction.getSource().getSlot() != 50) {
|
||||||
return rejectRequest(request);
|
return rejectRequest(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +532,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCraftingGrid(ItemStackRequestSlotData slotInfoData) {
|
private static boolean isCraftingGrid(ItemStackRequestSlotData slotInfoData) {
|
||||||
return slotInfoData.getContainer() == ContainerSlotType.CRAFTING_INPUT;
|
return slotInfoData.getContainerName().getContainer() == ContainerSlotType.CRAFTING_INPUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class SmithingInventoryTranslator extends AbstractBlockInventoryTranslato
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case SMITHING_TABLE_TEMPLATE -> TEMPLATE;
|
case SMITHING_TABLE_TEMPLATE -> TEMPLATE;
|
||||||
case SMITHING_TABLE_INPUT -> INPUT;
|
case SMITHING_TABLE_INPUT -> INPUT;
|
||||||
case SMITHING_TABLE_MATERIAL -> MATERIAL;
|
case SMITHING_TABLE_MATERIAL -> MATERIAL;
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
return switch (slotInfoData.getContainer()) {
|
return switch (slotInfoData.getContainerName().getContainer()) {
|
||||||
case STONECUTTER_INPUT -> 0;
|
case STONECUTTER_INPUT -> 0;
|
||||||
case STONECUTTER_RESULT, CREATED_OUTPUT -> 1;
|
case STONECUTTER_RESULT, CREATED_OUTPUT -> 1;
|
||||||
default -> super.bedrockSlotToJava(slotInfoData);
|
default -> super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -53,10 +53,10 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.HORSE_EQUIP) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.HORSE_EQUIP) {
|
||||||
return this.equipSlot;
|
return this.equipSlot;
|
||||||
}
|
}
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.LEVEL_ENTITY) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.LEVEL_ENTITY) {
|
||||||
return slotInfoData.getSlot() + 1;
|
return slotInfoData.getSlot() + 1;
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(slotInfoData);
|
return super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class HorseInventoryTranslator extends AbstractHorseInventoryTranslator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) {
|
||||||
if (slotInfoData.getContainer() == ContainerSlotType.HORSE_EQUIP) {
|
if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.HORSE_EQUIP) {
|
||||||
return slotInfoData.getSlot();
|
return slotInfoData.getSlot();
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(slotInfoData);
|
return super.bedrockSlotToJava(slotInfoData);
|
||||||
|
|
|
@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.protocol.java.entity;
|
||||||
import org.geysermc.geyser.entity.type.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.entity.type.LivingEntity;
|
import org.geysermc.geyser.entity.type.LivingEntity;
|
||||||
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||||
|
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||||
import org.geysermc.geyser.item.Items;
|
import org.geysermc.geyser.item.Items;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.skin.FakeHeadProvider;
|
import org.geysermc.geyser.skin.FakeHeadProvider;
|
||||||
|
@ -35,6 +36,7 @@ import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||||
import org.geysermc.geyser.translator.protocol.Translator;
|
import org.geysermc.geyser.translator.protocol.Translator;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Equipment;
|
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Equipment;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
|
||||||
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
|
||||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundSetEquipmentPacket;
|
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundSetEquipmentPacket;
|
||||||
|
|
||||||
@Translator(packet = ClientboundSetEquipmentPacket.class)
|
@Translator(packet = ClientboundSetEquipmentPacket.class)
|
||||||
|
@ -64,7 +66,7 @@ public class JavaSetEquipmentTranslator extends PacketTranslator<ClientboundSetE
|
||||||
&& javaItem != null
|
&& javaItem != null
|
||||||
&& javaItem.getId() == Items.PLAYER_HEAD.javaId()
|
&& javaItem.getId() == Items.PLAYER_HEAD.javaId()
|
||||||
&& javaItem.getDataComponents() != null) {
|
&& javaItem.getDataComponents() != null) {
|
||||||
FakeHeadProvider.setHead(session, (PlayerEntity) livingEntity, javaItem.getDataComponents());
|
FakeHeadProvider.setHead(session, (PlayerEntity) livingEntity, GeyserItemStack.from(javaItem).getComponent(DataComponentType.PROFILE));
|
||||||
} else {
|
} else {
|
||||||
FakeHeadProvider.restoreOriginalSkin(session, livingEntity);
|
FakeHeadProvider.restoreOriginalSkin(session, livingEntity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,7 @@ package org.geysermc.geyser.util;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.cloudburstmc.math.vector.Vector3i;
|
import org.cloudburstmc.math.vector.Vector3i;
|
||||||
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
||||||
import org.geysermc.geyser.entity.type.player.SessionPlayerEntity;
|
|
||||||
import org.geysermc.geyser.inventory.GeyserItemStack;
|
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||||
import org.geysermc.geyser.inventory.PlayerInventory;
|
|
||||||
import org.geysermc.geyser.inventory.item.BedrockEnchantment;
|
|
||||||
import org.geysermc.geyser.level.block.Blocks;
|
|
||||||
import org.geysermc.geyser.level.block.type.Block;
|
import org.geysermc.geyser.level.block.type.Block;
|
||||||
import org.geysermc.geyser.level.block.type.BlockState;
|
import org.geysermc.geyser.level.block.type.BlockState;
|
||||||
import org.geysermc.geyser.registry.BlockRegistries;
|
import org.geysermc.geyser.registry.BlockRegistries;
|
||||||
|
@ -40,10 +36,8 @@ import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.session.cache.EntityEffectCache;
|
import org.geysermc.geyser.session.cache.EntityEffectCache;
|
||||||
import org.geysermc.geyser.session.cache.registry.JavaRegistries;
|
import org.geysermc.geyser.session.cache.registry.JavaRegistries;
|
||||||
import org.geysermc.geyser.session.cache.tags.BlockTag;
|
|
||||||
import org.geysermc.geyser.session.cache.tags.GeyserHolderSet;
|
import org.geysermc.geyser.session.cache.tags.GeyserHolderSet;
|
||||||
import org.geysermc.geyser.translator.collision.BlockCollision;
|
import org.geysermc.geyser.translator.collision.BlockCollision;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.AttributeType;
|
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.ToolData;
|
import org.geysermc.mcprotocollib.protocol.data.game.item.component.ToolData;
|
||||||
|
@ -145,50 +139,11 @@ public final class BlockUtils {
|
||||||
|
|
||||||
// TODO 1.21.4 this changed probably; no more tiers
|
// TODO 1.21.4 this changed probably; no more tiers
|
||||||
public static double getBreakTime(GeyserSession session, Block block, ItemMapping item, @Nullable DataComponents components, boolean isSessionPlayer) {
|
public static double getBreakTime(GeyserSession session, Block block, ItemMapping item, @Nullable DataComponents components, boolean isSessionPlayer) {
|
||||||
// boolean isShearsEffective = session.getTagCache().is(BlockTag.LEAVES, block) || session.getTagCache().is(BlockTag.WOOL, block); //TODO called twice
|
return 0.0; // TODO 1.21.4
|
||||||
// boolean canHarvestWithHand = !block.requiresCorrectToolForDrops();
|
|
||||||
// String toolType = "";
|
|
||||||
// String toolTier = "";
|
|
||||||
// boolean correctTool = false;
|
|
||||||
// boolean toolCanBreak = false;
|
|
||||||
// if (item.isTool()) {
|
|
||||||
// toolType = item.getToolType();
|
|
||||||
// toolTier = item.getToolTier();
|
|
||||||
// correctTool = correctTool(session, block, toolType);
|
|
||||||
// toolCanBreak = canToolTierBreakBlock(session, block, toolTier);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// int toolEfficiencyLevel = ItemUtils.getEnchantmentLevel(session, components, BedrockEnchantment.EFFICIENCY);
|
|
||||||
// int hasteLevel = 0;
|
|
||||||
// int miningFatigueLevel = 0;
|
|
||||||
//
|
|
||||||
// if (!isSessionPlayer) {
|
|
||||||
// // Another entity is currently mining; we have all the information we know
|
|
||||||
// return calculateBreakTime(block.destroyTime(), toolTier, canHarvestWithHand, correctTool, toolCanBreak, toolType, isShearsEffective,
|
|
||||||
// toolEfficiencyLevel, hasteLevel, miningFatigueLevel, false, true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// hasteLevel = Math.max(session.getEffectCache().getHaste(), session.getEffectCache().getConduitPower());
|
|
||||||
// miningFatigueLevel = session.getEffectCache().getMiningFatigue();
|
|
||||||
//
|
|
||||||
// boolean waterInEyes = session.getCollisionManager().isWaterInEyes();
|
|
||||||
// boolean insideOfWaterWithoutAquaAffinity = waterInEyes &&
|
|
||||||
// ItemUtils.getEnchantmentLevel(session, session.getPlayerInventory().getItem(5).getAllComponents(), BedrockEnchantment.AQUA_AFFINITY) < 1;
|
|
||||||
//
|
|
||||||
// return calculateBreakTime(block.destroyTime(), toolTier, canHarvestWithHand, correctTool, toolCanBreak, toolType, isShearsEffective,
|
|
||||||
// toolEfficiencyLevel, hasteLevel, miningFatigueLevel, insideOfWaterWithoutAquaAffinity, session.getPlayerEntity().isOnGround());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getSessionBreakTime(GeyserSession session, Block block) {
|
public static double getSessionBreakTime(GeyserSession session, Block block) {
|
||||||
// PlayerInventory inventory = session.getPlayerInventory();
|
return 0.0; // TODO 1.21.4
|
||||||
// GeyserItemStack item = inventory.getItemInHand();
|
|
||||||
// ItemMapping mapping = ItemMapping.AIR;
|
|
||||||
// DataComponents components = null;
|
|
||||||
// if (item != null) {
|
|
||||||
// mapping = item.getMapping(session);
|
|
||||||
// components = item.getAllComponents();
|
|
||||||
// }
|
|
||||||
// return getBreakTime(session, block, mapping, components, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,13 +33,13 @@ commodore = "2.2"
|
||||||
bungeecord = "a7c6ede"
|
bungeecord = "a7c6ede"
|
||||||
velocity = "3.3.0-SNAPSHOT"
|
velocity = "3.3.0-SNAPSHOT"
|
||||||
viaproxy = "3.3.2-SNAPSHOT"
|
viaproxy = "3.3.2-SNAPSHOT"
|
||||||
fabric-loader = "0.16.7"
|
fabric-loader = "0.16.9"
|
||||||
fabric-api = "0.109.1+1.21.4"
|
fabric-api = "0.109.1+1.21.4"
|
||||||
fabric-permissions-api = "0.3.3"
|
fabric-permissions-api = "0.3.3"
|
||||||
neoforge-minecraft = "21.3.0-beta"
|
neoforge-minecraft = "21.4.0-beta"
|
||||||
mixin = "0.8.5"
|
mixin = "0.8.5"
|
||||||
mixinextras = "0.3.5"
|
mixinextras = "0.3.5"
|
||||||
minecraft = "1.21.4-pre3"
|
minecraft = "1.21.4"
|
||||||
mockito = "5.+"
|
mockito = "5.+"
|
||||||
|
|
||||||
# plugin versions
|
# plugin versions
|
||||||
|
|
|
@ -20,7 +20,7 @@ include(":ap")
|
||||||
include(":api")
|
include(":api")
|
||||||
include(":bungeecord")
|
include(":bungeecord")
|
||||||
include(":fabric")
|
include(":fabric")
|
||||||
//include(":neoforge")
|
include(":neoforge")
|
||||||
include(":mod")
|
include(":mod")
|
||||||
include(":spigot")
|
include(":spigot")
|
||||||
include(":standalone")
|
include(":standalone")
|
||||||
|
@ -32,7 +32,7 @@ include(":core")
|
||||||
// Specify project dirs
|
// Specify project dirs
|
||||||
project(":bungeecord").projectDir = file("bootstrap/bungeecord")
|
project(":bungeecord").projectDir = file("bootstrap/bungeecord")
|
||||||
project(":fabric").projectDir = file("bootstrap/mod/fabric")
|
project(":fabric").projectDir = file("bootstrap/mod/fabric")
|
||||||
//project(":neoforge").projectDir = file("bootstrap/mod/neoforge")
|
project(":neoforge").projectDir = file("bootstrap/mod/neoforge")
|
||||||
project(":mod").projectDir = file("bootstrap/mod")
|
project(":mod").projectDir = file("bootstrap/mod")
|
||||||
project(":spigot").projectDir = file("bootstrap/spigot")
|
project(":spigot").projectDir = file("bootstrap/spigot")
|
||||||
project(":standalone").projectDir = file("bootstrap/standalone")
|
project(":standalone").projectDir = file("bootstrap/standalone")
|
||||||
|
|
Loading…
Reference in a new issue