Fix potion bug with setclass command.
This commit is contained in:
@@ -42,13 +42,18 @@ public class ItemParser
|
|||||||
|
|
||||||
// <data> part
|
// <data> part
|
||||||
MaterialData md = stack.getData();
|
MaterialData md = stack.getData();
|
||||||
byte data = (md != null ? md.getData() : 0);
|
short data = (md != null ? md.getData() : 0);
|
||||||
|
|
||||||
// Take wool into account
|
// Take wool into account
|
||||||
if (stack.getType() == Material.WOOL) {
|
if (stack.getType() == Material.WOOL) {
|
||||||
data = (byte) (15 - data);
|
data = (byte) (15 - data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take potions into account
|
||||||
|
else if (stack.getType() == Material.POTION) {
|
||||||
|
data = stack.getDurability();
|
||||||
|
}
|
||||||
|
|
||||||
// <amount> part
|
// <amount> part
|
||||||
int amount = stack.getAmount();
|
int amount = stack.getAmount();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user