@Override
public void onCollideWithPlayer(EntityPlayer player)
{
if (!worldObj.isRemote)
{
EntityItemPickupEvent event = new EntityItemPickupEvent(player, this);
if (MinecraftForge.EVENT_BUS.post(event))
{
return;
}
int spawnerTeamID = spawner.getTeamID();
Team spawnerTeam = TeamsManager.getInstance().getTeam(spawnerTeamID);
Team playerTeam = PlayerHandler.getPlayerData(player).team;
if(spawnerTeam != null)
{
if(playerTeam != spawnerTeam)
return;
}
//Getter of EntityItem
int var2 = getEntityItem().stackSize;
if ((event.getResult() == Result.ALLOW || var2 <= 0 || player.inventory.addItemStackToInventory(getEntityItem())))
{
FMLCommonHandler.instance().firePlayerItemPickupEvent(player, this);
playSound("random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
player.onItemPickup(this, var2);