mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Finishing up backwards compatibility for dye colors.
This commit is contained in:
parent
e41ab3ac18
commit
b0500332bc
@ -404,8 +404,13 @@ public class Fishing {
|
||||
break;
|
||||
|
||||
case SQUID:
|
||||
ItemStack item = new ItemStack(Material.INK_SACK, 1, (short) 0);
|
||||
item.setData(new MaterialData(Material.INK_SACK, DyeColor.BLACK.getDyeData()));
|
||||
ItemStack item;
|
||||
try {
|
||||
item = (new MaterialData(Material.INK_SACK, DyeColor.BLACK.getDyeData())).toItemStack(1);
|
||||
}
|
||||
catch(Exception e) {
|
||||
item = (new MaterialData(Material.INK_SACK, (byte) 0)).toItemStack(1);
|
||||
}
|
||||
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
@ -269,8 +269,13 @@ public class Herbalism {
|
||||
}
|
||||
else {
|
||||
if (mat == Material.COCOA) {
|
||||
try {
|
||||
is = new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData());
|
||||
}
|
||||
catch (Exception e) {
|
||||
is = new ItemStack(Material.INK_SACK, 1, (short) 3);
|
||||
}
|
||||
}
|
||||
else if (mat == Material.CARROT) {
|
||||
is = new ItemStack(Material.CARROT_ITEM, 1, (short) 0);
|
||||
}
|
||||
@ -422,7 +427,12 @@ public class Herbalism {
|
||||
break;
|
||||
case COCOA:
|
||||
// Broken: Requires an update to bukkit to enable seaching for variable-sized ItemStacks.
|
||||
try {
|
||||
hasSeeds = inventory.contains(new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()), 1);
|
||||
}
|
||||
catch(Exception e) {
|
||||
hasSeeds = inventory.contains(new ItemStack(Material.INK_SACK, 1, (short) 3), 1);
|
||||
}
|
||||
break;
|
||||
case CARROT:
|
||||
hasSeeds = inventory.contains(Material.CARROT_ITEM);
|
||||
@ -456,8 +466,14 @@ public class Herbalism {
|
||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||
break;
|
||||
case COCOA:
|
||||
try {
|
||||
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 3, DyeColor.BROWN.getDyeData()));
|
||||
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()));
|
||||
}
|
||||
catch(Exception e) {
|
||||
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 3, (short) 3));
|
||||
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, (short) 3));
|
||||
}
|
||||
break;
|
||||
case CARROT:
|
||||
Misc.dropItem(location, new ItemStack(Material.CARROT_ITEM));
|
||||
|
Loading…
Reference in New Issue
Block a user