if(worldObj.getBlock(centerX, centerY, centerZ) != getBlockForMeta() || meta != 0 && worldObj.getBlockMetadata(centerX, centerY, centerZ) == 0) {
activated = false;
return;
}
Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5);
if(meta == 1) {
if(ConfigHandler.elfPortalParticlesEnabled) {
double worldTime = (int) worldObj.getTotalWorldTime();
worldTime += new Random(xCoord ^ yCoord ^ zCoord).nextInt(1000);
worldTime /= 5;
float r = 0.75F + (float) Math.random() * 0.05F;
double x = xCoord + 0.5 + Math.cos(worldTime) * r;
double z = zCoord + 0.5 + Math.sin(worldTime) * r;
Vector3 ourCoords = new Vector3(x, yCoord + 0.25, z);
centerBlock.sub(new Vector3(0, 0.5, 0));
Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2);
Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
if(worldObj.rand.nextInt(3) == 0)
Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
}
} else {
Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0);
Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2);
Block block = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
if(block == ModBlocks.flower || block == ModBlocks.shinyFlower) {
int fmeta = worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord);
float[] color = EntitySheep.fleeceColorTable[fmeta];