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:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user