mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46: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;
|
break;
|
||||||
|
|
||||||
case SQUID:
|
case SQUID:
|
||||||
ItemStack item = new ItemStack(Material.INK_SACK, 1, (short) 0);
|
ItemStack item;
|
||||||
item.setData(new MaterialData(Material.INK_SACK, DyeColor.BLACK.getDyeData()));
|
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);
|
Misc.dropItem(location, item);
|
||||||
break;
|
break;
|
||||||
|
@ -269,8 +269,13 @@ public class Herbalism {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mat == Material.COCOA) {
|
if (mat == Material.COCOA) {
|
||||||
|
try {
|
||||||
is = new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData());
|
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) {
|
else if (mat == Material.CARROT) {
|
||||||
is = new ItemStack(Material.CARROT_ITEM, 1, (short) 0);
|
is = new ItemStack(Material.CARROT_ITEM, 1, (short) 0);
|
||||||
}
|
}
|
||||||
@ -422,7 +427,12 @@ public class Herbalism {
|
|||||||
break;
|
break;
|
||||||
case COCOA:
|
case COCOA:
|
||||||
// Broken: Requires an update to bukkit to enable seaching for variable-sized ItemStacks.
|
// 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);
|
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;
|
break;
|
||||||
case CARROT:
|
case CARROT:
|
||||||
hasSeeds = inventory.contains(Material.CARROT_ITEM);
|
hasSeeds = inventory.contains(Material.CARROT_ITEM);
|
||||||
@ -456,8 +466,14 @@ public class Herbalism {
|
|||||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||||
break;
|
break;
|
||||||
case COCOA:
|
case COCOA:
|
||||||
|
try {
|
||||||
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 3, DyeColor.BROWN.getDyeData()));
|
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 3, DyeColor.BROWN.getDyeData()));
|
||||||
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, 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;
|
break;
|
||||||
case CARROT:
|
case CARROT:
|
||||||
Misc.dropItem(location, new ItemStack(Material.CARROT_ITEM));
|
Misc.dropItem(location, new ItemStack(Material.CARROT_ITEM));
|
||||||
|
Loading…
Reference in New Issue
Block a user