From 6819d2b4c65f5bcc95306374c479b598726d3d91 Mon Sep 17 00:00:00 2001 From: Eclipse Date: Tue, 18 Jun 2024 08:24:54 +0000 Subject: [PATCH] Update to recent Geyser --- .../populator/CustomItemRegistryPopulator.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java index df63b6316..8d22562c4 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java @@ -207,7 +207,7 @@ public class CustomItemRegistryPopulator { if (mapping.isEdible() || customItemData.isEdible()) { computeConsumableProperties(itemProperties, componentBuilder, 1, - customItemData.canAlwaysEat(), protocolVersion); + customItemData.canAlwaysEat()); } if (mapping.isEntityPlacer()) { @@ -221,7 +221,7 @@ public class CustomItemRegistryPopulator { switch (mapping.getBedrockIdentifier()) { case "minecraft:fire_charge", "minecraft:flint_and_steel" -> computeBlockItemProperties("minecraft:fire", componentBuilder); case "minecraft:bow", "minecraft:crossbow", "minecraft:trident" -> computeChargeableProperties(itemProperties, componentBuilder, mapping.getBedrockIdentifier(), protocolVersion); - case "minecraft:honey_bottle", "minecraft:milk_bucket", "minecraft:potion" -> computeConsumableProperties(itemProperties, componentBuilder, 2, true, protocolVersion); + case "minecraft:honey_bottle", "minecraft:milk_bucket", "minecraft:potion" -> computeConsumableProperties(itemProperties, componentBuilder, 2, true); case "minecraft:experience_bottle", "minecraft:egg", "minecraft:ender_pearl", "minecraft:ender_eye", "minecraft:lingering_potion", "minecraft:snowball", "minecraft:splash_potion" -> computeThrowableProperties(componentBuilder); } @@ -258,7 +258,7 @@ public class CustomItemRegistryPopulator { } if (customItemData.isEdible()) { - computeConsumableProperties(itemProperties, componentBuilder, 1, customItemData.canAlwaysEat(), protocolVersion); + computeConsumableProperties(itemProperties, componentBuilder, 1, customItemData.canAlwaysEat()); } if (customItemData.isChargeable()) { @@ -501,7 +501,7 @@ public class CustomItemRegistryPopulator { } private static void computeConsumableProperties(NbtMapBuilder itemProperties, NbtMapBuilder componentBuilder, - int useAnimation, boolean canAlwaysEat, int protocolVersion) { + int useAnimation, boolean canAlwaysEat) { // this is the duration of the use animation in ticks; note that in behavior packs this is set as a float in seconds, but over the network it is an int in ticks itemProperties.putInt("use_duration", 32); // this dictates that the item will use the eat or drink animation (in the first person) and play eat or drink sounds @@ -509,13 +509,6 @@ public class CustomItemRegistryPopulator { itemProperties.putInt("use_animation", useAnimation); // this component is required to allow the eat animation to play componentBuilder.putCompound("minecraft:food", NbtMap.builder().putBoolean("can_always_eat", canAlwaysEat).build()); - - if (GameProtocol.is1_20_60orHigher(protocolVersion)) { - componentBuilder.putCompound("minecraft:use_modifiers", NbtMap.builder() - .putFloat("use_duration", 100F) - .putFloat("movement_modifier", 0.35F) - .build()); - } } private static void computeEntityPlacerProperties(NbtMapBuilder componentBuilder) {