Search in sources :

Example 1 with PacketSpawnParticleStream

use of com.builtbroken.mc.core.network.packet.PacketSpawnParticleStream in project ICBM-Classic by BuiltBrokenModding.

the class TileCruiseLauncher method update.

@Override
public void update() {
    super.update();
    // time / time_tick, client uses different value
    deltaTime = (System.nanoTime() - lastRotationUpdate) / 100000000.0;
    lastRotationUpdate = System.nanoTime();
    if (getTarget() != null && !getTarget().isZero()) {
        Pos aimPoint = getTarget();
        Pos center = toPos().add(0.5);
        if (Engine.runningAsDev) {
            sendPacket(new PacketSpawnParticleStream(world().provider.dimensionId, center, aimPoint));
        }
        aim.set(center.toEulerAngle(aimPoint).clampTo360());
        currentAim.moveTowards(aim, ROTATION_SPEED, deltaTime).clampTo360();
        if (!this.worldObj.isRemote) {
            if (this.ticks % 40 == 0 && this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
                this.launch();
            }
        }
    }
}
Also used : PacketSpawnParticleStream(com.builtbroken.mc.core.network.packet.PacketSpawnParticleStream) Pos(com.builtbroken.mc.imp.transform.vector.Pos)

Aggregations

PacketSpawnParticleStream (com.builtbroken.mc.core.network.packet.PacketSpawnParticleStream)1 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1