Skip to content

Commit

Permalink
Handle item types in ExprXOf (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensku committed Dec 31, 2018
1 parent 048ce29 commit 43e1d26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/ch/njol/skript/expressions/ExprXOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.jdt.annotation.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.aliases.ItemType;
import ch.njol.skript.classes.Converter;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples;
Expand Down Expand Up @@ -80,6 +81,10 @@ public Object convert(final Object o) {
final ItemStack is = ((ItemStack) o).clone();
is.setAmount(a.intValue());
return is;
} else if (o instanceof ItemType) {
ItemType type = ((ItemType) o).clone();
type.setAmount(a.intValue());
return type;
} else {
final EntityType t = ((EntityType) o).clone();
t.amount = a.intValue();
Expand Down

0 comments on commit 43e1d26

Please sign in to comment.