use of net.minecraft.entity.projectile.EntityEvokerFangs in project CumServerPro by MCUmbrella.
the class EntityTracker method track.
public void track(Entity entityIn) {
if (this.trackedEntityHashTable.containsItem(entityIn.getEntityId())) {
return;
}
if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, entityIn))
return;
if (entityIn instanceof EntityPlayerMP) {
this.track(entityIn, 512, 2);
EntityPlayerMP entityplayermp = (EntityPlayerMP) entityIn;
for (EntityTrackerEntry entitytrackerentry : this.entries) {
if (entitytrackerentry.getTrackedEntity() != entityplayermp) {
entitytrackerentry.updatePlayerEntity(entityplayermp);
}
}
} else if (entityIn instanceof EntityFishHook) {
this.track(entityIn, 64, 5, true);
} else if (entityIn instanceof EntityArrow) {
this.track(entityIn, 64, 20, false);
} else if (entityIn instanceof EntitySmallFireball) {
this.track(entityIn, 64, 10, false);
} else if (entityIn instanceof EntityFireball) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntitySnowball) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityLlamaSpit) {
this.track(entityIn, 64, 10, false);
} else if (entityIn instanceof EntityEnderPearl) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityEnderEye) {
this.track(entityIn, 64, 4, true);
} else if (entityIn instanceof EntityEgg) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityPotion) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityExpBottle) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityFireworkRocket) {
this.track(entityIn, 64, 10, true);
} else if (entityIn instanceof EntityItem) {
this.track(entityIn, 64, 20, true);
} else if (entityIn instanceof EntityMinecart) {
this.track(entityIn, 80, 3, true);
} else if (entityIn instanceof EntityBoat) {
this.track(entityIn, 80, 3, true);
} else if (entityIn instanceof EntitySquid) {
this.track(entityIn, 64, 3, true);
} else if (entityIn instanceof EntityWither) {
this.track(entityIn, 80, 3, false);
} else if (entityIn instanceof EntityShulkerBullet) {
this.track(entityIn, 80, 3, true);
} else if (entityIn instanceof EntityBat) {
this.track(entityIn, 80, 3, false);
} else if (entityIn instanceof EntityDragon) {
this.track(entityIn, 160, 3, true);
} else if (entityIn instanceof IAnimals) {
this.track(entityIn, 80, 3, true);
} else if (entityIn instanceof EntityTNTPrimed) {
this.track(entityIn, 160, 10, true);
} else if (entityIn instanceof EntityFallingBlock) {
this.track(entityIn, 160, 20, true);
} else if (entityIn instanceof EntityHanging) {
this.track(entityIn, 160, Integer.MAX_VALUE, false);
} else if (entityIn instanceof EntityArmorStand) {
this.track(entityIn, 160, 3, true);
} else if (entityIn instanceof EntityXPOrb) {
this.track(entityIn, 160, 20, true);
} else if (entityIn instanceof EntityAreaEffectCloud) {
// CraftBukkit
this.track(entityIn, 160, 10, /*Integer.MAX_VALUE*/
true);
} else if (entityIn instanceof EntityEnderCrystal) {
this.track(entityIn, 256, Integer.MAX_VALUE, false);
} else if (entityIn instanceof EntityEvokerFangs) {
this.track(entityIn, 160, 2, false);
}
}
use of net.minecraft.entity.projectile.EntityEvokerFangs in project CumServerPro by MCUmbrella.
the class EntityTrackerEntry method createSpawnPacket.
@Nullable
private Packet<?> createSpawnPacket() {
if (this.trackedEntity.isDead) {
// LOGGER.warn("Fetching addPacket for removed entity");
return null;
}
Packet pkt = net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.getEntitySpawningPacket(this.trackedEntity);
if (pkt != null)
return pkt;
if (this.trackedEntity instanceof EntityPlayerMP) {
return new SPacketSpawnPlayer((EntityPlayer) this.trackedEntity);
} else if (this.trackedEntity instanceof IAnimals) {
this.lastHeadMotion = MathHelper.floor(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F);
return new SPacketSpawnMob((EntityLivingBase) this.trackedEntity);
} else if (this.trackedEntity instanceof EntityPainting) {
return new SPacketSpawnPainting((EntityPainting) this.trackedEntity);
} else if (this.trackedEntity instanceof EntityItem) {
return new SPacketSpawnObject(this.trackedEntity, 2, 1);
} else if (this.trackedEntity instanceof EntityMinecart) {
EntityMinecart entityminecart = (EntityMinecart) this.trackedEntity;
return new SPacketSpawnObject(this.trackedEntity, 10, entityminecart.getType().getId());
} else if (this.trackedEntity instanceof EntityBoat) {
return new SPacketSpawnObject(this.trackedEntity, 1);
} else if (this.trackedEntity instanceof EntityXPOrb) {
return new SPacketSpawnExperienceOrb((EntityXPOrb) this.trackedEntity);
} else if (this.trackedEntity instanceof EntityFishHook) {
Entity entity2 = ((EntityFishHook) this.trackedEntity).getAngler();
return new SPacketSpawnObject(this.trackedEntity, 90, entity2 == null ? this.trackedEntity.getEntityId() : entity2.getEntityId());
} else if (this.trackedEntity instanceof EntitySpectralArrow) {
Entity entity1 = ((EntitySpectralArrow) this.trackedEntity).shootingEntity;
return new SPacketSpawnObject(this.trackedEntity, 91, 1 + (entity1 == null ? this.trackedEntity.getEntityId() : entity1.getEntityId()));
} else if (this.trackedEntity instanceof EntityTippedArrow) {
Entity entity = ((EntityArrow) this.trackedEntity).shootingEntity;
return new SPacketSpawnObject(this.trackedEntity, 60, 1 + (entity == null ? this.trackedEntity.getEntityId() : entity.getEntityId()));
} else if (this.trackedEntity instanceof EntitySnowball) {
return new SPacketSpawnObject(this.trackedEntity, 61);
} else if (this.trackedEntity instanceof EntityLlamaSpit) {
return new SPacketSpawnObject(this.trackedEntity, 68);
} else if (this.trackedEntity instanceof EntityPotion) {
return new SPacketSpawnObject(this.trackedEntity, 73);
} else if (this.trackedEntity instanceof EntityExpBottle) {
return new SPacketSpawnObject(this.trackedEntity, 75);
} else if (this.trackedEntity instanceof EntityEnderPearl) {
return new SPacketSpawnObject(this.trackedEntity, 65);
} else if (this.trackedEntity instanceof EntityEnderEye) {
return new SPacketSpawnObject(this.trackedEntity, 72);
} else if (this.trackedEntity instanceof EntityFireworkRocket) {
return new SPacketSpawnObject(this.trackedEntity, 76);
} else if (this.trackedEntity instanceof EntityFireball) {
EntityFireball entityfireball = (EntityFireball) this.trackedEntity;
SPacketSpawnObject spacketspawnobject = null;
int i = 63;
if (this.trackedEntity instanceof EntitySmallFireball) {
i = 64;
} else if (this.trackedEntity instanceof EntityDragonFireball) {
i = 93;
} else if (this.trackedEntity instanceof EntityWitherSkull) {
i = 66;
}
if (entityfireball.shootingEntity != null) {
spacketspawnobject = new SPacketSpawnObject(this.trackedEntity, i, ((EntityFireball) this.trackedEntity).shootingEntity.getEntityId());
} else {
spacketspawnobject = new SPacketSpawnObject(this.trackedEntity, i, 0);
}
spacketspawnobject.setSpeedX((int) (entityfireball.accelerationX * 8000.0D));
spacketspawnobject.setSpeedY((int) (entityfireball.accelerationY * 8000.0D));
spacketspawnobject.setSpeedZ((int) (entityfireball.accelerationZ * 8000.0D));
return spacketspawnobject;
} else if (this.trackedEntity instanceof EntityShulkerBullet) {
SPacketSpawnObject spacketspawnobject1 = new SPacketSpawnObject(this.trackedEntity, 67, 0);
spacketspawnobject1.setSpeedX((int) (this.trackedEntity.motionX * 8000.0D));
spacketspawnobject1.setSpeedY((int) (this.trackedEntity.motionY * 8000.0D));
spacketspawnobject1.setSpeedZ((int) (this.trackedEntity.motionZ * 8000.0D));
return spacketspawnobject1;
} else if (this.trackedEntity instanceof EntityEgg) {
return new SPacketSpawnObject(this.trackedEntity, 62);
} else if (this.trackedEntity instanceof EntityEvokerFangs) {
return new SPacketSpawnObject(this.trackedEntity, 79);
} else if (this.trackedEntity instanceof EntityTNTPrimed) {
return new SPacketSpawnObject(this.trackedEntity, 50);
} else if (this.trackedEntity instanceof EntityEnderCrystal) {
return new SPacketSpawnObject(this.trackedEntity, 51);
} else if (this.trackedEntity instanceof EntityFallingBlock) {
EntityFallingBlock entityfallingblock = (EntityFallingBlock) this.trackedEntity;
return new SPacketSpawnObject(this.trackedEntity, 70, Block.getStateId(entityfallingblock.getBlock()));
} else if (this.trackedEntity instanceof EntityArmorStand) {
return new SPacketSpawnObject(this.trackedEntity, 78);
} else if (this.trackedEntity instanceof EntityItemFrame) {
EntityItemFrame entityitemframe = (EntityItemFrame) this.trackedEntity;
return new SPacketSpawnObject(this.trackedEntity, 71, entityitemframe.facingDirection.getHorizontalIndex(), entityitemframe.getHangingPosition());
} else if (this.trackedEntity instanceof EntityLeashKnot) {
EntityLeashKnot entityleashknot = (EntityLeashKnot) this.trackedEntity;
return new SPacketSpawnObject(this.trackedEntity, 77, 0, entityleashknot.getHangingPosition());
} else if (this.trackedEntity instanceof EntityAreaEffectCloud) {
return new SPacketSpawnObject(this.trackedEntity, 3);
} else {
FMLLog.log.warn(new IllegalArgumentException("Don't know how to add " + this.trackedEntity.getClass() + "!").getMessage() + "x:{}, y:{}x z:{}", this.trackedEntity.posX, this.trackedEntity.posY, this.trackedEntity.posZ);
return null;
}
}
use of net.minecraft.entity.projectile.EntityEvokerFangs in project CumServerPro by MCUmbrella.
the class NetHandlerPlayClient method handleSpawnObject.
public void handleSpawnObject(SPacketSpawnObject packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
double d0 = packetIn.getX();
double d1 = packetIn.getY();
double d2 = packetIn.getZ();
Entity entity = null;
if (packetIn.getType() == 10) {
entity = EntityMinecart.create(this.clientWorldController, d0, d1, d2, EntityMinecart.Type.getById(packetIn.getData()));
} else if (packetIn.getType() == 90) {
Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getData());
if (entity1 instanceof EntityPlayer) {
entity = new EntityFishHook(this.clientWorldController, (EntityPlayer) entity1, d0, d1, d2);
}
packetIn.setData(0);
} else if (packetIn.getType() == 60) {
entity = new EntityTippedArrow(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 91) {
entity = new EntitySpectralArrow(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 61) {
entity = new EntitySnowball(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 68) {
entity = new EntityLlamaSpit(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
} else if (packetIn.getType() == 71) {
entity = new EntityItemFrame(this.clientWorldController, new BlockPos(d0, d1, d2), EnumFacing.getHorizontal(packetIn.getData()));
packetIn.setData(0);
} else if (packetIn.getType() == 77) {
entity = new EntityLeashKnot(this.clientWorldController, new BlockPos(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)));
packetIn.setData(0);
} else if (packetIn.getType() == 65) {
entity = new EntityEnderPearl(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 72) {
entity = new EntityEnderEye(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 76) {
entity = new EntityFireworkRocket(this.clientWorldController, d0, d1, d2, ItemStack.EMPTY);
} else if (packetIn.getType() == 63) {
entity = new EntityLargeFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
packetIn.setData(0);
} else if (packetIn.getType() == 93) {
entity = new EntityDragonFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
packetIn.setData(0);
} else if (packetIn.getType() == 64) {
entity = new EntitySmallFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
packetIn.setData(0);
} else if (packetIn.getType() == 66) {
entity = new EntityWitherSkull(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
packetIn.setData(0);
} else if (packetIn.getType() == 67) {
entity = new EntityShulkerBullet(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
packetIn.setData(0);
} else if (packetIn.getType() == 62) {
entity = new EntityEgg(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 79) {
entity = new EntityEvokerFangs(this.clientWorldController, d0, d1, d2, 0.0F, 0, (EntityLivingBase) null);
} else if (packetIn.getType() == 73) {
entity = new EntityPotion(this.clientWorldController, d0, d1, d2, ItemStack.EMPTY);
packetIn.setData(0);
} else if (packetIn.getType() == 75) {
entity = new EntityExpBottle(this.clientWorldController, d0, d1, d2);
packetIn.setData(0);
} else if (packetIn.getType() == 1) {
entity = new EntityBoat(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 50) {
entity = new EntityTNTPrimed(this.clientWorldController, d0, d1, d2, (EntityLivingBase) null);
} else if (packetIn.getType() == 78) {
entity = new EntityArmorStand(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 51) {
entity = new EntityEnderCrystal(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 2) {
entity = new EntityItem(this.clientWorldController, d0, d1, d2);
} else if (packetIn.getType() == 70) {
entity = new EntityFallingBlock(this.clientWorldController, d0, d1, d2, Block.getStateById(packetIn.getData() & 65535));
packetIn.setData(0);
} else if (packetIn.getType() == 3) {
entity = new EntityAreaEffectCloud(this.clientWorldController, d0, d1, d2);
}
if (entity != null) {
EntityTracker.updateServerPosition(entity, d0, d1, d2);
entity.rotationPitch = (float) (packetIn.getPitch() * 360) / 256.0F;
entity.rotationYaw = (float) (packetIn.getYaw() * 360) / 256.0F;
Entity[] aentity = entity.getParts();
if (aentity != null) {
int i = packetIn.getEntityID() - entity.getEntityId();
for (Entity entity2 : aentity) {
entity2.setEntityId(entity2.getEntityId() + i);
}
}
entity.setEntityId(packetIn.getEntityID());
entity.setUniqueId(packetIn.getUniqueId());
this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entity);
if (packetIn.getData() > 0) {
if (packetIn.getType() == 60 || packetIn.getType() == 91) {
Entity entity3 = this.clientWorldController.getEntityByID(packetIn.getData() - 1);
if (entity3 instanceof EntityLivingBase && entity instanceof EntityArrow) {
((EntityArrow) entity).shootingEntity = entity3;
}
}
entity.setVelocity((double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
}
}
}
Aggregations