@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))); } }
public boolean breakBlocks(){ boolean flag = false; AxisAlignedBB box=this.getBreakingBB(); for (int x = MathHelper.floor(box.minX); x <= MathHelper.floor(box.maxX); ++x) for (int y = MathHelper.floor(box.minY); y <= MathHelper.floor(box.maxY); ++y) for (int z = MathHelper.floor(box.minZ); z <= MathHelper.floor(box.maxZ); ++z) { BlockPos blockpos = new BlockPos(x, y, z); IBlockState iblockstate = this.world.getBlockState(blockpos); Block block = iblockstate.getBlock(); if (!block.isAir(iblockstate, this.world, blockpos) && !iblockstate.getMaterial().isLiquid() && EntityWither.canDestroyBlock(block) && block.canEntityDestroy(iblockstate, world, blockpos, this)) flag = this.world.destroyBlock(blockpos, true) || flag; } if (flag) this.world.playEvent((EntityPlayer) null, 1022, new BlockPos(this), 0); return flag; }
@SubscribeEvent public void netherDrop(final LivingDropsEvent event) { if (ExtraUtils.divisionSigil != null && event.entityLiving instanceof EntityWither && event.source.getSourceOfDamage() instanceof EntityPlayer && event.entity.worldObj != null && event.entity.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { final EntityPlayer player = (EntityPlayer)event.source.getSourceOfDamage(); NBTTagCompound t = new NBTTagCompound(); if (player.getEntityData().hasKey("PlayerPersisted")) { t = player.getEntityData().getCompoundTag("PlayerPersisted"); } else { player.getEntityData().setTag("PlayerPersisted", (NBTBase)t); } int kills = 0; if (t.hasKey("witherKills")) { kills = t.getInteger("witherKills"); } ++kills; t.setInteger("witherKills", kills); if (kills == 1 || !t.hasKey("hasSigil") || event.entity.worldObj.rand.nextInt(10) == 0) { final ItemStack item = new ItemStack(ExtraUtils.divisionSigil); final EntityItem entityitem = new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, item); entityitem.delayBeforeCanPickup = 10; event.drops.add(entityitem); } } }
@SubscribeEvent public void onEntityDropLoot(LivingDropsEvent event) { if (event.getSource() instanceof EntityDamageSource) { EntityLivingBase entity = event.getEntityLiving(); EntityDamageSource source = (EntityDamageSource) event.getSource(); if (source.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) source.getEntity(); ItemStack currentItem = player.inventory.getCurrentItem(); if (currentItem != null && currentItem.getItem() instanceof ItemSkyrootSword && !(entity instanceof EntityPlayer) && !(entity instanceof EntityWither)) { for (EntityItem items : event.getDrops()) { EntityItem item = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, items.getEntityItem()); entity.worldObj.spawnEntityInWorld(item); } } } } }
@SubscribeEvent @SuppressWarnings("unused") public void onWitherDeath(LivingDropsEvent event) { if(ItemRegistry.getInstance().itemRecord == null) { return; } if(!(event.getEntity() instanceof EntityWither)) { return; } Entity killer = event.getSource().getSourceOfDamage(); if(event.isRecentlyHit() && killer != null && killer instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) killer; ItemStack left = player.getHeldItem(EnumHand.MAIN_HAND); ItemStack right = player.getHeldItem(EnumHand.OFF_HAND); if(isValidStack(left) && isValidStack(right)) { EntityItem drop = new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY+0.5D, event.getEntity().posZ, new ItemStack(ItemRegistry.getInstance().itemRecord)); event.getDrops().add(drop); } } }
private void makeMobRebornTransition(LivingDropsEvent event) { if (ConfigValues.ALLOWBOSSES) { if (event.getEntityLiving() instanceof EntityWither || event.getEntityLiving() instanceof EntityDragon) { makeMobReborn(event); return; } } else if (event.getEntityLiving() instanceof EntityWither || event.getEntityLiving() instanceof EntityDragon) return; if (ConfigValues.ALLOWSLIMES) { if (event.getEntityLiving() instanceof EntitySlime) { makeMobReborn(event); return; } } else if (event.getEntityLiving() instanceof EntitySlime) return; if (ConfigValues.VANILLAONLY) { if (isVanilla(event.getEntityLiving())) { makeMobReborn(event); } } else { makeMobReborn(event); } }
@SubscribeEvent public void onSpawnMob(EntityJoinWorldEvent event) { if(!event.world.isRemote) { if (event.entity != null && event.entity.getClass() == EntityWither.class) { EntityWither theWither = (EntityWither)event.entity; if( !powerUpManager.isWitherPoweredUp(theWither) ) { List nearbyPlayers = theWither.worldObj.getEntitiesWithinAABB(EntityPlayer.class, theWither.boundingBox.expand(64.0D, 64.0D, 64.0D)); double powerUpSize = 0.0; for (int index = 0; index < nearbyPlayers.size(); ++index) { EntityPlayer player = (EntityPlayer)nearbyPlayers.get(index); powerUpSize += playerHandler.wasAtWitherSpawn(player); } powerUpManager.powerUpWither( theWither, (int)Math.round(powerUpSize)); } } } }
@SubscribeEvent public void onEntityDieing(LivingDeathEvent event) { if(!event.entity.worldObj.isRemote) { if (event.entityLiving != null && event.entityLiving.getClass() == EntityWither.class) { List nearbyPlayers = event.entity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, event.entity.boundingBox.expand(64.0D, 64.0D, 64.0D)); double powerUpSize = 0.0; for (int index = 0; index < nearbyPlayers.size(); ++index) { EntityPlayer player = (EntityPlayer)nearbyPlayers.get(index); powerUpSize += playerHandler.wasAtWitherSpawn(player); player.addChatMessage(new ChatComponentText(TextHelper.localize("info." + ModInformation.ID + ".chat.wither-experience"))); } powerUpManager.witherDied((EntityWither) event.entityLiving); } } }
public void update(EntityWither wither) { if(!usedPowerUps.containsKey(wither.getUniqueID())) {} else { // Iterate through the powerups for this Wither Iterator iter = usedPowerUps.get(wither.getUniqueID()).values().iterator(); while(iter.hasNext()) { IPowerUp powerUp = (IPowerUp)iter.next(); { powerUp.updateWither(); } } } }
public void witherDied(EntityWither wither) { if(!usedPowerUps.containsKey(wither.getUniqueID())) {} else { // Iterate through the powerups for this Wither Iterator iter = usedPowerUps.get(wither.getUniqueID()).values().iterator(); while(iter.hasNext()) { IPowerUp powerUp = (IPowerUp)iter.next(); { powerUp.witherDied(); } } usedPowerUps.remove(wither.getUniqueID()); } }
/** * Loads the Power Up data for a Wither from NBT * @param wither * @param nbt * @pre the wither is not already in usedPowerUps * @post the Power Up map for this Wither in usedPowerUps contains the IPowerUps from NBT */ private void loadWitherFromNBT(EntityWither wither, NBTTagCompound nbt) { usedPowerUps.put(wither.getUniqueID(), new HashMap<String, IPowerUp>()); Set powerUpTags = nbt.func_150296_c(); Iterator powerUpIter = powerUpTags.iterator(); while (powerUpIter.hasNext()) { String powerUpName = (String)powerUpIter.next(); try { if(powerUpPrototypes.containsKey(powerUpName)) { NBTTagCompound powerUpNbt = (NBTTagCompound) nbt.getTag(powerUpName); IPowerUp powerUp = powerUpPrototypes.get(powerUpName).createPowerUp(wither); powerUp.readFromNBT(powerUpNbt); usedPowerUps.get(wither.getUniqueID()).put(powerUpName, powerUp); } } catch (Exception ex) { HardcoreWither.logger.warn("Attempting to powerup from save with unknown powerup: " + powerUpName + "\n\t" + ex); } } }
@SubscribeEvent public void onEntityKill(LivingDropsEvent event){ if(event.entityLiving instanceof EntitySkeleton){ if(((EntitySkeleton) event.entityLiving).getSkeletonType() == 1){ if(Math.round(Marble.rand.nextFloat() * 100) < ConfigHandler.witherOneDropChance){ MiscHelper.drop(event, Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(ConfigHandler.witheringID, 1))); } } } if(event.entityLiving instanceof EntityWither){ if(Math.round(Marble.rand.nextInt()) < ConfigHandler.witherTwoDropChance){ MiscHelper.drop(event, Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(ConfigHandler.witheringID, 2))); } } }
@SubscribeEvent public void livingKilled(LivingDeathEvent event) { Entity killer = event.source.getEntity(); EntityLivingBase target = event.entityLiving; if (isServer() && killer != null && killer instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) killer; if (target instanceof EntityWither) { DiscoveryManager.unlockItem(QADiscoveries.Item.STAR.get().getKey(), player, false); } else if (target instanceof EntityZombie) { ItemStack equip = ((EntityZombie) target).getEquipmentInSlot(0); if (equip != null && equip.getItem() instanceof ItemSword) DiscoveryManager.unlockItem(QADiscoveries.Item.SWORD.get().getKey(), player, false); } else if (target instanceof EntityBlaze) { DiscoveryManager.unlockItem(QADiscoveries.Item.TOOLS.get().getKey(), player, false); } } }
public EntityArcher(World p_i1683_1_) { super(p_i1683_1_); this.goldNeededToTame += this.rand.nextInt(15); int taskPriority = 0; this.tasks.addTask(++taskPriority, new EntityAISwimming(this)); this.tasks.addTask(++taskPriority, new EntityAIDefensiveArrowAttack(this, 20, 40, 15.0F, 10.0F)); this.tasks.addTask(++taskPriority, new EntityAIFollowOwner(this, 1.0D, 10.0F, 4.0F)); this.tasks.addTask(++taskPriority, new EntityAIWander(this, 1.0D)); this.tasks.addTask(++taskPriority, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(++taskPriority, new EntityAILookIdle(this)); int targetPriority = 0; this.targetTasks.addTask(++targetPriority, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(++targetPriority, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(++targetPriority, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityCreeper.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityZombie.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntitySkeleton.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntitySpider.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityCaveSpider.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityBlaze.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityGhast.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityWither.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityDragon.class, 0, true)); }
public EntityWarrior(World p_i1683_1_) { super(p_i1683_1_); this.goldNeededToTame += this.rand.nextInt(10); int taskPriority = 0; this.tasks.addTask(++taskPriority, new EntityAISwimming(this)); this.tasks.addTask(++taskPriority, new EntityAIAvoidEntity(this, EntityCreeper.class, 4.0F, 1.0D, 1.2D)); this.tasks.addTask(++taskPriority, new EntityAIAttackOnCollide(this, 1.0D, false)); this.tasks.addTask(++taskPriority, new EntityAIFollowOwner(this, 1.0D, 10.0F, 3.0F)); this.tasks.addTask(++taskPriority, new EntityAIWander(this, 1.0D)); this.tasks.addTask(++taskPriority, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(++taskPriority, new EntityAILookIdle(this)); int targetPriority = 0; this.targetTasks.addTask(++targetPriority, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(++targetPriority, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(++targetPriority, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityZombie.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntitySkeleton.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntitySpider.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityCaveSpider.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityBlaze.class, 0, true)); this.targetTasks.addTask(++targetPriority, new EntityAITamedNearestAttackableTarget(this, EntityWither.class, 0, true)); }
/** * Determines if this block is can be destroyed by the specified entities normal behavior. */ @Override public boolean canEntityDestroy(IBlockAccess blockAccess, int x, int y, int z, Entity entity) { TEBase TE = getTileEntity(blockAccess, x, y, z); if (BlockProperties.hasAttribute(TE, TE.ATTR_COVER[6])) { Block block = BlockProperties.toBlock(BlockProperties.getCover(TE, 6)); if (entity instanceof EntityWither) { return !block.equals(Blocks.bedrock) && !block.equals(Blocks.end_portal) && !block.equals(Blocks.end_portal_frame) && !block.equals(Blocks.command_block); } else if (entity instanceof EntityDragon) { return !block.equals(Blocks.obsidian) && !block.equals(Blocks.end_stone) && !block.equals(Blocks.bedrock); } } return super.canEntityDestroy(blockAccess, x, y, z, entity); }
public static boolean entityUndeadCheck(MovingObjectPosition movObjPos) { boolean result = false; if ((movObjPos.entityHit instanceof EntityZombie)) { result = true; } if ((movObjPos.entityHit instanceof EntitySkeleton)) { result = true; } if ((movObjPos.entityHit instanceof EntityPigZombie)) { result = true; } if ((!(movObjPos.entityHit instanceof EntityBlaze)) || ((!(movObjPos.entityHit instanceof EntityWitherSkull)) || ((!(movObjPos.entityHit instanceof EntityWither)) || ((movObjPos.entityHit instanceof EntityGhast))))) ; return result; }
@Override public float[] getHeadJointOffset(EntityWither living, float partialTick, int eye) { if(eye <= 1) { return super.getHeadJointOffset(living, partialTick, eye); } else if(eye <= 3) { return headJointSideHeadLeft; } else { return headJointSideHeadRight; } }
/** * 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; }
@Override public void onFinish(EntityPlayer player, IRitualHandler tile, World world, BlockPos pos, NBTTagCompound data) { if (!world.isRemote) { EntityWither entitywither = new EntityWither(world); BlockPos blockpos1 = pos.add(0, 0, 0); entitywither.setLocationAndAngles(blockpos1.getX() + 0.5D, blockpos1.getY() + 0.55D, blockpos1.getZ() + 0.5D, 0F, 0F); for (EntityPlayerMP entityplayermp : world.getEntitiesWithinAABB(EntityPlayerMP.class, entitywither.getEntityBoundingBox().grow(50.0D))) { CriteriaTriggers.SUMMONED_ENTITY.trigger(entityplayermp, entitywither); } world.spawnEntity(entitywither); entitywither.ignite(); } }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); Block block = blockStateIn.getBlock(); if (this.isInvulnerable() && EntityWither.func_181033_a(block)) { f = Math.min(0.8F, f); } return f; }
/** * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime) { float f = 2.0F; int i = entitylivingbaseIn.getInvulTime(); if (i > 0) { f -= ((float)i - partialTickTime) / 220.0F * 0.5F; } GlStateManager.scale(f, f, f); }
public void doRenderLayer(EntityWither 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) { if (entitylivingbaseIn.isArmored()) { GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); this.witherRenderer.bindTexture(WITHER_ARMOR); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; float f1 = MathHelper.cos(f * 0.02F) * 3.0F; float f2 = f * 0.01F; GlStateManager.translate(f1, f2, 0.0F); GlStateManager.matrixMode(5888); GlStateManager.enableBlend(); float f3 = 0.5F; GlStateManager.color(f3, f3, f3, 1.0F); GlStateManager.disableLighting(); GlStateManager.blendFunc(1, 1); this.witherModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks); this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); this.witherModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); GlStateManager.matrixMode(5888); GlStateManager.enableLighting(); GlStateManager.disableBlend(); } }
/** * Used for easily adding entity-dependent animations. The second and third float params here are the same second * and third as in the setRotationAngles method. */ public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) { EntityWither entitywither = (EntityWither)entitylivingbaseIn; for (int i = 1; i < 3; ++i) { this.field_82904_b[i].rotateAngleY = (entitywither.func_82207_a(i - 1) - entitylivingbaseIn.renderYawOffset) / (180F / (float)Math.PI); this.field_82904_b[i].rotateAngleX = entitywither.func_82210_r(i - 1) / (180F / (float)Math.PI); } }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); Block block = blockStateIn.getBlock(); if (this.isInvulnerable() && EntityWither.canDestroyBlock(block)) { f = Math.min(0.8F, f); } return f; }
/** * Allows the render to do state modifications necessary before the model is rendered. */ protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime) { float f = 2.0F; int i = entitylivingbaseIn.getInvulTime(); if (i > 0) { f -= ((float)i - partialTickTime) / 220.0F * 0.5F; } GlStateManager.scale(f, f, f); }
public void doRenderLayer(EntityWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (entitylivingbaseIn.isArmored()) { GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); this.witherRenderer.bindTexture(WITHER_ARMOR); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; float f1 = MathHelper.cos(f * 0.02F) * 3.0F; float f2 = f * 0.01F; GlStateManager.translate(f1, f2, 0.0F); GlStateManager.matrixMode(5888); GlStateManager.enableBlend(); float f3 = 0.5F; GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F); GlStateManager.disableLighting(); GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); Minecraft.getMinecraft().entityRenderer.func_191514_d(true); this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); Minecraft.getMinecraft().entityRenderer.func_191514_d(false); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); GlStateManager.matrixMode(5888); GlStateManager.enableLighting(); GlStateManager.disableBlend(); } }
/** * Used for easily adding entity-dependent animations. The second and third float params here are the same second * and third as in the setRotationAngles method. */ public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) { EntityWither entitywither = (EntityWither)entitylivingbaseIn; for (int i = 1; i < 3; ++i) { this.heads[i].rotateAngleY = (entitywither.getHeadYRotation(i - 1) - entitylivingbaseIn.renderYawOffset) * 0.017453292F; this.heads[i].rotateAngleX = entitywither.getHeadXRotation(i - 1) * 0.017453292F; } }
public void doRenderLayer(EntityWither entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (entitylivingbaseIn.isArmored()) { GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); this.witherRenderer.bindTexture(WITHER_ARMOR); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; float f1 = MathHelper.cos(f * 0.02F) * 3.0F; float f2 = f * 0.01F; GlStateManager.translate(f1, f2, 0.0F); GlStateManager.matrixMode(5888); GlStateManager.enableBlend(); float f3 = 0.5F; GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F); GlStateManager.disableLighting(); GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); this.witherModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); this.witherModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); GlStateManager.matrixMode(5890); GlStateManager.loadIdentity(); GlStateManager.matrixMode(5888); GlStateManager.enableLighting(); GlStateManager.disableBlend(); } }