use of pneumaticCraft.common.network.PacketSpawnParticle in project PneumaticCraft by MineMaarten.
the class ModuleAirGrate method checkForPlantsAndFarm.
private void checkForPlantsAndFarm(World worldObj, int x, int y, int z, int plantCheckRange) {
if (grateRange > 0 && worldObj.getTotalWorldTime() % 5 == 0) {
if (plantCheckX < x - plantCheckRange || plantCheckZ < z - plantCheckRange) {
plantCheckX = x - plantCheckRange;
plantCheckZ = z - plantCheckRange;
}
if (plantCheckX != x || plantCheckZ != z) {
// we know that we're no plant, avoid getBlock
Block b = worldObj.getBlock(plantCheckX, y, plantCheckZ);
NetworkHandler.sendToAllAround(new PacketSpawnParticle("reddust", plantCheckX + 0.5, y + 0.5, plantCheckZ + 0.5, 0, 0, 0), worldObj);
if (b instanceof BlockPneumaticPlantBase) {
((BlockPneumaticPlantBase) b).attemptFarmByAirGrate(worldObj, plantCheckX, y, plantCheckZ);
}
}
if (plantCheckZ++ >= z + plantCheckRange) {
plantCheckZ = z - plantCheckRange;
if (plantCheckX++ >= x + plantCheckRange) {
plantCheckX = x - plantCheckRange;
}
}
}
}
use of pneumaticCraft.common.network.PacketSpawnParticle in project PneumaticCraft by MineMaarten.
the class HeatBehaviourLiquidTransition method onLiquidTransition.
protected void onLiquidTransition(int x, int y, int z) {
NetworkHandler.sendToAllAround(new PacketPlaySound("random.fizz", x + 0.5, y + 0.5, z + 0.5, 0.5F, 2.6F + (getWorld().rand.nextFloat() - getWorld().rand.nextFloat()) * 0.8F, true), getWorld());
for (int i = 0; i < 8; i++) {
double randX = x + getWorld().rand.nextDouble();
double randZ = z + getWorld().rand.nextDouble();
NetworkHandler.sendToAllAround(new PacketSpawnParticle("largesmoke", randX, y + 1, randZ, 0, 0, 0), getWorld());
}
}
Aggregations