use of net.minecraft.entity.monster.EntityGuardian in project CumServerPro by MCUmbrella.
the class NetHandlerPlayClient method handleEntityStatus.
public void handleEntityStatus(SPacketEntityStatus packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null) {
if (packetIn.getOpCode() == 21) {
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
} else if (packetIn.getOpCode() == 35) {
int i = 40;
this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.ITEM_TOTEM_USE, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player) {
this.gameController.entityRenderer.displayItemActivation(new ItemStack(Items.TOTEM_OF_UNDYING));
}
} else {
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
use of net.minecraft.entity.monster.EntityGuardian in project CumServerPro by MCUmbrella.
the class ModelGuardian method setRotationAngles.
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
EntityGuardian entityguardian = (EntityGuardian) entityIn;
float f = ageInTicks - (float) entityguardian.ticksExisted;
this.guardianBody.rotateAngleY = netHeadYaw * 0.017453292F;
this.guardianBody.rotateAngleX = headPitch * 0.017453292F;
float[] afloat = new float[] { 1.75F, 0.25F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 0.5F, 1.25F, 0.75F, 0.0F, 0.0F };
float[] afloat1 = new float[] { 0.0F, 0.0F, 0.0F, 0.0F, 0.25F, 1.75F, 1.25F, 0.75F, 0.0F, 0.0F, 0.0F, 0.0F };
float[] afloat2 = new float[] { 0.0F, 0.0F, 0.25F, 1.75F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.75F, 1.25F };
float[] afloat3 = new float[] { 0.0F, 0.0F, 8.0F, -8.0F, -8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F, 8.0F, -8.0F };
float[] afloat4 = new float[] { -8.0F, -8.0F, -8.0F, -8.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 8.0F, 8.0F };
float[] afloat5 = new float[] { 8.0F, -8.0F, 0.0F, 0.0F, -8.0F, -8.0F, 8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F };
float f1 = (1.0F - entityguardian.getSpikesAnimation(f)) * 0.55F;
for (int i = 0; i < 12; ++i) {
this.guardianSpines[i].rotateAngleX = (float) Math.PI * afloat[i];
this.guardianSpines[i].rotateAngleY = (float) Math.PI * afloat1[i];
this.guardianSpines[i].rotateAngleZ = (float) Math.PI * afloat2[i];
this.guardianSpines[i].rotationPointX = afloat3[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
this.guardianSpines[i].rotationPointY = 16.0F + afloat4[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
this.guardianSpines[i].rotationPointZ = afloat5[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
}
this.guardianEye.rotationPointZ = -8.25F;
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (entityguardian.hasTargetedEntity()) {
entity = entityguardian.getTargetedEntity();
}
if (entity != null) {
Vec3d vec3d = entity.getPositionEyes(0.0F);
Vec3d vec3d1 = entityIn.getPositionEyes(0.0F);
double d0 = vec3d.y - vec3d1.y;
if (d0 > 0.0D) {
this.guardianEye.rotationPointY = 0.0F;
} else {
this.guardianEye.rotationPointY = 1.0F;
}
Vec3d vec3d2 = entityIn.getLook(0.0F);
vec3d2 = new Vec3d(vec3d2.x, 0.0D, vec3d2.z);
Vec3d vec3d3 = (new Vec3d(vec3d1.x - vec3d.x, 0.0D, vec3d1.z - vec3d.z)).normalize().rotateYaw(((float) Math.PI / 2F));
double d1 = vec3d2.dotProduct(vec3d3);
this.guardianEye.rotationPointX = MathHelper.sqrt((float) Math.abs(d1)) * 2.0F * (float) Math.signum(d1);
}
this.guardianEye.showModel = true;
float f2 = entityguardian.getTailAnimation(f);
this.guardianTail[0].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.05F;
this.guardianTail[1].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.1F;
this.guardianTail[1].rotationPointX = -1.5F;
this.guardianTail[1].rotationPointY = 0.5F;
this.guardianTail[1].rotationPointZ = 14.0F;
this.guardianTail[2].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.15F;
this.guardianTail[2].rotationPointX = 0.5F;
this.guardianTail[2].rotationPointY = 0.5F;
this.guardianTail[2].rotationPointZ = 6.0F;
}
use of net.minecraft.entity.monster.EntityGuardian in project CumServerPro by MCUmbrella.
the class CraftWorld method createEntity.
@SuppressWarnings("unchecked")
public net.minecraft.entity.Entity createEntity(Location location, Class<? extends Entity> clazz) throws IllegalArgumentException {
if (location == null || clazz == null) {
throw new IllegalArgumentException("Location or entity class cannot be null");
}
net.minecraft.entity.Entity entity = null;
double x = location.getX();
double y = location.getY();
double z = location.getZ();
float pitch = location.getPitch();
float yaw = location.getYaw();
// order is important for some of these
if (Boat.class.isAssignableFrom(clazz)) {
entity = new EntityBoat(world, x, y, z);
entity.setLocationAndAngles(x, y, z, yaw, pitch);
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
entity = new EntityFallingBlock(world, x, y, z, world.getBlockState(new BlockPos(x, y, z)));
} else if (Projectile.class.isAssignableFrom(clazz)) {
if (Snowball.class.isAssignableFrom(clazz)) {
entity = new EntitySnowball(world, x, y, z);
} else if (Egg.class.isAssignableFrom(clazz)) {
entity = new EntityEgg(world, x, y, z);
} else if (Arrow.class.isAssignableFrom(clazz)) {
if (TippedArrow.class.isAssignableFrom(clazz)) {
entity = new EntityTippedArrow(world);
((EntityTippedArrow) entity).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false)));
} else if (SpectralArrow.class.isAssignableFrom(clazz)) {
entity = new EntitySpectralArrow(world);
} else {
entity = new EntityTippedArrow(world);
}
entity.setLocationAndAngles(x, y, z, 0, 0);
} else if (ThrownExpBottle.class.isAssignableFrom(clazz)) {
entity = new EntityExpBottle(world);
entity.setLocationAndAngles(x, y, z, 0, 0);
} else if (EnderPearl.class.isAssignableFrom(clazz)) {
entity = new EntityEnderPearl(world);
entity.setLocationAndAngles(x, y, z, 0, 0);
} else if (ThrownPotion.class.isAssignableFrom(clazz)) {
if (LingeringPotion.class.isAssignableFrom(clazz)) {
entity = new EntityPotion(world, x, y, z, CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.LINGERING_POTION, 1)));
} else {
entity = new EntityPotion(world, x, y, z, CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.SPLASH_POTION, 1)));
}
} else if (Fireball.class.isAssignableFrom(clazz)) {
if (SmallFireball.class.isAssignableFrom(clazz)) {
entity = new EntitySmallFireball(world);
} else if (WitherSkull.class.isAssignableFrom(clazz)) {
entity = new EntityWitherSkull(world);
} else if (DragonFireball.class.isAssignableFrom(clazz)) {
entity = new EntityDragonFireball(world);
} else {
entity = new EntityLargeFireball(world);
}
entity.setLocationAndAngles(x, y, z, yaw, pitch);
Vector direction = location.getDirection().multiply(10);
((EntityFireball) entity).setDirection(direction.getX(), direction.getY(), direction.getZ());
} else if (ShulkerBullet.class.isAssignableFrom(clazz)) {
entity = new EntityShulkerBullet(world);
entity.setLocationAndAngles(x, y, z, yaw, pitch);
} else if (LlamaSpit.class.isAssignableFrom(clazz)) {
entity = new EntityLlamaSpit(world);
entity.setLocationAndAngles(x, y, z, yaw, pitch);
}
} else if (Minecart.class.isAssignableFrom(clazz)) {
if (PoweredMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartFurnace(world, x, y, z);
} else if (StorageMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartChest(world, x, y, z);
} else if (ExplosiveMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartTNT(world, x, y, z);
} else if (HopperMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartHopper(world, x, y, z);
} else if (SpawnerMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartMobSpawner(world, x, y, z);
} else if (CommandMinecart.class.isAssignableFrom(clazz)) {
entity = new EntityMinecartCommandBlock(world, x, y, z);
} else {
// Default to rideable minecart for pre-rideable compatibility
entity = new EntityMinecartEmpty(world, x, y, z);
}
} else if (EnderSignal.class.isAssignableFrom(clazz)) {
entity = new EntityEnderEye(world, x, y, z);
} else if (EnderCrystal.class.isAssignableFrom(clazz)) {
entity = new EntityEnderCrystal(world);
entity.setLocationAndAngles(x, y, z, 0, 0);
} else if (LivingEntity.class.isAssignableFrom(clazz)) {
if (Chicken.class.isAssignableFrom(clazz)) {
entity = new EntityChicken(world);
} else if (Cow.class.isAssignableFrom(clazz)) {
if (MushroomCow.class.isAssignableFrom(clazz)) {
entity = new EntityMooshroom(world);
} else {
entity = new EntityCow(world);
}
} else if (Golem.class.isAssignableFrom(clazz)) {
if (Snowman.class.isAssignableFrom(clazz)) {
entity = new EntitySnowman(world);
} else if (IronGolem.class.isAssignableFrom(clazz)) {
entity = new EntityIronGolem(world);
} else if (Shulker.class.isAssignableFrom(clazz)) {
entity = new EntityShulker(world);
}
} else if (Creeper.class.isAssignableFrom(clazz)) {
entity = new EntityCreeper(world);
} else if (Ghast.class.isAssignableFrom(clazz)) {
entity = new EntityGhast(world);
} else if (Pig.class.isAssignableFrom(clazz)) {
entity = new EntityPig(world);
} else if (Player.class.isAssignableFrom(clazz)) {
// need a net server handler for this one
} else if (Sheep.class.isAssignableFrom(clazz)) {
entity = new EntitySheep(world);
} else if (AbstractHorse.class.isAssignableFrom(clazz)) {
if (ChestedHorse.class.isAssignableFrom(clazz)) {
if (Donkey.class.isAssignableFrom(clazz)) {
entity = new EntityDonkey(world);
} else if (Mule.class.isAssignableFrom(clazz)) {
entity = new EntityMule(world);
} else if (Llama.class.isAssignableFrom(clazz)) {
entity = new EntityLlama(world);
}
} else if (SkeletonHorse.class.isAssignableFrom(clazz)) {
entity = new EntitySkeletonHorse(world);
} else if (ZombieHorse.class.isAssignableFrom(clazz)) {
entity = new EntityZombieHorse(world);
} else {
entity = new EntityHorse(world);
}
} else if (Skeleton.class.isAssignableFrom(clazz)) {
if (Stray.class.isAssignableFrom(clazz)) {
entity = new EntityStray(world);
} else if (WitherSkeleton.class.isAssignableFrom(clazz)) {
entity = new EntityWitherSkeleton(world);
} else {
entity = new EntitySkeleton(world);
}
} else if (Slime.class.isAssignableFrom(clazz)) {
if (MagmaCube.class.isAssignableFrom(clazz)) {
entity = new EntityMagmaCube(world);
} else {
entity = new EntitySlime(world);
}
} else if (Spider.class.isAssignableFrom(clazz)) {
if (CaveSpider.class.isAssignableFrom(clazz)) {
entity = new EntityCaveSpider(world);
} else {
entity = new EntitySpider(world);
}
} else if (Squid.class.isAssignableFrom(clazz)) {
entity = new EntitySquid(world);
} else if (Tameable.class.isAssignableFrom(clazz)) {
if (Wolf.class.isAssignableFrom(clazz)) {
entity = new EntityWolf(world);
} else if (Ocelot.class.isAssignableFrom(clazz)) {
entity = new EntityOcelot(world);
} else if (Parrot.class.isAssignableFrom(clazz)) {
entity = new EntityParrot(world);
}
} else if (PigZombie.class.isAssignableFrom(clazz)) {
entity = new EntityPigZombie(world);
} else if (Zombie.class.isAssignableFrom(clazz)) {
if (Husk.class.isAssignableFrom(clazz)) {
entity = new EntityHusk(world);
} else if (ZombieVillager.class.isAssignableFrom(clazz)) {
entity = new EntityZombieVillager(world);
} else {
entity = new EntityZombie(world);
}
} else if (Giant.class.isAssignableFrom(clazz)) {
entity = new EntityGiantZombie(world);
} else if (Silverfish.class.isAssignableFrom(clazz)) {
entity = new EntitySilverfish(world);
} else if (Enderman.class.isAssignableFrom(clazz)) {
entity = new EntityEnderman(world);
} else if (Blaze.class.isAssignableFrom(clazz)) {
entity = new EntityBlaze(world);
} else if (Villager.class.isAssignableFrom(clazz)) {
entity = new EntityVillager(world);
} else if (Witch.class.isAssignableFrom(clazz)) {
entity = new EntityWitch(world);
} else if (Wither.class.isAssignableFrom(clazz)) {
entity = new EntityWither(world);
} else if (ComplexLivingEntity.class.isAssignableFrom(clazz)) {
if (EnderDragon.class.isAssignableFrom(clazz)) {
entity = new EntityDragon(world);
}
} else if (Ambient.class.isAssignableFrom(clazz)) {
if (Bat.class.isAssignableFrom(clazz)) {
entity = new EntityBat(world);
}
} else if (Rabbit.class.isAssignableFrom(clazz)) {
entity = new EntityRabbit(world);
} else if (Endermite.class.isAssignableFrom(clazz)) {
entity = new EntityEndermite(world);
} else if (Guardian.class.isAssignableFrom(clazz)) {
if (ElderGuardian.class.isAssignableFrom(clazz)) {
entity = new EntityElderGuardian(world);
} else {
entity = new EntityGuardian(world);
}
} else if (ArmorStand.class.isAssignableFrom(clazz)) {
entity = new EntityArmorStand(world, x, y, z);
} else if (PolarBear.class.isAssignableFrom(clazz)) {
entity = new EntityPolarBear(world);
} else if (Vex.class.isAssignableFrom(clazz)) {
entity = new EntityVex(world);
} else if (Illager.class.isAssignableFrom(clazz)) {
if (Spellcaster.class.isAssignableFrom(clazz)) {
if (Evoker.class.isAssignableFrom(clazz)) {
entity = new EntityEvoker(world);
} else if (Illusioner.class.isAssignableFrom(clazz)) {
entity = new EntityIllusionIllager(world);
}
} else if (Vindicator.class.isAssignableFrom(clazz)) {
entity = new EntityVindicator(world);
}
}
if (entity != null) {
entity.setPositionAndRotation(x, y, z, yaw, pitch);
// SPIGOT-3587
entity.setRotationYawHead(yaw);
}
} else if (Hanging.class.isAssignableFrom(clazz)) {
Block block = getBlockAt(location);
BlockFace face = BlockFace.SELF;
// 1 full block, also painting smallest size.
int width = 16;
// 1 full block, also painting smallest size.
int height = 16;
if (ItemFrame.class.isAssignableFrom(clazz)) {
width = 12;
height = 12;
} else if (LeashHitch.class.isAssignableFrom(clazz)) {
width = 9;
height = 9;
}
BlockFace[] faces = new BlockFace[] { BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH };
final BlockPos pos = new BlockPos((int) x, (int) y, (int) z);
for (BlockFace dir : faces) {
net.minecraft.block.Block nmsBlock = CraftMagicNumbers.getBlock(block.getRelative(dir));
if (nmsBlock.getDefaultState().getMaterial().isSolid() || BlockRedstoneDiode.isDiode(nmsBlock.getDefaultState())) {
boolean taken = false;
AxisAlignedBB bb = EntityHanging.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height);
List<net.minecraft.entity.Entity> list = (List<net.minecraft.entity.Entity>) world.getEntitiesWithinAABBExcludingEntity(null, bb);
for (Iterator<net.minecraft.entity.Entity> it = list.iterator(); !taken && it.hasNext(); ) {
net.minecraft.entity.Entity e = it.next();
if (e instanceof EntityHanging) {
// Hanging entities do not like hanging entities which intersect them.
taken = true;
}
}
if (!taken) {
face = dir;
break;
}
}
}
if (LeashHitch.class.isAssignableFrom(clazz)) {
entity = new EntityLeashKnot(world, new BlockPos((int) x, (int) y, (int) z));
entity.forceSpawn = true;
} else {
// No valid face found
Preconditions.checkArgument(face != BlockFace.SELF, "Cannot spawn hanging entity for %s at %s (no free face)", clazz.getName(), location);
EnumFacing dir = CraftBlock.blockFaceToNotch(face).getOpposite();
if (Painting.class.isAssignableFrom(clazz)) {
entity = new EntityPainting(world, new BlockPos((int) x, (int) y, (int) z), dir);
} else if (ItemFrame.class.isAssignableFrom(clazz)) {
entity = new EntityItemFrame(world, new BlockPos((int) x, (int) y, (int) z), dir);
}
}
if (entity != null && !((EntityHanging) entity).onValidSurface()) {
throw new IllegalArgumentException("Cannot spawn hanging entity for " + clazz.getName() + " at " + location);
}
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
entity = new EntityTNTPrimed(world, x, y, z, null);
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
entity = new EntityXPOrb(world, x, y, z, 0);
} else if (Weather.class.isAssignableFrom(clazz)) {
// not sure what this can do
if (LightningStrike.class.isAssignableFrom(clazz)) {
entity = new EntityLightningBolt(world, x, y, z, false);
// what is this, I don't even
}
} else if (Firework.class.isAssignableFrom(clazz)) {
entity = new EntityFireworkRocket(world, x, y, z, net.minecraft.item.ItemStack.EMPTY);
} else if (AreaEffectCloud.class.isAssignableFrom(clazz)) {
entity = new EntityAreaEffectCloud(world, x, y, z);
} else if (EvokerFangs.class.isAssignableFrom(clazz)) {
entity = new EntityEvokerFangs(world, x, y, z, (float) Math.toRadians(yaw), 0, null);
}
if (entity != null) {
return entity;
}
throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName());
}
use of net.minecraft.entity.monster.EntityGuardian in project Minecraft-SlientClient-Hack by YouNeverKnow00.
the class ModelGuardian method setRotationAngles.
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
EntityGuardian entityguardian = (EntityGuardian) entityIn;
float f = ageInTicks - (float) entityguardian.ticksExisted;
this.guardianBody.rotateAngleY = netHeadYaw * 0.017453292F;
this.guardianBody.rotateAngleX = headPitch * 0.017453292F;
float[] afloat = new float[] { 1.75F, 0.25F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 0.5F, 1.25F, 0.75F, 0.0F, 0.0F };
float[] afloat1 = new float[] { 0.0F, 0.0F, 0.0F, 0.0F, 0.25F, 1.75F, 1.25F, 0.75F, 0.0F, 0.0F, 0.0F, 0.0F };
float[] afloat2 = new float[] { 0.0F, 0.0F, 0.25F, 1.75F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.75F, 1.25F };
float[] afloat3 = new float[] { 0.0F, 0.0F, 8.0F, -8.0F, -8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F, 8.0F, -8.0F };
float[] afloat4 = new float[] { -8.0F, -8.0F, -8.0F, -8.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 8.0F, 8.0F };
float[] afloat5 = new float[] { 8.0F, -8.0F, 0.0F, 0.0F, -8.0F, -8.0F, 8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F };
float f1 = (1.0F - entityguardian.getSpikesAnimation(f)) * 0.55F;
for (int i = 0; i < 12; ++i) {
this.guardianSpines[i].rotateAngleX = (float) Math.PI * afloat[i];
this.guardianSpines[i].rotateAngleY = (float) Math.PI * afloat1[i];
this.guardianSpines[i].rotateAngleZ = (float) Math.PI * afloat2[i];
this.guardianSpines[i].rotationPointX = afloat3[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
this.guardianSpines[i].rotationPointY = 16.0F + afloat4[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
this.guardianSpines[i].rotationPointZ = afloat5[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float) i) * 0.01F - f1);
}
this.guardianEye.rotationPointZ = -8.25F;
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (entityguardian.hasTargetedEntity()) {
entity = entityguardian.getTargetedEntity();
}
if (entity != null) {
Vec3d vec3d = entity.getPositionEyes(0.0F);
Vec3d vec3d1 = entityIn.getPositionEyes(0.0F);
double d0 = vec3d.yCoord - vec3d1.yCoord;
if (d0 > 0.0D) {
this.guardianEye.rotationPointY = 0.0F;
} else {
this.guardianEye.rotationPointY = 1.0F;
}
Vec3d vec3d2 = entityIn.getLook(0.0F);
vec3d2 = new Vec3d(vec3d2.xCoord, 0.0D, vec3d2.zCoord);
Vec3d vec3d3 = (new Vec3d(vec3d1.xCoord - vec3d.xCoord, 0.0D, vec3d1.zCoord - vec3d.zCoord)).normalize().rotateYaw(((float) Math.PI / 2F));
double d1 = vec3d2.dotProduct(vec3d3);
this.guardianEye.rotationPointX = MathHelper.sqrt((float) Math.abs(d1)) * 2.0F * (float) Math.signum(d1);
}
this.guardianEye.showModel = true;
float f2 = entityguardian.getTailAnimation(f);
this.guardianTail[0].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.05F;
this.guardianTail[1].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.1F;
this.guardianTail[1].rotationPointX = -1.5F;
this.guardianTail[1].rotationPointY = 0.5F;
this.guardianTail[1].rotationPointZ = 14.0F;
this.guardianTail[2].rotateAngleY = MathHelper.sin(f2) * (float) Math.PI * 0.15F;
this.guardianTail[2].rotationPointX = 0.5F;
this.guardianTail[2].rotationPointY = 0.5F;
this.guardianTail[2].rotationPointZ = 6.0F;
}
use of net.minecraft.entity.monster.EntityGuardian in project Minecraft-SlientClient-Hack by YouNeverKnow00.
the class NetHandlerPlayClient method handleEntityStatus.
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null) {
if (packetIn.getOpCode() == 21) {
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
} else if (packetIn.getOpCode() == 35) {
int i = 40;
this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player) {
this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
}
} else {
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
Aggregations