mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Merge pull request #458 from Glitchfinder/master
Adding a bit more in the way of Dye-related backwards compatibility.
This commit is contained in:
commit
32e0be481a
@ -404,8 +404,13 @@ public class Fishing {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SQUID:
|
case SQUID:
|
||||||
ItemStack item = new ItemStack(Material.INK_SACK, 1);
|
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,7 +269,12 @@ public class Herbalism {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mat == Material.COCOA) {
|
if (mat == Material.COCOA) {
|
||||||
is = new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData());
|
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) {
|
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.
|
||||||
hasSeeds = inventory.contains(new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()), 1);
|
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;
|
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:
|
||||||
Misc.dropItem(location, new ItemStack(Material.INK_SACK, 3, DyeColor.BROWN.getDyeData()));
|
try {
|
||||||
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, 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()));
|
||||||
|
}
|
||||||
|
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