Java 类net.minecraftforge.common.FakePlayer 实例源码

项目:Ex-Aliquo    文件:AliquoEvents.java   
@ForgeSubscribe
public void onLivingDrops(LivingDropsEvent event)
{
    if (event.entityLiving == null)
    {
        return;
    }

    if (event.entityLiving instanceof EntityDragon)
    {
        if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer)
        {
            EntityPlayer player = (EntityPlayer) event.source.getEntity();
            if (!player.worldObj.isRemote)
            {
                EntityItem item = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, new ItemStack(Registries.dragonEgg, 1, 0));
                player.worldObj.spawnEntityInWorld(item);
                if (!(player instanceof FakePlayer))
                {
                    item.onCollideWithPlayer(player);
                }
            }
        }
    }
}
项目:Ars-Herbologica    文件:BlockHerbologicaBush.java   
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float j, float k, float l) {
    TileEntityBush te = (TileEntityBush)world.getBlockTileEntity(x, y, z);
    int meta = world.getBlockMetadata(x, y, z);

    if (te.growthStage >= 15)
    {
        if (world.isRemote) {
            return true;
        }

        te.grow(-3, world, x, y, z);
        EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(HerbologicaStuff.herbologicaBerry.itemID, 1, meta));
        world.spawnEntityInWorld(entityitem);
        if (!(player instanceof FakePlayer)) {
            entityitem.onCollideWithPlayer(player);
        }
        return true;
    }
    return false;
}
项目:Fuelsmod    文件:PlayerHandler.java   
public static void spawnItemAtPlayer(EntityPlayer player, ItemStack stack) {

        EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D,
                player.posY + 0.5D, player.posZ + 0.5D, stack);
        player.worldObj.spawnEntityInWorld(entityitem);
        if (!(player instanceof FakePlayer))
            entityitem.onCollideWithPlayer(player);
    }
项目:Kitchenmod    文件:BlockPearLeaves.java   
public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack)
{
    EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
    player.worldObj.spawnEntityInWorld(entityitem);
    if (!(player instanceof FakePlayer)){
        entityitem.onCollideWithPlayer(player);
    }
}
项目:Too-Many-Mods    文件:AbilityHelper.java   
public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack){
    EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
    player.worldObj.spawnEntityInWorld(entityitem);
    if (!(player instanceof FakePlayer)) entityitem.onCollideWithPlayer(player);
}