|
16 | 16 | public class AttributeX { |
17 | 17 |
|
18 | 18 | public static final Attribute GENERIC_JUMP_STRENGTH; |
| 19 | + public static final Attribute MAX_HEALTH; |
| 20 | + public static final Attribute FOLLOW_RANGE; |
| 21 | + public static final Attribute KNOCKBACK_RESISTANCE; |
| 22 | + public static final Attribute MOVEMENT_SPEED; |
| 23 | + public static final Attribute FLYING_SPEED; |
| 24 | + public static final Attribute ATTACK_DAMAGE; |
| 25 | + public static final Attribute ATTACK_KNOCKBACK; |
| 26 | + public static final Attribute ATTACK_SPEED; |
| 27 | + public static final Attribute ARMOR; |
| 28 | + public static final Attribute ARMOR_TOUGHNESS; |
| 29 | + public static final Attribute FALL_DAMAGE_MULTIPLIER; |
| 30 | + public static final Attribute LUCK; |
| 31 | + public static final Attribute MAX_ABSORPTION; |
| 32 | + public static final Attribute SAFE_FALL_DISTANCE; |
| 33 | + public static final Attribute SCALE; |
| 34 | + public static final Attribute STEP_HEIGHT; |
| 35 | + public static final Attribute GRAVITY; |
| 36 | + public static final Attribute JUMP_STRENGTH; |
| 37 | + public static final Attribute BURNING_TIME; // 1.21+ |
| 38 | + public static final Attribute EXPLOSION_KNOCKBACK_RESISTANCE; // 1.21+ |
| 39 | + public static final Attribute MOVEMENT_EFFICIENCY; // 1.21+ |
| 40 | + public static final Attribute OXYGEN_BONUS; // 1.21+ |
| 41 | + public static final Attribute WATER_MOVEMENT_EFFICIENCY; // 1.21+ |
| 42 | + public static final Attribute TEMPT_RANGE; |
| 43 | + public static final Attribute BLOCK_INTERACTION_RANGE; |
| 44 | + public static final Attribute ENTITY_INTERACTION_RANGE; |
| 45 | + public static final Attribute BLOCK_BREAK_SPEED; |
| 46 | + public static final Attribute MINING_EFFICIENCY; // 1.21+ |
| 47 | + public static final Attribute SNEAKING_SPEED; // 1.21+ |
| 48 | + public static final Attribute SUBMERGED_MINING_SPEED; // 1.21+ |
| 49 | + public static final Attribute SWEEPING_DAMAGE_RATIO; // 1.21+ |
| 50 | + public static final Attribute SPAWN_REINFORCEMENTS; |
19 | 51 |
|
20 | 52 | static { |
21 | 53 | boolean isPost205 = MinecraftVersionUtil.isAtLeast(20, 5); |
| 54 | + boolean isPost213 = MinecraftVersionUtil.isAtLeast(21, 3); |
22 | 55 |
|
23 | | - GENERIC_JUMP_STRENGTH = isPost205 ? Attribute.GENERIC_JUMP_STRENGTH : getField("HORSE_JUMP_STRENGTH"); |
| 56 | + // 1.20.5 rename |
| 57 | + GENERIC_JUMP_STRENGTH = isPost213 ? Attribute.JUMP_STRENGTH : isPost205 ? getField("GENERIC_JUMP_STRENGTH") : getField("HORSE_JUMP_STRENGTH"); |
| 58 | + |
| 59 | + // 1.21.3 rename |
| 60 | + MAX_HEALTH = isPost213 ? Attribute.MAX_HEALTH : getField("GENERIC_MAX_HEALTH"); |
| 61 | + FOLLOW_RANGE = isPost213 ? Attribute.FOLLOW_RANGE : getField("GENERIC_FOLLOW_RANGE"); |
| 62 | + KNOCKBACK_RESISTANCE = isPost213 ? Attribute.KNOCKBACK_RESISTANCE : getField("GENERIC_KNOCKBACK_RESISTANCE"); |
| 63 | + MOVEMENT_SPEED = isPost213 ? Attribute.MOVEMENT_SPEED : getField("GENERIC_MOVEMENT_SPEED"); |
| 64 | + FLYING_SPEED = isPost213 ? Attribute.FLYING_SPEED : getField("GENERIC_FLYING_SPEED"); |
| 65 | + ATTACK_DAMAGE = isPost213 ? Attribute.ATTACK_DAMAGE : getField("GENERIC_ATTACK_DAMAGE"); |
| 66 | + ATTACK_KNOCKBACK = isPost213 ? Attribute.ATTACK_KNOCKBACK : getField("GENERIC_ATTACK_KNOCKBACK"); |
| 67 | + ATTACK_SPEED = isPost213 ? Attribute.ATTACK_SPEED : getField("GENERIC_ATTACK_SPEED"); |
| 68 | + ARMOR = isPost213 ? Attribute.ARMOR : getField("GENERIC_ARMOR"); |
| 69 | + ARMOR_TOUGHNESS = isPost213 ? Attribute.ARMOR_TOUGHNESS : getField("GENERIC_ARMOR_TOUGHNESS"); |
| 70 | + FALL_DAMAGE_MULTIPLIER = isPost213 ? Attribute.FALL_DAMAGE_MULTIPLIER : getField("GENERIC_FALL_DAMAGE_MULTIPLIER"); |
| 71 | + LUCK = isPost213 ? Attribute.LUCK : getField("GENERIC_LUCK"); |
| 72 | + MAX_ABSORPTION = isPost213 ? Attribute.MAX_ABSORPTION : getField("GENERIC_MAX_ABSORPTION"); |
| 73 | + SAFE_FALL_DISTANCE = isPost213 ? Attribute.SAFE_FALL_DISTANCE : getField("GENERIC_SAFE_FALL_DISTANCE"); |
| 74 | + SCALE = isPost213 ? Attribute.SCALE : getField("GENERIC_SCALE"); |
| 75 | + STEP_HEIGHT = isPost213 ? Attribute.STEP_HEIGHT : getField("GENERIC_STEP_HEIGHT"); |
| 76 | + GRAVITY = isPost213 ? Attribute.GRAVITY : getField("GENERIC_GRAVITY"); |
| 77 | + JUMP_STRENGTH = GENERIC_JUMP_STRENGTH; |
| 78 | + BURNING_TIME = isPost213 ? Attribute.BURNING_TIME : getField("GENERIC_BURNING_TIME"); |
| 79 | + EXPLOSION_KNOCKBACK_RESISTANCE = isPost213 ? Attribute.EXPLOSION_KNOCKBACK_RESISTANCE : getField("GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE"); |
| 80 | + MOVEMENT_EFFICIENCY = isPost213 ? Attribute.MOVEMENT_EFFICIENCY : getField("GENERIC_MOVEMENT_EFFICIENCY"); |
| 81 | + OXYGEN_BONUS = isPost213 ? Attribute.OXYGEN_BONUS : getField("GENERIC_OXYGEN_BONUS"); |
| 82 | + WATER_MOVEMENT_EFFICIENCY = isPost213 ? Attribute.WATER_MOVEMENT_EFFICIENCY : getField("GENERIC_WATER_MOVEMENT_EFFICIENCY"); |
| 83 | + TEMPT_RANGE = isPost213 ? Attribute.TEMPT_RANGE : getField("GENERIC_TEMPT_RANGE"); |
| 84 | + BLOCK_INTERACTION_RANGE = isPost213 ? Attribute.BLOCK_INTERACTION_RANGE : getField("PLAYER_BLOCK_INTERACTION_RANGE"); |
| 85 | + ENTITY_INTERACTION_RANGE = isPost213 ? Attribute.ENTITY_INTERACTION_RANGE : getField("PLAYER_ENTITY_INTERACTION_RANGE"); |
| 86 | + BLOCK_BREAK_SPEED = isPost213 ? Attribute.BLOCK_BREAK_SPEED : getField("PLAYER_BLOCK_BREAK_SPEED"); |
| 87 | + MINING_EFFICIENCY = isPost213 ? Attribute.MINING_EFFICIENCY : getField("PLAYER_MINING_EFFICIENCY"); |
| 88 | + SNEAKING_SPEED = isPost213 ? Attribute.SNEAKING_SPEED : getField("PLAYER_SNEAKING_SPEED"); |
| 89 | + SUBMERGED_MINING_SPEED = isPost213 ? Attribute.SUBMERGED_MINING_SPEED : getField("PLAYER_SUBMERGED_MINING_SPEED"); |
| 90 | + SWEEPING_DAMAGE_RATIO = isPost213 ? Attribute.SWEEPING_DAMAGE_RATIO : getField("PLAYER_SWEEPING_DAMAGE_RATIO"); |
| 91 | + SPAWN_REINFORCEMENTS = isPost213 ? Attribute.SPAWN_REINFORCEMENTS : getField("ZOMBIE_SPAWN_REINFORCEMENTS"); |
24 | 92 | } |
25 | 93 |
|
26 | 94 | @Nullable |
|
0 commit comments