From 701fa0d7b043e167df97b30fbfde90e908e54da5 Mon Sep 17 00:00:00 2001 From: Steveice10 Date: Mon, 1 Jun 2020 11:37:23 -0700 Subject: [PATCH] Add missing attribute and modifier. --- .../github/steveice10/mc/protocol/data/MagicValues.java | 6 +++++- .../protocol/data/game/entity/attribute/AttributeType.java | 3 ++- .../protocol/data/game/entity/attribute/ModifierType.java | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java index 16c5bc78..737fff5b 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java @@ -120,12 +120,14 @@ public class MagicValues { register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movementSpeed"); register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attackDamage"); register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attackSpeed"); + register(AttributeType.GENERIC_FLYING_SPEED, "generic.flyingSpeed"); register(AttributeType.GENERIC_ARMOR, "generic.armor"); register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armorToughness"); + register(AttributeType.GENERIC_ATTACK_KNOCKBACK, "generic.attackKnockback"); register(AttributeType.GENERIC_LUCK, "generic.luck"); - register(AttributeType.GENERIC_FLYING_SPEED, "generic.flyingSpeed"); register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jumpStrength"); register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawnReinforcements"); + // Forge-only register(AttributeType.SWIM_SPEED, "forge.swimSpeed"); register(AttributeType.NAMETAG_DISTANCE, "forge.nameTagDistance"); register(AttributeType.ENTITY_GRAVITY, "forge.entity_gravity"); @@ -152,6 +154,8 @@ public class MagicValues { register(ModifierType.CHESTPLATE_MODIFIER, UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E")); register(ModifierType.HELMET_MODIFIER, UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")); register(ModifierType.COVERED_ARMOR_BONUS, UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F")); + // Forge-only + register(ModifierType.SLOW_FALLING, UUID.fromString("A5B6CF2A-2F7C-31EF-9022-7C3E7D5E6ABA")); register(ModifierOperation.ADD, 0); register(ModifierOperation.ADD_MULTIPLIED, 1); diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/AttributeType.java b/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/AttributeType.java index f63ec1f2..5f17f506 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/AttributeType.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/AttributeType.java @@ -12,10 +12,11 @@ public enum AttributeType { GENERIC_MOVEMENT_SPEED(0.699999988079071, 0, 1024), GENERIC_ATTACK_DAMAGE(2, 0, 2048), GENERIC_ATTACK_SPEED(4, 0, 1024), + GENERIC_FLYING_SPEED(0.4000000059604645, 0, 1024), GENERIC_ARMOR(0, 0, 30), GENERIC_ARMOR_TOUGHNESS(0, 0, 20), + GENERIC_ATTACK_KNOCKBACK(0, 0, 5), GENERIC_LUCK(0, -1024, 1024), - GENERIC_FLYING_SPEED(0.4000000059604645, 0, 1024), HORSE_JUMP_STRENGTH(0.7, 0, 2), ZOMBIE_SPAWN_REINFORCEMENTS(0, 0, 1), /** diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/ModifierType.java b/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/ModifierType.java index b585afc4..f086258a 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/ModifierType.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/game/entity/attribute/ModifierType.java @@ -22,5 +22,10 @@ public enum ModifierType { LEGGINGS_MODIFIER, CHESTPLATE_MODIFIER, HELMET_MODIFIER, - COVERED_ARMOR_BONUS; + COVERED_ARMOR_BONUS, + /** + * Only available for clients/servers using Minecraft Forge. + * Source: MinecraftForge/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch#9 + */ + SLOW_FALLING }