From db246ffb3b98bf367fbc1c964f304bc75b404143 Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Wed, 4 Dec 2024 01:28:29 +0800 Subject: [PATCH] Update Properties/Blocks, re-include neoforge, target 1.21.4 release --- .../GeyserSpigotNativeWorldManager.java | 1 - .../geysermc/geyser/level/block/Blocks.java | 73 +++++++++++++------ .../level/block/property/Properties.java | 13 ++-- .../inventory/AnvilInventoryTranslator.java | 2 +- .../inventory/BaseInventoryTranslator.java | 2 +- .../inventory/BeaconInventoryTranslator.java | 2 +- .../inventory/BrewingInventoryTranslator.java | 4 +- .../CartographyInventoryTranslator.java | 2 +- .../inventory/CrafterInventoryTranslator.java | 2 +- .../CraftingInventoryTranslator.java | 4 +- .../EnchantingInventoryTranslator.java | 4 +- .../GrindstoneInventoryTranslator.java | 2 +- .../inventory/LoomInventoryTranslator.java | 2 +- .../MerchantInventoryTranslator.java | 2 +- .../inventory/OldSmithingTableTranslator.java | 4 +- .../inventory/PlayerInventoryTranslator.java | 8 +- .../SmithingInventoryTranslator.java | 2 +- .../StonecutterInventoryTranslator.java | 2 +- .../ChestedHorseInventoryTranslator.java | 4 +- .../horse/HorseInventoryTranslator.java | 2 +- .../entity/JavaSetEquipmentTranslator.java | 4 +- .../org/geysermc/geyser/util/BlockUtils.java | 49 +------------ gradle/libs.versions.toml | 6 +- settings.gradle.kts | 4 +- 24 files changed, 94 insertions(+), 106 deletions(-) diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java index c99ca4e78..96ae41933 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java @@ -33,7 +33,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.geysermc.geyser.adapters.WorldAdapter; import org.geysermc.geyser.adapters.paper.PaperAdapters; 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.session.GeyserSession; diff --git a/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java b/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java index 5db38c559..7dc526ee3 100644 --- a/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java +++ b/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java @@ -398,9 +398,10 @@ public final class Blocks { .booleanState(WEST))); 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 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(CREAKING))); + .booleanState(NATURAL))); 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(HALF) @@ -592,9 +593,9 @@ public final class Blocks { .enumState(ATTACH_FACE) .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) .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))); - 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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) @@ -822,6 +823,14 @@ public final class Blocks { .booleanState(UP) .booleanState(WATERLOGGED) .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) .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) .booleanState(IN_WALL) @@ -845,6 +854,24 @@ public final class Blocks { public static final Block MYCELIUM = register(new Block("mycelium", builder().destroyTime(0.6f) .booleanState(SNOWY))); 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_BRICK_FENCE = register(new Block("nether_brick_fence", builder().requiresCorrectToolForDrops().destroyTime(2.0f) .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) .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 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_1) .booleanState(HAS_BOTTLE_2))); @@ -888,7 +915,7 @@ public final class Blocks { .booleanState(WATERLOGGED))); 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 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) .booleanState(WATERLOGGED))); 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(CHEST_TYPE, ChestType.VALUES) .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))); - 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))); 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) @@ -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 STONECUTTER = register(new Block("stonecutter", builder().requiresCorrectToolForDrops().destroyTime(3.5f) .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(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) .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(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(WATERLOGGED))); 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) .enumState(SLAB_TYPE) .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))); public static final Block POLISHED_BLACKSTONE_BUTTON = register(new Block("polished_blackstone_button", builder().destroyTime(0.5f).pushReaction(PistonBehavior.DESTROY) .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) .enumState(SLAB_TYPE) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) .booleanState(OPEN) .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(DOUBLE_BLOCK_HALF) .enumState(DOOR_HINGE) @@ -2888,8 +2915,12 @@ public final class Blocks { .enumState(NORTH_WALL) .enumState(SOUTH_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))); + 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 register(T block) { block.setJavaId(BlockRegistries.JAVA_BLOCKS.get().size()); diff --git a/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java b/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java index 3e5f1b510..f295c4f51 100644 --- a/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java +++ b/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java @@ -29,8 +29,12 @@ import org.geysermc.geyser.level.physics.Axis; import org.geysermc.geyser.level.physics.Direction; public final class Properties { + public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); 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 CAN_SUMMON = BooleanProperty.create("can_summon"); public static final BooleanProperty CONDITIONAL = BooleanProperty.create("conditional"); public static final BooleanProperty DISARMED = BooleanProperty.create("disarmed"); 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 IN_WALL = BooleanProperty.create("in_wall"); 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 NATURAL = BooleanProperty.create("natural"); public static final BooleanProperty OCCUPIED = BooleanProperty.create("occupied"); public static final BooleanProperty OPEN = BooleanProperty.create("open"); public static final BooleanProperty PERSISTENT = BooleanProperty.create("persistent"); public static final BooleanProperty POWERED = BooleanProperty.create("powered"); 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 SNOWY = BooleanProperty.create("snowy"); + public static final BooleanProperty TIP = BooleanProperty.create("tip"); public static final BooleanProperty TRIGGERED = BooleanProperty.create("triggered"); public static final BooleanProperty UNSTABLE = BooleanProperty.create("unstable"); 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 HORIZONTAL_AXIS = EnumProperty.create("axis", Axis.X, Axis.Z); public static final EnumProperty AXIS = EnumProperty.create("axis", Axis.VALUES); 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 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 CREAKING = BasicEnumProperty.create("creaking", "disabled", "dormant", "active"); public static final BooleanProperty OMINOUS = BooleanProperty.create("ominous"); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java index 40ee28362..cbc8ce7bd 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/AnvilInventoryTranslator.java @@ -73,7 +73,7 @@ public class AnvilInventoryTranslator extends AbstractBlockInventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case ANVIL_INPUT -> 0; case ANVIL_MATERIAL -> 1; case ANVIL_RESULT, CREATED_OUTPUT -> 2; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java index f70bad9ea..fd6d9a930 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BaseInventoryTranslator.java @@ -44,7 +44,7 @@ public abstract class BaseInventoryTranslator extends InventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { int slotnum = slotInfoData.getSlot(); - switch (slotInfoData.getContainer()) { + switch (slotInfoData.getContainerName().getContainer()) { case HOTBAR_AND_INVENTORY: case HOTBAR: case INVENTORY: diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java index ceae1b640..6edbd925e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BeaconInventoryTranslator.java @@ -121,7 +121,7 @@ public class BeaconInventoryTranslator extends AbstractBlockInventoryTranslator @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - if (slotInfoData.getContainer() == ContainerSlotType.BEACON_PAYMENT) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BEACON_PAYMENT) { return 0; } return super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java index e425342f3..5147fb75d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/BrewingInventoryTranslator.java @@ -74,11 +74,11 @@ public class BrewingInventoryTranslator extends AbstractBlockInventoryTranslator @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - if (slotInfoData.getContainer() == ContainerSlotType.BREWING_INPUT) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BREWING_INPUT) { // Ingredient return 3; } - if (slotInfoData.getContainer() == ContainerSlotType.BREWING_RESULT) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.BREWING_RESULT) { // Potions return slotInfoData.getSlot() - 1; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java index b0914e5dd..65fc7b35c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/CartographyInventoryTranslator.java @@ -56,7 +56,7 @@ public class CartographyInventoryTranslator extends AbstractBlockInventoryTransl @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case CARTOGRAPHY_INPUT -> 0; case CARTOGRAPHY_ADDITIONAL -> 1; case CARTOGRAPHY_RESULT, CREATED_OUTPUT -> 2; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/CrafterInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/CrafterInventoryTranslator.java index 8b0a0ac44..83076640a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/CrafterInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/CrafterInventoryTranslator.java @@ -77,7 +77,7 @@ public class CrafterInventoryTranslator extends AbstractBlockInventoryTranslator @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { int slot = slotInfoData.getSlot(); - switch (slotInfoData.getContainer()) { + switch (slotInfoData.getContainerName().getContainer()) { case HOTBAR_AND_INVENTORY, HOTBAR, INVENTORY -> { //hotbar if (slot >= 9) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/CraftingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/CraftingInventoryTranslator.java index 4a0f1d7d9..577d87fe5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/CraftingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/CraftingInventoryTranslator.java @@ -64,12 +64,12 @@ public class CraftingInventoryTranslator extends AbstractBlockInventoryTranslato @Override 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 // Bedrock is the same, but it starts from 32. 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 super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java index b51d86d13..eb0e351e1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java @@ -135,10 +135,10 @@ public class EnchantingInventoryTranslator extends AbstractBlockInventoryTransla @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - if (slotInfoData.getContainer() == ContainerSlotType.ENCHANTING_INPUT) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.ENCHANTING_INPUT) { return 0; } - if (slotInfoData.getContainer() == ContainerSlotType.ENCHANTING_MATERIAL) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.ENCHANTING_MATERIAL) { return 1; } return super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/GrindstoneInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/GrindstoneInventoryTranslator.java index 5344d27cb..d3283de40 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/GrindstoneInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/GrindstoneInventoryTranslator.java @@ -39,7 +39,7 @@ public class GrindstoneInventoryTranslator extends AbstractBlockInventoryTransla @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case GRINDSTONE_INPUT -> 0; case GRINDSTONE_ADDITIONAL -> 1; case GRINDSTONE_RESULT, CREATED_OUTPUT -> 2; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java index 7cdcbe8a9..e294442f9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/LoomInventoryTranslator.java @@ -169,7 +169,7 @@ public class LoomInventoryTranslator extends AbstractBlockInventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case LOOM_INPUT -> 0; case LOOM_DYE -> 1; case LOOM_MATERIAL -> 2; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java index 7a7646503..c67b3b190 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/MerchantInventoryTranslator.java @@ -77,7 +77,7 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case TRADE2_INGREDIENT_1 -> 0; case TRADE2_INGREDIENT_2 -> 1; case TRADE2_RESULT, CREATED_OUTPUT -> 2; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/OldSmithingTableTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/OldSmithingTableTranslator.java index 38bb6ddcd..fc9c4f587 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/OldSmithingTableTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/OldSmithingTableTranslator.java @@ -63,7 +63,7 @@ public class OldSmithingTableTranslator extends AbstractBlockInventoryTranslator @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case SMITHING_TABLE_INPUT -> 0; case SMITHING_TABLE_MATERIAL -> 1; case SMITHING_TABLE_RESULT, CREATED_OUTPUT -> 2; @@ -130,7 +130,7 @@ public class OldSmithingTableTranslator extends AbstractBlockInventoryTranslator } private boolean isInvalidAction(ItemStackRequestSlotData slotData) { - return slotData.getContainer().equals(ContainerSlotType.SMITHING_TABLE_TEMPLATE); + return slotData.getContainerName().getContainer().equals(ContainerSlotType.SMITHING_TABLE_TEMPLATE); } @Override diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java index f08b90765..445b4715b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/PlayerInventoryTranslator.java @@ -184,7 +184,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { int slotnum = slotInfoData.getSlot(); - switch (slotInfoData.getContainer()) { + switch (slotInfoData.getContainerName().getContainer()) { case HOTBAR_AND_INVENTORY: case HOTBAR: case INVENTORY: @@ -462,7 +462,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } craftState = CraftState.TRANSFER; - if (transferAction.getSource().getContainer() != ContainerSlotType.CREATED_OUTPUT) { + if (transferAction.getSource().getContainerName().getContainer() != ContainerSlotType.CREATED_OUTPUT) { return rejectRequest(request); } @@ -495,7 +495,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } 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); } @@ -532,7 +532,7 @@ public class PlayerInventoryTranslator extends InventoryTranslator { } private static boolean isCraftingGrid(ItemStackRequestSlotData slotInfoData) { - return slotInfoData.getContainer() == ContainerSlotType.CRAFTING_INPUT; + return slotInfoData.getContainerName().getContainer() == ContainerSlotType.CRAFTING_INPUT; } @Override diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/SmithingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/SmithingInventoryTranslator.java index dbe24230a..2a9e974f3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/SmithingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/SmithingInventoryTranslator.java @@ -44,7 +44,7 @@ public class SmithingInventoryTranslator extends AbstractBlockInventoryTranslato @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case SMITHING_TABLE_TEMPLATE -> TEMPLATE; case SMITHING_TABLE_INPUT -> INPUT; case SMITHING_TABLE_MATERIAL -> MATERIAL; diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java index b977ee1a1..df7e15fef 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java @@ -84,7 +84,7 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - return switch (slotInfoData.getContainer()) { + return switch (slotInfoData.getContainerName().getContainer()) { case STONECUTTER_INPUT -> 0; case STONECUTTER_RESULT, CREATED_OUTPUT -> 1; default -> super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java index f1a5723c8..1a65ad982 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/ChestedHorseInventoryTranslator.java @@ -53,10 +53,10 @@ public abstract class ChestedHorseInventoryTranslator extends AbstractHorseInven @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - if (slotInfoData.getContainer() == ContainerSlotType.HORSE_EQUIP) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.HORSE_EQUIP) { return this.equipSlot; } - if (slotInfoData.getContainer() == ContainerSlotType.LEVEL_ENTITY) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.LEVEL_ENTITY) { return slotInfoData.getSlot() + 1; } return super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/HorseInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/HorseInventoryTranslator.java index 84d7744d1..af09d5f61 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/HorseInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/horse/HorseInventoryTranslator.java @@ -36,7 +36,7 @@ public class HorseInventoryTranslator extends AbstractHorseInventoryTranslator { @Override public int bedrockSlotToJava(ItemStackRequestSlotData slotInfoData) { - if (slotInfoData.getContainer() == ContainerSlotType.HORSE_EQUIP) { + if (slotInfoData.getContainerName().getContainer() == ContainerSlotType.HORSE_EQUIP) { return slotInfoData.getSlot(); } return super.bedrockSlotToJava(slotInfoData); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java index e1ff7a5fc..cdadb1bb9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEquipmentTranslator.java @@ -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.LivingEntity; import org.geysermc.geyser.entity.type.player.PlayerEntity; +import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.item.Items; import org.geysermc.geyser.session.GeyserSession; 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.mcprotocollib.protocol.data.game.entity.metadata.Equipment; 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; @Translator(packet = ClientboundSetEquipmentPacket.class) @@ -64,7 +66,7 @@ public class JavaSetEquipmentTranslator extends PacketTranslator