本文整理汇总了Java中net.minecraft.entity.boss.EntityDragon类的典型用法代码示例。如果您正苦于以下问题:Java EntityDragon类的具体用法?Java EntityDragon怎么用?Java EntityDragon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityDragon类属于net.minecraft.entity.boss包,在下文中一共展示了EntityDragon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dropClay
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
@SubscribeEvent
public void dropClay(LivingDropsEvent event) {
EntityLivingBase deadEntity = event.getEntityLiving();
World world = deadEntity.getEntityWorld();
BlockPos position = deadEntity.getPosition();
double x = position.getX();
double y = position.getY();
double z = position.getZ();
if (deadEntity instanceof EntityWitherSkeleton) {
if (world.rand.nextInt(10) == 5) {
event.getDrops().add(new EntityItem(world, x, y, z, new ItemStack(Items.CLAY_BALL)));
}
} else if (deadEntity instanceof EntityDragon || deadEntity instanceof EntityWither) {
event.getDrops().add(new EntityItem(world, x, y, z, new ItemStack(Items.CLAY_BALL)));
}
}
示例2: genDecorations
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
protected void genDecorations(BiomeGenBase biomeGenBaseIn)
{
this.generateOres();
if (this.randomGenerator.nextInt(5) == 0)
{
int i = this.randomGenerator.nextInt(16) + 8;
int j = this.randomGenerator.nextInt(16) + 8;
this.spikeGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j)));
}
if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0)
{
EntityDragon entitydragon = new EntityDragon(this.currentWorld);
entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F);
this.currentWorld.spawnEntityInWorld(entitydragon);
}
}
示例3: rotateCorpse
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
protected void rotateCorpse(EntityDragon bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
float f = (float)bat.getMovementOffsets(7, partialTicks)[0];
float f1 = (float)(bat.getMovementOffsets(5, partialTicks)[1] - bat.getMovementOffsets(10, partialTicks)[1]);
GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (bat.deathTime > 0)
{
float f2 = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
f2 = MathHelper.sqrt_float(f2);
if (f2 > 1.0F)
{
f2 = 1.0F;
}
GlStateManager.rotate(f2 * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
}
}
示例4: doRenderLayer
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
this.dragonRenderer.bindTexture(TEXTURE);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(1, 1);
GlStateManager.disableLighting();
GlStateManager.depthFunc(514);
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.depthFunc(515);
}
示例5: doRenderLayer
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.dragonRenderer.bindTexture(TEXTURE);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.disableLighting();
GlStateManager.depthFunc(514);
int i = 61680;
int j = 61680;
int k = 0;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.dragonRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.depthFunc(515);
}
示例6: processDragonDeath
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void processDragonDeath(EntityDragon dragon)
{
if (dragon.getUniqueID().equals(this.dragonUniqueId))
{
this.bossInfo.setPercent(0.0F);
this.bossInfo.setVisible(false);
this.generatePortal(true);
this.spawnNewGateway();
if (!this.previouslyKilled)
{
this.world.setBlockState(this.world.getHeight(WorldGenEndPodium.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.getDefaultState());
}
this.previouslyKilled = true;
this.dragonKilled = true;
}
}
示例7: onCrystalDestroyed
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void onCrystalDestroyed(EntityEnderCrystal crystal, DamageSource dmgSrc)
{
if (this.respawnState != null && this.crystals.contains(crystal))
{
LOGGER.debug("Aborting respawn sequence");
this.respawnState = null;
this.respawnStateTicks = 0;
this.resetSpikeCrystals();
this.generatePortal(true);
}
else
{
this.findAliveCrystals();
Entity entity = this.world.getEntityFromUuid(this.dragonUniqueId);
if (entity instanceof EntityDragon)
{
((EntityDragon)entity).onCrystalDestroyed(crystal, new BlockPos(crystal), dmgSrc);
}
}
}
示例8: setPhase
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void setPhase(PhaseList<?> phaseIn)
{
if (this.phase == null || phaseIn != this.phase.getPhaseList())
{
if (this.phase != null)
{
this.phase.removeAreaEffect();
}
this.phase = this.getPhase(phaseIn);
if (!this.dragon.world.isRemote)
{
this.dragon.getDataManager().set(EntityDragon.PHASE, Integer.valueOf(phaseIn.getId()));
}
LOGGER.debug("Dragon is now in phase {} on the {}", new Object[] {phaseIn, this.dragon.world.isRemote ? "client" : "server"});
this.phase.initPhase();
}
}
示例9: rotateCorpse
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
protected void rotateCorpse(EntityDragon entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
float f = (float)entityLiving.getMovementOffsets(7, partialTicks)[0];
float f1 = (float)(entityLiving.getMovementOffsets(5, partialTicks)[1] - entityLiving.getMovementOffsets(10, partialTicks)[1]);
GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (entityLiving.deathTime > 0)
{
float f2 = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
f2 = MathHelper.sqrt(f2);
if (f2 > 1.0F)
{
f2 = 1.0F;
}
GlStateManager.rotate(f2 * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
}
}
示例10: setPhase
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
public void setPhase(PhaseList<?> phaseIn)
{
if (this.phase == null || phaseIn != this.phase.getPhaseList())
{
if (this.phase != null)
{
this.phase.removeAreaEffect();
}
this.phase = this.getPhase(phaseIn);
if (!this.dragon.worldObj.isRemote)
{
this.dragon.getDataManager().set(EntityDragon.PHASE, Integer.valueOf(phaseIn.getId()));
}
LOGGER.debug("Dragon is now in phase {} on the {}", new Object[] {phaseIn, this.dragon.worldObj.isRemote ? "client" : "server"});
this.phase.initPhase();
}
}
示例11: rotateCorpse
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
protected void rotateCorpse(EntityDragon entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
float f = (float)entityLiving.getMovementOffsets(7, partialTicks)[0];
float f1 = (float)(entityLiving.getMovementOffsets(5, partialTicks)[1] - entityLiving.getMovementOffsets(10, partialTicks)[1]);
GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (entityLiving.deathTime > 0)
{
float f2 = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
f2 = MathHelper.sqrt_float(f2);
if (f2 > 1.0F)
{
f2 = 1.0F;
}
GlStateManager.rotate(f2 * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
}
}
示例12: isHostile
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
/**
* Checks if the specified entity is a hostile
*
* @param e The entity
* @return Whether or not the entity is a hostile
*/
public static boolean isHostile(Entity e) {
if (e instanceof EntityPigZombie)
return isAngry((EntityPigZombie) e);
if (e instanceof EntityIronGolem)
return isAngry((EntityIronGolem) e);
if (e instanceof EntityPolarBear)
return isAngry((EntityPolarBear) e);
if (e instanceof EntityMob)
return true;
if (e instanceof EntitySlime)
return true;
if (e instanceof EntityShulker)
return true;
if (e instanceof EntityGhast)
return true;
if (e instanceof EntityDragon)
return true;
return false;
}
示例13: initializeEntityActivationState
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
/**
* These entities are excluded from Activation range checks.
*
* @param entity
* @param world
* @return boolean If it should always tick.
*/
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
// Cauldron start - another fix for Proxy Worlds
if (config == null && DimensionManager.getWorld(0) != null)
{
config = DimensionManager.getWorld(0).spigotConfig;
}
else
{
return true;
}
// Cauldron end
if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
|| ( entity.activationType == 2 && config.animalActivationRange == 0 )
|| ( entity.activationType == 1 && config.monsterActivationRange == 0 )
|| (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
|| entity instanceof EntityThrowable
|| entity instanceof EntityDragon
|| entity instanceof EntityDragonPart
|| entity instanceof EntityWither
|| entity instanceof EntityFireball
|| entity instanceof EntityWeatherEffect
|| entity instanceof EntityTNTPrimed
|| entity instanceof EntityEnderCrystal
|| entity instanceof EntityFireworkRocket
|| entity instanceof EntityVillager
// Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
|| (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
&& !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
&& !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
{
return true;
}
return false;
}
示例14: renderModel
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
/**
* Renders the model in RenderLiving
*/
protected void renderModel(EntityDragon entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
if (entitylivingbaseIn.deathTicks > 0)
{
float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
GlStateManager.depthFunc(515);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, f);
this.bindTexture(enderDragonExplodingTextures);
this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.depthFunc(514);
}
this.bindEntityTexture(entitylivingbaseIn);
this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
if (entitylivingbaseIn.hurtTime > 0)
{
GlStateManager.depthFunc(514);
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.depthFunc(515);
}
}
示例15: doRender
import net.minecraft.entity.boss.EntityDragon; //导入依赖的package包/类
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
BossStatus.setBossStatus(entity, false);
super.doRender(entity, x, y, z, entityYaw, partialTicks);
if (entity.healingEnderCrystal != null)
{
this.drawRechargeRay(entity, x, y, z, partialTicks);
}
}