diff --git a/src/main/java/biomesoplenty/common/blocks/BlockHive.java b/src/main/java/biomesoplenty/common/blocks/BlockHive.java index ff9e188ab..e0831dfea 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockHive.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockHive.java @@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import biomesoplenty.BiomesOPlenty; +import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.api.content.BOPCItems; import biomesoplenty.common.entities.EntityWasp; @@ -39,7 +40,7 @@ public class BlockHive extends Block //TODO: breakBlock() public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - if (world.getBlockMetadata(x, y, z) == 2) + if (world.getBlockMetadata(x, y, z) == 2 && BOPConfigurationIDs.waspID > 0) { EntityWasp wasp = new EntityWasp(world); wasp.setLocationAndAngles((double)x + 0.6, (double)y, (double)z + 0.3, 0.0F, 0.0F); @@ -137,4 +138,4 @@ public class BlockHive extends Block return 1; } -} \ No newline at end of file +} diff --git a/src/main/java/biomesoplenty/common/items/ItemJarFilled.java b/src/main/java/biomesoplenty/common/items/ItemJarFilled.java index 1bbdce112..6d211d9c9 100644 --- a/src/main/java/biomesoplenty/common/items/ItemJarFilled.java +++ b/src/main/java/biomesoplenty/common/items/ItemJarFilled.java @@ -17,6 +17,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import biomesoplenty.BiomesOPlenty; import biomesoplenty.api.content.BOPCItems; +import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.common.entities.EntityPixie; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -81,7 +82,7 @@ public class ItemJarFilled extends Item @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int side, float xoffset, float yoffset, float zoffset) { - if (itemStack.getItemDamage() == 2) + if (itemStack.getItemDamage() == 2 && BOPConfigurationIDs.pixieID > 0) { if (entityPlayer.dimension == 0) { @@ -116,14 +117,16 @@ public class ItemJarFilled extends Item { --itemStack.stackSize; - if (itemStack.stackSize <= 0) + if (itemStack.stackSize > 0) { - itemStack = new ItemStack(BOPCItems.jarEmpty, 1, 0); + if (!entityPlayer.inventory.addItemStackToInventory(new ItemStack(BOPCItems.jarEmpty, 1, 0))) + { + entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(BOPCItems.jarEmpty, 1, 0), false); + } } - - if (!entityPlayer.inventory.addItemStackToInventory(new ItemStack(BOPCItems.jarEmpty, 1, 0))) + else { - entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(BOPCItems.jarEmpty, 1, 0), false); + entityPlayer.setCurrentItemOrArmor(0, new ItemStack(BOPCItems.jarEmpty, 1, 0); } }