use of com.simibubi.create.content.contraptions.KineticNetwork in project Create_Aeronautics by Eriksonnaren.
the class TorsionSpringTileEntity method updateGeneratedRotation.
public void updateGeneratedRotation() {
float speed = this.getGeneratedSpeed();
float prevSpeed = this.speed;
if (!this.level.isClientSide) {
if (prevSpeed != speed) {
if (!this.hasSource()) {
IRotate.SpeedLevel levelBefore = IRotate.SpeedLevel.of(this.speed);
IRotate.SpeedLevel levelafter = IRotate.SpeedLevel.of(speed);
if (levelBefore != levelafter) {
this.effects.queueRotationIndicators();
}
}
this.applyNewSpeed(prevSpeed, speed);
}
if (this.hasNetwork() && speed != 0.0F) {
KineticNetwork network = this.getOrCreateNetwork();
this.notifyStressCapacityChange(this.calculateAddedStressCapacity());
this.getOrCreateNetwork().updateStressFor(this, this.calculateStressApplied());
network.updateStress();
}
// this.onSpeedChanged(prevSpeed);
this.sendData();
}
}
use of com.simibubi.create.content.contraptions.KineticNetwork in project Create by Creators-of-Create.
the class KineticTileEntity method initialize.
@Override
public void initialize() {
if (hasNetwork() && !level.isClientSide) {
KineticNetwork network = getOrCreateNetwork();
if (!network.initialized)
network.initFromTE(capacity, stress, networkSize);
network.addSilently(this, lastCapacityProvided, lastStressApplied);
}
super.initialize();
}
use of com.simibubi.create.content.contraptions.KineticNetwork in project Create by Creators-of-Create.
the class KineticTileEntity method setNetwork.
public void setNetwork(@Nullable Long networkIn) {
if (network == networkIn)
return;
if (network != null)
getOrCreateNetwork().remove(this);
network = networkIn;
setChanged();
if (networkIn == null)
return;
network = networkIn;
KineticNetwork network = getOrCreateNetwork();
network.initialized = true;
network.add(this);
}
use of com.simibubi.create.content.contraptions.KineticNetwork in project Create by Creators-of-Create.
the class GeneratingKineticTileEntity method updateGeneratedRotation.
public void updateGeneratedRotation() {
float speed = getGeneratedSpeed();
float prevSpeed = this.speed;
if (level.isClientSide)
return;
if (prevSpeed != speed) {
if (!hasSource()) {
SpeedLevel levelBefore = SpeedLevel.of(this.speed);
SpeedLevel levelafter = SpeedLevel.of(speed);
if (levelBefore != levelafter)
effects.queueRotationIndicators();
}
applyNewSpeed(prevSpeed, speed);
}
if (hasNetwork() && speed != 0) {
KineticNetwork network = getOrCreateNetwork();
notifyStressCapacityChange(calculateAddedStressCapacity());
getOrCreateNetwork().updateStressFor(this, calculateStressApplied());
network.updateStress();
}
onSpeedChanged(prevSpeed);
sendData();
}
use of com.simibubi.create.content.contraptions.KineticNetwork in project Multiblocked by Low-Drag-MC.
the class CreateKineticSourceTileEntity method updateGeneratedRotation.
public void updateGeneratedRotation() {
if (!definition.isOutput)
return;
float speed = this.getGeneratedSpeed();
float prevSpeed = this.speed;
if (!this.level.isClientSide) {
if (prevSpeed != speed) {
if (!this.hasSource()) {
IRotate.SpeedLevel levelBefore = IRotate.SpeedLevel.of(this.speed);
IRotate.SpeedLevel levelafter = IRotate.SpeedLevel.of(speed);
if (levelBefore != levelafter) {
this.effects.queueRotationIndicators();
}
}
this.applyNewSpeed(prevSpeed, speed);
}
if (this.hasNetwork() && speed != 0.0F) {
KineticNetwork network = this.getOrCreateNetwork();
this.notifyStressCapacityChange(this.calculateAddedStressCapacity());
this.getOrCreateNetwork().updateStressFor(this, this.calculateStressApplied());
network.updateStress();
}
this.onSpeedChanged(prevSpeed);
this.sendData();
}
}
Aggregations