and the large turbine

This commit is contained in:
Voxelstice 2022-06-12 05:26:14 +10:00 committed by GitHub
parent 4bd1ccddf2
commit 8dfe52b895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
private boolean shouldTurn; private boolean shouldTurn;
public float rotor; public float rotor;
public float lastRotor; public float lastRotor;
public float fanAcceleration = 0F;
public TileEntityMachineLargeTurbine() { public TileEntityMachineLargeTurbine() {
super(7); super(7);
@ -104,17 +105,20 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
data.setBoolean("operational", operational); data.setBoolean("operational", operational);
this.networkPack(data, 50); this.networkPack(data, 50);
} else { } else {
this.lastRotor = this.rotor; this.lastRotor = this.rotor;
this.rotor += this.fanAcceleration;
if(this.rotor >= 360) {
this.rotor -= 360;
this.lastRotor -= 360;
}
if(shouldTurn) { if(shouldTurn) {
this.rotor += 15F; this.fanAcceleration = Math.max(0F, Math.min(15F, this.fanAcceleration += 0.1F));
}
if(this.rotor >= 360) { if(!shouldTurn) {
this.rotor -= 360; this.fanAcceleration = Math.max(0F, Math.min(15F, this.fanAcceleration -= 0.1F));
this.lastRotor -= 360;
}
} }
} }
} }