@SideOnly(Side.CLIENT) private void chargingParticles() { if (worldObj.rand.nextInt(4) == 0) { int dx = worldObj.rand.nextBoolean() ? 3 : -3; int dz = worldObj.rand.nextBoolean() ? 3 : -3; int x = xCoord + dx; int y = yCoord + 5; int z = zCoord + dz; if (worldObj.getBlock(x, y, z) == ChromaBlocks.PYLONSTRUCT.getBlockInstance() && worldObj.getBlockMetadata(x, y, z) == 5) { // EntityFX fx = new EntityBoltFX(worldObj, x+0.5, y+0.5, z+0.5, x+5, y, z+5); double px = x + worldObj.rand.nextDouble(); double py = y + worldObj.rand.nextDouble(); double pz = z + worldObj.rand.nextDouble(); EntityBallLightningFX fx = new EntityBallLightningFX( worldObj, px, py, pz, CrystalElement.elements[ticks / 8 % 16]); fx.noClip = false; double v = 0.125; double vx = v * -Math.signum(dx); double vy = -0.125; double vz = v * -Math.signum(dz); fx.motionX = vx; fx.motionY = vy; fx.motionZ = vz; Minecraft.getMinecraft().effectRenderer.addEffect(fx); } } }
protected boolean checkForStructure() { ForgeDirection dir = facing; World world = worldObj; int x = xCoord; int y = yCoord; int z = zCoord; if (world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) != ChromaBlocks.RUNE.getBlockInstance()) return false; for (int i = 2; i < 4; i++) { int dx = x + dir.offsetX * i; int dy = y + dir.offsetY * i; int dz = z + dir.offsetZ * i; Block id = world.getBlock(dx, dy, dz); int meta = world.getBlockMetadata(dx, dy, dz); if (id != ChromaBlocks.PYLONSTRUCT.getBlockInstance() || meta != 0) return false; } return true; }