Remove unnecessary item drop fiddling. closes #2175, #2126

This commit is contained in:
Vincent Lee committed 2017-03-04 14:51:02 -06:00
1 parent b044c98051
commit 20c6388ed3
3 files changed
+4 -15

No files matched your search

@@ -146,12 +146,9 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width));
for(EntityItem item : items) {
ItemStack itemstack = item.getEntityItem();
if(itemstack != null && itemstack.getItem() == Items.BUCKET && !world.isRemote) {
if(itemstack != null && itemstack.getItem() == Items.BUCKET) {
while(itemstack.stackSize > 0) {
EntityItem ent = entity.entityDropItem(new ItemStack(Items.MILK_BUCKET), 1.0F);
ent.motionY += world.rand.nextFloat() * 0.05F;
ent.motionX += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F;
ent.motionZ += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F;
entity.entityDropItem(new ItemStack(Items.MILK_BUCKET), 1.0F);
itemstack.stackSize--;
}
item.setDead();
@@ -68,12 +68,8 @@ public class ItemElementiumShears extends ItemManasteelShears {
if(target.isShearable(stack, entity.worldObj, new BlockPos(entity))) {
List<ItemStack> drops = target.onSheared(stack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack));
Random rand = new Random();
for(ItemStack drop : drops) {
EntityItem ent = entity.entityDropItem(drop, 1.0F);
ent.motionY += rand.nextFloat() * 0.05F;
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
entity.entityDropItem(drop, 1.0F);
}
ToolCommons.damageItem(stack, 1, living, MANA_PER_DAMAGE);
@@ -75,12 +75,8 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem, I
if(target.isShearable(itemstack, entity.worldObj, new BlockPos(entity))) {
List<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack));
Random rand = new Random();
for(ItemStack stack : drops) {
EntityItem ent = entity.entityDropItem(stack, 1.0F);
ent.motionY += rand.nextFloat() * 0.05F;
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
entity.entityDropItem(stack, 1.0F);
}
ToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE);