Properly fixed the NPE in dropItem

It was due to bad logic in Herbalism
This commit is contained in:
bm01 2013-02-03 09:12:34 +01:00
parent 12faebca27
commit 6d871c9bdb
2 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ public class Herbalism {
if (chance > Misc.getRandom().nextInt(activationChance)) { if (chance > Misc.getRandom().nextInt(activationChance)) {
Location location = block.getLocation(); Location location = block.getLocation();
if (herbalismBlock != null && herbalismBlock.canDoubleDrop()) { if (dropItem != null && herbalismBlock.canDoubleDrop()) {
Misc.dropItems(location, dropItem, dropAmount); Misc.dropItems(location, dropItem, dropAmount);
} }
else if (customBlock != null){ else if (customBlock != null){

View File

@ -344,7 +344,7 @@ public final class Misc {
*/ */
public static void dropItem(Location location, ItemStack itemStack) { public static void dropItem(Location location, ItemStack itemStack) {
if (itemStack == null || itemStack.getType() == Material.AIR) { if (itemStack.getType() == Material.AIR) {
return; return;
} }