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