SPIGOT-5336: Field name parity with Minecraft keys
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -27,42 +27,42 @@ public abstract class PotionEffectType implements Keyed, Translatable {
|
||||
/**
|
||||
* Decreases movement speed.
|
||||
*/
|
||||
public static final PotionEffectType SLOW = getPotionEffectType(2, "slowness");
|
||||
public static final PotionEffectType SLOWNESS = getPotionEffectType(2, "slowness");
|
||||
|
||||
/**
|
||||
* Increases dig speed.
|
||||
*/
|
||||
public static final PotionEffectType FAST_DIGGING = getPotionEffectType(3, "haste");
|
||||
public static final PotionEffectType HASTE = getPotionEffectType(3, "haste");
|
||||
|
||||
/**
|
||||
* Decreases dig speed.
|
||||
*/
|
||||
public static final PotionEffectType SLOW_DIGGING = getPotionEffectType(4, "mining_fatigue");
|
||||
public static final PotionEffectType MINING_FATIGUE = getPotionEffectType(4, "mining_fatigue");
|
||||
|
||||
/**
|
||||
* Increases damage dealt.
|
||||
*/
|
||||
public static final PotionEffectType INCREASE_DAMAGE = getPotionEffectType(5, "strength");
|
||||
public static final PotionEffectType STRENGTH = getPotionEffectType(5, "strength");
|
||||
|
||||
/**
|
||||
* Heals an entity.
|
||||
*/
|
||||
public static final PotionEffectType HEAL = getPotionEffectType(6, "instant_health");
|
||||
public static final PotionEffectType INSTANT_HEALTH = getPotionEffectType(6, "instant_health");
|
||||
|
||||
/**
|
||||
* Hurts an entity.
|
||||
*/
|
||||
public static final PotionEffectType HARM = getPotionEffectType(7, "instant_damage");
|
||||
public static final PotionEffectType INSTANT_DAMAGE = getPotionEffectType(7, "instant_damage");
|
||||
|
||||
/**
|
||||
* Increases jump height.
|
||||
*/
|
||||
public static final PotionEffectType JUMP = getPotionEffectType(8, "jump_boost");
|
||||
public static final PotionEffectType JUMP_BOOST = getPotionEffectType(8, "jump_boost");
|
||||
|
||||
/**
|
||||
* Warps vision on the client.
|
||||
*/
|
||||
public static final PotionEffectType CONFUSION = getPotionEffectType(9, "nausea");
|
||||
public static final PotionEffectType NAUSEA = getPotionEffectType(9, "nausea");
|
||||
|
||||
/**
|
||||
* Regenerates health.
|
||||
@@ -72,7 +72,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
|
||||
/**
|
||||
* Decreases damage dealt to an entity.
|
||||
*/
|
||||
public static final PotionEffectType DAMAGE_RESISTANCE = getPotionEffectType(11, "resistance");
|
||||
public static final PotionEffectType RESISTANCE = getPotionEffectType(11, "resistance");
|
||||
|
||||
/**
|
||||
* Stops fire damage.
|
||||
@@ -340,7 +340,6 @@ public abstract class PotionEffectType implements Keyed, Translatable {
|
||||
@Deprecated
|
||||
public static PotionEffectType getByName(@NotNull String name) {
|
||||
Preconditions.checkArgument(name != null, "name cannot be null");
|
||||
name = convertLegacy(name);
|
||||
return Registry.EFFECT.get(NamespacedKey.fromString(name.toLowerCase(java.util.Locale.ENGLISH)));
|
||||
}
|
||||
|
||||
@@ -353,33 +352,4 @@ public abstract class PotionEffectType implements Keyed, Translatable {
|
||||
public static PotionEffectType[] values() {
|
||||
return Lists.newArrayList(Registry.EFFECT).toArray(new PotionEffectType[0]);
|
||||
}
|
||||
|
||||
private static String convertLegacy(String from) {
|
||||
if (from == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (from.toLowerCase()) {
|
||||
case "slow":
|
||||
return "slowness";
|
||||
case "fast_digging":
|
||||
return "haste";
|
||||
case "slow_digging":
|
||||
return "mining_fatigue";
|
||||
case "increase_damage":
|
||||
return "strength";
|
||||
case "heal":
|
||||
return "instant_health";
|
||||
case "harm":
|
||||
return "instant_damage";
|
||||
case "jump":
|
||||
return "jump_boost";
|
||||
case "confusion":
|
||||
return "nausea";
|
||||
case "damage_resistance":
|
||||
return "resistance";
|
||||
}
|
||||
|
||||
return from;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ public enum PotionType implements Keyed {
|
||||
LONG_NIGHT_VISION("long_night_vision"),
|
||||
INVISIBILITY("invisibility"),
|
||||
LONG_INVISIBILITY("long_invisibility"),
|
||||
JUMP("leaping"),
|
||||
LEAPING("leaping"),
|
||||
LONG_LEAPING("long_leaping"),
|
||||
STRONG_LEAPING("strong_leaping"),
|
||||
FIRE_RESISTANCE("fire_resistance"),
|
||||
LONG_FIRE_RESISTANCE("long_fire_resistance"),
|
||||
SPEED("swiftness"),
|
||||
SWIFTNESS("swiftness"),
|
||||
LONG_SWIFTNESS("long_swiftness"),
|
||||
STRONG_SWIFTNESS("strong_swiftness"),
|
||||
SLOWNESS("slowness"),
|
||||
@@ -37,14 +37,14 @@ public enum PotionType implements Keyed {
|
||||
STRONG_SLOWNESS("strong_slowness"),
|
||||
WATER_BREATHING("water_breathing"),
|
||||
LONG_WATER_BREATHING("long_water_breathing"),
|
||||
INSTANT_HEAL("healing"),
|
||||
HEALING("healing"),
|
||||
STRONG_HEALING("strong_healing"),
|
||||
INSTANT_DAMAGE("harming"),
|
||||
HARMING("harming"),
|
||||
STRONG_HARMING("strong_harming"),
|
||||
POISON("poison"),
|
||||
LONG_POISON("long_poison"),
|
||||
STRONG_POISON("strong_poison"),
|
||||
REGEN("regeneration"),
|
||||
REGENERATION("regeneration"),
|
||||
LONG_REGENERATION("long_regeneration"),
|
||||
STRONG_REGENERATION("strong_regeneration"),
|
||||
STRENGTH("strength"),
|
||||
|
||||
Reference in New Issue
Block a user