Skip to content

Commit

Permalink
Remove call to events, I don't think this code is getting called, bec…
Browse files Browse the repository at this point in the history
…ause if it did it would crash.
  • Loading branch information
AlgorithmX2 committed Dec 25, 2017
1 parent b61c77a commit 7e79d39
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/main/java/mod/chiselsandbits/items/ItemBitBag.java
Expand Up @@ -18,15 +18,13 @@
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
Expand Down Expand Up @@ -191,19 +189,24 @@ private boolean updateEntity(
{
if ( is == null )
{
is = new ItemStack( ei.getEntityItem().getItem(), 0 );
ei.setEntityItemStack( is );
ei.setDead();

net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent( player, ei );

if ( !ei.isSilent() )
{
ei.worldObj.playSound( (EntityPlayer) null, ei.posX, ei.posY, ei.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ( ( itemRand.nextFloat() - itemRand.nextFloat() ) * 0.7F + 1.0F ) * 2.0F );
}

player.onItemPickup( ei, originalSize );

// is = new ItemStack( ei.getEntityItem().getItem(), 0 );
// ei.setEntityItemStack( is );
// ei.setDead();
//
// net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(
// player, ei );
//
// if ( !ei.isSilent() )
// {
// ei.worldObj.playSound( (EntityPlayer) null, ei.posX, ei.posY,
// ei.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS,
// 0.2F, ( ( itemRand.nextFloat() - itemRand.nextFloat() ) * 0.7F +
// 1.0F ) * 2.0F );
// }
//
// player.onItemPickup( ei, originalSize );
//
return true;
}
else
Expand Down

0 comments on commit 7e79d39

Please sign in to comment.