use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayNexus in project ClaySoldiersMod by SanAndreasP.
the class ClientProxy method spawnEntityParticles.
@Override
public void spawnEntityParticles(byte[] data, Player player) {
WorldClient world = (WorldClient) ((EntityPlayer) player).worldObj;
Entity entity = world.getEntityByID(getEntityIdFromByteArray(data));
Random rand = new Random();
Minecraft mc = Minecraft.getMinecraft();
if (entity == null)
return;
switch(data[5]) {
case 0:
mc.effectRenderer.addEffect(new EntityNoteFX(world, entity.posX, entity.posY + 0.5D, entity.posZ, rand.nextFloat(), rand.nextFloat(), rand.nextFloat()));
break;
case 1:
Vec3 vec3d = Vec3.createVectorHelper((rand.nextFloat() - 0.5D) * 0.10000000000000001D, Math.random() * 0.10000000000000001D + 0.10000000000000001D, 0.0D);
vec3d.rotateAroundX((-entity.rotationPitch * 3.141593F) / 180F);
vec3d.rotateAroundY((-entity.rotationYaw * 3.141593F) / 180F);
Vec3 vec3d1 = Vec3.createVectorHelper((rand.nextFloat() - 0.5D) * 0.29999999999999999D, (-rand.nextFloat()) * 0.59999999999999998D - 0.29999999999999999D, 0.59999999999999998D);
vec3d1.rotateAroundX((-entity.rotationPitch * 3.141593F) / 180F);
vec3d1.rotateAroundY((-entity.rotationYaw * 3.141593F) / 180F);
vec3d1 = vec3d1.addVector(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ);
world.spawnParticle((new StringBuilder()).append("iconcrack_").append(Item.porkRaw.itemID).toString(), vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord + 0.050000000000000003D, vec3d.zCoord);
break;
case 2:
// int color = 0;
// if (entity instanceof EntityClayMan)
// color = ((EntityClayMan)entity).teamCloth(((EntityClayMan)entity).getClayTeam());
double a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
double b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
double c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
// mc.effectRenderer.addEffect((new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.cloth, 0, color)));
break;
case 3:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect((new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.cloth, 0, 0)));
break;
case 4:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.glowStone, 0, 0));
break;
case 5:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.planks, 0, 0));
break;
case 6:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.blockIron, 0, 0));
break;
case 7:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.glass, 0, 0));
break;
case 8:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(world, a, b, c, 0.0D, 0.0D, 0.0D, Block.blockClay, 0, 0));
break;
case 9:
mc.effectRenderer.addEffect(new EntityCrit2FX(world, entity));
break;
case 10:
EntityClayNexus nexus = (EntityClayNexus) entity;
mc.effectRenderer.addEffect(new EntityNexusFX(world, nexus.posX + (rand.nextDouble() - 0.5D) * nexus.width, (nexus.posY + rand.nextDouble() * nexus.height) - 0.25D, nexus.posZ + (rand.nextDouble() - 0.5D) * nexus.width, (rand.nextDouble() - 0.5D) * 2D, -rand.nextDouble(), (rand.nextDouble() - 0.5D) * 2D, nexus.getTeamColor()[0], nexus.getTeamColor()[1], nexus.getTeamColor()[2]));
break;
case 11:
for (int var1 = 0; var1 < 20; ++var1) {
double var2 = rand.nextGaussian() * 0.02D;
double var4 = rand.nextGaussian() * 0.02D;
double var6 = rand.nextGaussian() * 0.02D;
double var8 = 10.0D;
world.spawnParticle("explode", entity.posX + (double) (rand.nextFloat() * entity.width * 2.0F) - (double) entity.width - var2 * var8, entity.posY + (double) (rand.nextFloat() * entity.height) - var4 * var8, entity.posZ + (double) (rand.nextFloat() * entity.width * 2.0F) - (double) entity.width - var6 * var8, var2, var4, var6);
}
break;
case 12:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(CSMModRegistry.proxy.getClientWorld(), a, b, c, 0.0D, 0.0D, 0.0D, Block.gravel, 0, 0));
break;
case 13:
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
mc.effectRenderer.addEffect(new EntityDiggingFX(CSMModRegistry.proxy.getClientWorld(), a, b, c, 0.0D, 0.0D, 0.0D, Block.dirt, 0, 0));
break;
case 14:
world.spawnParticle("reddust", entity.posX, entity.posY + 0.5F, entity.posZ, -0.4F, 1F, 0F);
break;
case 15:
world.spawnParticle("reddust", entity.posX, entity.posY + 0.5F, entity.posZ, -1F, 0F, 0F);
break;
case 16:
for (int j = 0; j < 4; j++) {
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
world.spawnParticle("reddust", a, b, c, 0.0D, 0.8D, 0.0D);
}
break;
case 17:
for (int j = 0; j < 4; j++) {
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
world.spawnParticle("reddust", a, b, c, 0.0D, 0.1D, 0.0D);
}
break;
case 18:
world.spawnParticle("flame", entity.posX, entity.posY + 0.1D, entity.posZ, 0.0D, 0.01D, 0.0D);
break;
case 19:
world.spawnParticle("heart", entity.posX, entity.posY + 0.1D, entity.posZ, 0.0D, 0.01D, 0.0D);
break;
case 20:
for (int j = 0; j < 4; j++) {
a = entity.posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
b = entity.boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
c = entity.posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
world.spawnParticle("slime", a, b, c, 0.0D, 0.1D, 0.0D);
}
break;
case 21:
world.spawnParticle("portal", entity.posX + (rand.nextDouble() - 0.5D) * entity.width * 0.5D, (entity.posY + rand.nextDouble() * entity.height) - 0.05D, entity.posZ + (rand.nextDouble() - 0.5D) * entity.width * 0.5D, (rand.nextDouble() - 0.5D) * 0.75D, -rand.nextDouble() * 0.5D, (rand.nextDouble() - 0.5D) * 0.75D);
break;
}
}
use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayNexus in project ClaySoldiersMod by SanAndreasP.
the class ItemNexus method spawnNexus.
public boolean spawnNexus(World par0World, int par1, double par2, double par4, double par6) {
EntityClayNexus var8 = new EntityClayNexus(par0World, par4, par6, par1);
if (var8 != null) {
var8.setLocationAndAngles(par2, par4, par6, par0World.rand.nextFloat() * 360.0F, 0.0F);
par0World.spawnEntityInWorld(var8);
var8.playLivingSound();
}
return var8 != null;
}
Aggregations