Skip to content

Commit

Permalink
Fix potions, hopefully last time...
Browse files Browse the repository at this point in the history
  • Loading branch information
bensku committed Mar 16, 2016
1 parent 0654bf6 commit f2ec9b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/Aliases.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private final static String concatenate(final String... parts) {
static LinkedHashMap<String, ItemType> getAliases(final String name, final ItemType value, final Variations variations) {
final LinkedHashMap<String, ItemType> r = new LinkedHashMap<String, ItemType>(); // LinkedHashMap to preserve order for item names

if (value.isOfType(new ItemStack(Material.POTION)) && newPotions) { // 1.9 new potions hack
if ((name.contains("potion") || name.contains("water bottle") || name.contains("bottle of water")) && newPotions) { // 1.9 new potions hack
return r;
}

Expand Down
7 changes: 5 additions & 2 deletions src/main/java/ch/njol/skript/expressions/ExprPotionItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ protected ItemType[] get(final Event e) {
if (usage == 2) mat = Material.LINGERING_POTION;

ItemStack item = new ItemStack(mat);
if (water) return new ItemType[] {new ItemType(item)};
PotionData potion = new PotionData(PotionEffectUtils.effectToType(type.getSingle(e)), mod == 2, mod == 1);
PotionData potion;
if (!water)
potion = new PotionData(PotionEffectUtils.effectToType(type.getSingle(e)), mod == 2, mod == 1);
else
potion = new PotionData(PotionType.WATER);
PotionMeta meta = (PotionMeta) item.getItemMeta();
meta.setBasePotionData(potion);
item.setItemMeta(meta);
Expand Down

0 comments on commit f2ec9b8

Please sign in to comment.