diff --git a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java index 7adfd488f..290bf2a4e 100644 --- a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java +++ b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java @@ -83,7 +83,7 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap { // Copied from ViaVersion. // https://github.com/ViaVersion/ViaVersion/blob/b8072aad86695cc8ec6f5e4103e43baf3abf6cc5/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java#L43 try { - ProtocolConstants.class.getField("MINECRAFT_1_21"); + ProtocolConstants.class.getField("MINECRAFT_1_21_4"); } catch (NoSuchFieldException e) { geyserLogger.error(" / \\"); geyserLogger.error(" / \\"); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java index 1b06f3860..b108c9fbe 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java @@ -128,6 +128,7 @@ public class WolfEntity extends TameableEntity { public void setBody(ItemStack stack) { super.setBody(stack); isCurseOfBinding = ItemUtils.hasEffect(session, stack, EnchantmentComponent.PREVENT_ARMOR_CHANGE); + // Not using ItemStack#getDataComponents as that wouldn't include default item components repairableItems = GeyserItemStack.from(stack).getComponent(DataComponentType.REPAIRABLE); } diff --git a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java index c595ea1b5..4ddff305e 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java @@ -125,6 +125,10 @@ public class GeyserItemStack { return isEmpty() ? null : components; } + /** + * @return whether this GeyserItemStack has any additional components on top of + * the base item components. + */ public boolean hasNonBaseComponents() { return components != null; } @@ -137,6 +141,15 @@ public class GeyserItemStack { return components; } + /** + * Returns the stored data component for a given {@link DataComponentType}, or null. + *
+ * This method will first check the additional components that may exist,
+ * and fallback to the item's default (or, "base") components if need be.
+ * @param type the {@link DataComponentType} to query
+ * @return the value for said type, or null.
+ * @param