SPIGOT-2085 / SPIGOT-2087 / SPIGOT-2156: Rework internal PotionMeta state to be correct and less complex.

By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2016-04-09 11:49:04 -04:00
parent 5c7c823a9a
commit cfffbb4d68
3 changed files with 19 additions and 24 deletions

View File

@@ -24,7 +24,7 @@ public class CraftPotionBrewer implements PotionBrewer {
if (cache.containsKey(damage))
return cache.get(damage);
List<MobEffect> mcEffects = PotionRegistry.a(CraftPotionUtil.fromBukkit(new PotionData(damage, upgraded, extended))).a();
List<MobEffect> mcEffects = PotionRegistry.a(CraftPotionUtil.fromBukkit(new PotionData(damage, extended, upgraded))).a();
ImmutableList.Builder<PotionEffect> builder = new ImmutableList.Builder<PotionEffect>();
for (MobEffect effect : mcEffects) {

View File

@@ -68,9 +68,12 @@ public class CraftPotionUtil {
}
public static PotionData toBukkit(String type) {
if (type.startsWith("minecraft:")) {
type = type.substring(10);
}
if (type == null) {
return new PotionData(PotionType.UNCRAFTABLE, false, false);
}
if (type.startsWith("minecraft:")) {
type = type.substring(10);
}
PotionType potionType = null;
potionType = extendable.inverse().get(type);
if (potionType != null) {