@Override public void setLivingAnimations(@Nonnull EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { EntityMagmaCube entitymagmacube = (EntityMagmaCube) p_78086_1_; float f3 = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * p_78086_4_; int size = entitymagmacube.getSlimeSize(); if (f3 < 0.0F) { f3 = 0.0F; } if (size > 1) { int i = (p_78086_1_.ticksExisted >> 2) % 8; coreRenderer = coreRenderers[i]; } else { coreRenderer = coreRendererClay; } coreRenderer.rotationPointY = f3 * 1.7F; for (int i = 0; i < this.sliceRenderers.length; ++i) { this.sliceRenderers[i].rotationPointY = (-(4 - i)) * f3 * 1.7F; } }
@Override protected void setSize(float p_70105_1_, float p_70105_2_) { int i = this.getSlimeSize(); super.setSize(i, i); }
@Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE); }
@Override public void onDeath(@Nonnull DamageSource damageSource) { super.onDeath(damageSource); if (!world.isRemote && damageSource.getTrueSource() instanceof EntityPlayer) { SlimeConf nextConf = SlimeConf.getConfForSize(getSlimeSize()).bigger(); if (nextConf != null && world.rand.nextFloat() <= nextConf.getChance()) { EntityDireSlime spawn = new EntityDireSlime(world); spawn.setSlimeSize(nextConf.size, true); spawn.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0); spawn.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(this)), null); if (SpawnUtil.isSpaceAvailableForSpawn(world, spawn, false)) { world.spawnEntity(spawn); } } } }
@Override public void setSlimeSize(int size, boolean doFullHeal) { super.setSlimeSize(size, doFullHeal); SlimeConf conf = SlimeConf.getConfForSize(size); getAttributeMap().getAttributeInstance(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(conf.getAttackDamage()); getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(conf.getHealth()); setHealth(getMaxHealth()); }