Java 类net.minecraft.world.end.DragonFightManager 实例源码

项目:justenoughdimensions    文件:CommandTeleportJED.java   
private void removeDragonBossBarHack(EntityPlayerMP player, WorldProviderEnd provider)
{
    // FIXME 1.9 - Somewhat ugly way to clear the Boss Info stuff when teleporting FROM The End
    DragonFightManager manager = provider.getDragonFightManager();

    if (manager != null)
    {
        try
        {
            BossInfoServer bossInfo = ReflectionHelper.getPrivateValue(DragonFightManager.class, manager, "field_186109_c", "bossInfo");
            if (bossInfo != null)
            {
                bossInfo.removePlayer(player);
            }
        }
        catch (UnableToAccessFieldException e)
        {
            JustEnoughDimensions.logger.warn("tpj: Failed to get DragonFightManager#bossInfo");
        }
    }
}
项目:enderutilities    文件:TeleportEntity.java   
private static void removeDragonBossBarHack(EntityPlayerMP player, WorldProviderEnd provider)
{
    // Somewhat ugly way to clear the Boss Info stuff when teleporting FROM The End
    DragonFightManager manager = provider.getDragonFightManager();

    if (manager != null)
    {
        try
        {
            BossInfoServer bossInfo = ReflectionHelper.getPrivateValue(DragonFightManager.class, manager, "field_186109_c", "bossInfo");

            if (bossInfo != null)
            {
                bossInfo.removePlayer(player);
            }
        }
        catch (UnableToAccessFieldException e)
        {
            EnderUtilities.logger.warn("TP: Failed to get DragonFightManager#bossInfo");
        }
    }
}
项目:Backmemed    文件:WorldProviderEnd.java   
/**
 * creates a new world chunk manager for WorldProvider
 */
public void createBiomeProvider()
{
    this.biomeProvider = new BiomeProviderSingle(Biomes.SKY);
    NBTTagCompound nbttagcompound = this.worldObj.getWorldInfo().getDimensionData(DimensionType.THE_END);
    this.dragonFightManager = this.worldObj instanceof WorldServer ? new DragonFightManager((WorldServer)this.worldObj, nbttagcompound.getCompoundTag("DragonFight")) : null;
}
项目:Backmemed    文件:EntityEnderCrystal.java   
private void onCrystalDestroyed(DamageSource source)
{
    if (this.world.provider instanceof WorldProviderEnd)
    {
        WorldProviderEnd worldproviderend = (WorldProviderEnd)this.world.provider;
        DragonFightManager dragonfightmanager = worldproviderend.getDragonFightManager();

        if (dragonfightmanager != null)
        {
            dragonfightmanager.onCrystalDestroyed(this, source);
        }
    }
}
项目:CustomWorldGen    文件:WorldProviderEnd.java   
/**
 * creates a new world chunk manager for WorldProvider
 */
public void createBiomeProvider()
{
    this.biomeProvider = new BiomeProviderSingle(Biomes.SKY);
    this.hasNoSky = true;
    NBTTagCompound nbttagcompound = this.worldObj.getWorldInfo().getDimensionData(DimensionType.THE_END);
    this.dragonFightManager = this.worldObj instanceof WorldServer ? new DragonFightManager((WorldServer)this.worldObj, nbttagcompound.getCompoundTag("DragonFight")) : null;
}
项目:CustomWorldGen    文件:EntityEnderCrystal.java   
private void onCrystalDestroyed(DamageSource source)
{
    if (this.worldObj.provider instanceof WorldProviderEnd)
    {
        WorldProviderEnd worldproviderend = (WorldProviderEnd)this.worldObj.provider;
        DragonFightManager dragonfightmanager = worldproviderend.getDragonFightManager();

        if (dragonfightmanager != null)
        {
            dragonfightmanager.onCrystalDestroyed(this, source);
        }
    }
}
项目:ExpandedRailsMod    文件:EntityEnderCrystal.java   
private void onCrystalDestroyed(DamageSource source)
{
    if (this.worldObj.provider instanceof WorldProviderEnd)
    {
        WorldProviderEnd worldproviderend = (WorldProviderEnd)this.worldObj.provider;
        DragonFightManager dragonfightmanager = worldproviderend.getDragonFightManager();

        if (dragonfightmanager != null)
        {
            dragonfightmanager.onCrystalDestroyed(this, source);
        }
    }
}
项目:Backmemed    文件:WorldProviderEnd.java   
@Nullable
public DragonFightManager getDragonFightManager()
{
    return this.dragonFightManager;
}
项目:Backmemed    文件:EntityDragon.java   
@Nullable
public DragonFightManager getFightManager()
{
    return this.fightManager;
}
项目:Backmemed    文件:ItemEndCrystal.java   
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(EntityPlayer stack, World playerIn, BlockPos worldIn, EnumHand pos, EnumFacing hand, float facing, float hitX, float hitY)
{
    IBlockState iblockstate = playerIn.getBlockState(worldIn);

    if (iblockstate.getBlock() != Blocks.OBSIDIAN && iblockstate.getBlock() != Blocks.BEDROCK)
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        BlockPos blockpos = worldIn.up();
        ItemStack itemstack = stack.getHeldItem(pos);

        if (!stack.canPlayerEdit(blockpos, hand, itemstack))
        {
            return EnumActionResult.FAIL;
        }
        else
        {
            BlockPos blockpos1 = blockpos.up();
            boolean flag = !playerIn.isAirBlock(blockpos) && !playerIn.getBlockState(blockpos).getBlock().isReplaceable(playerIn, blockpos);
            flag = flag | (!playerIn.isAirBlock(blockpos1) && !playerIn.getBlockState(blockpos1).getBlock().isReplaceable(playerIn, blockpos1));

            if (flag)
            {
                return EnumActionResult.FAIL;
            }
            else
            {
                double d0 = (double)blockpos.getX();
                double d1 = (double)blockpos.getY();
                double d2 = (double)blockpos.getZ();
                List<Entity> list = playerIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new AxisAlignedBB(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D));

                if (!list.isEmpty())
                {
                    return EnumActionResult.FAIL;
                }
                else
                {
                    if (!playerIn.isRemote)
                    {
                        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(playerIn, (double)((float)worldIn.getX() + 0.5F), (double)(worldIn.getY() + 1), (double)((float)worldIn.getZ() + 0.5F));
                        entityendercrystal.setShowBottom(false);
                        playerIn.spawnEntityInWorld(entityendercrystal);

                        if (playerIn.provider instanceof WorldProviderEnd)
                        {
                            DragonFightManager dragonfightmanager = ((WorldProviderEnd)playerIn.provider).getDragonFightManager();
                            dragonfightmanager.respawnDragon();
                        }
                    }

                    itemstack.func_190918_g(1);
                    return EnumActionResult.SUCCESS;
                }
            }
        }
    }
}
项目:CustomWorldGen    文件:WorldProviderEnd.java   
@Nullable
public DragonFightManager getDragonFightManager()
{
    return this.dragonFightManager;
}
项目:CustomWorldGen    文件:EntityDragon.java   
@Nullable
public DragonFightManager getFightManager()
{
    return this.fightManager;
}
项目:CustomWorldGen    文件:ItemEndCrystal.java   
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() != Blocks.OBSIDIAN && iblockstate.getBlock() != Blocks.BEDROCK)
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        BlockPos blockpos = pos.up();

        if (!playerIn.canPlayerEdit(blockpos, facing, stack))
        {
            return EnumActionResult.FAIL;
        }
        else
        {
            BlockPos blockpos1 = blockpos.up();
            boolean flag = !worldIn.isAirBlock(blockpos) && !worldIn.getBlockState(blockpos).getBlock().isReplaceable(worldIn, blockpos);
            flag = flag | (!worldIn.isAirBlock(blockpos1) && !worldIn.getBlockState(blockpos1).getBlock().isReplaceable(worldIn, blockpos1));

            if (flag)
            {
                return EnumActionResult.FAIL;
            }
            else
            {
                double d0 = (double)blockpos.getX();
                double d1 = (double)blockpos.getY();
                double d2 = (double)blockpos.getZ();
                List<Entity> list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new AxisAlignedBB(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D));

                if (!list.isEmpty())
                {
                    return EnumActionResult.FAIL;
                }
                else
                {
                    if (!worldIn.isRemote)
                    {
                        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(worldIn, (double)((float)pos.getX() + 0.5F), (double)(pos.getY() + 1), (double)((float)pos.getZ() + 0.5F));
                        entityendercrystal.setShowBottom(false);
                        worldIn.spawnEntityInWorld(entityendercrystal);

                        if (worldIn.provider instanceof WorldProviderEnd)
                        {
                            DragonFightManager dragonfightmanager = ((WorldProviderEnd)worldIn.provider).getDragonFightManager();
                            dragonfightmanager.respawnDragon();
                        }
                    }

                    --stack.stackSize;
                    return EnumActionResult.SUCCESS;
                }
            }
        }
    }
}
项目:ExpandedRailsMod    文件:EntityDragon.java   
@Nullable
public DragonFightManager getFightManager()
{
    return this.fightManager;
}
项目:ExpandedRailsMod    文件:ItemEndCrystal.java   
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() != Blocks.OBSIDIAN && iblockstate.getBlock() != Blocks.BEDROCK)
    {
        return EnumActionResult.FAIL;
    }
    else
    {
        BlockPos blockpos = pos.up();

        if (!playerIn.canPlayerEdit(blockpos, facing, stack))
        {
            return EnumActionResult.FAIL;
        }
        else
        {
            BlockPos blockpos1 = blockpos.up();
            boolean flag = !worldIn.isAirBlock(blockpos) && !worldIn.getBlockState(blockpos).getBlock().isReplaceable(worldIn, blockpos);
            flag = flag | (!worldIn.isAirBlock(blockpos1) && !worldIn.getBlockState(blockpos1).getBlock().isReplaceable(worldIn, blockpos1));

            if (flag)
            {
                return EnumActionResult.FAIL;
            }
            else
            {
                double d0 = (double)blockpos.getX();
                double d1 = (double)blockpos.getY();
                double d2 = (double)blockpos.getZ();
                List<Entity> list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new AxisAlignedBB(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D));

                if (!list.isEmpty())
                {
                    return EnumActionResult.FAIL;
                }
                else
                {
                    if (!worldIn.isRemote)
                    {
                        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(worldIn, (double)((float)pos.getX() + 0.5F), (double)(pos.getY() + 1), (double)((float)pos.getZ() + 0.5F));
                        entityendercrystal.setShowBottom(false);
                        worldIn.spawnEntityInWorld(entityendercrystal);

                        if (worldIn.provider instanceof WorldProviderEnd)
                        {
                            DragonFightManager dragonfightmanager = ((WorldProviderEnd)worldIn.provider).getDragonFightManager();
                            dragonfightmanager.respawnDragon();
                        }
                    }

                    --stack.stackSize;
                    return EnumActionResult.SUCCESS;
                }
            }
        }
    }
}