mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-25 22:46:26 +01:00
Merge remote-tracking branch 'origin/mc1.14-v0.2.1' into mc1.14-v0.2.1
This commit is contained in:
commit
cbc5eaebf9
9 changed files with 31 additions and 24 deletions
|
@ -8,6 +8,7 @@ import org.apache.logging.log4j.Logger;
|
|||
import com.simibubi.create.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.command.CreateCommand;
|
||||
import com.simibubi.create.foundation.command.ServerLagger;
|
||||
import com.simibubi.create.foundation.world.AllWorldFeatures;
|
||||
import com.simibubi.create.modules.ModuleLoadedCondition;
|
||||
import com.simibubi.create.modules.contraptions.TorquePropagator;
|
||||
import com.simibubi.create.modules.logistics.RedstoneLinkNetworkHandler;
|
||||
|
@ -62,6 +63,7 @@ public class Create {
|
|||
modEventBus.addListener(AllConfigs::onLoad);
|
||||
modEventBus.addListener(AllConfigs::onReload);
|
||||
CreateClient.addListeners(modEventBus);
|
||||
AllWorldFeatures.reload();
|
||||
}
|
||||
|
||||
public static void init(final FMLCommonSetupEvent event) {
|
||||
|
|
|
@ -20,6 +20,12 @@ public class CWorldGen extends ConfigBase {
|
|||
super.onReload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
AllWorldFeatures.reload();
|
||||
super.onLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "world";
|
||||
|
|
|
@ -136,8 +136,7 @@ public class ItemDescription {
|
|||
|
||||
String genSpeed = generatorSpeed(block, rpmUnit);
|
||||
if (!genSpeed.equals("")) {
|
||||
add(linesOnShift, "");
|
||||
add(linesOnShift, GREEN + genSpeed);
|
||||
add(linesOnShift, GREEN + " " + genSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,22 +37,22 @@ public class KineticNetwork {
|
|||
if (members.containsKey(te))
|
||||
return;
|
||||
if (te.isSource()) {
|
||||
float capacity = te.getAddedStressCapacity();
|
||||
unloadedCapacity -= capacity * getStressMultiplierForSpeed(te.getGeneratedSpeed());
|
||||
if (unloadedCapacity < 0)
|
||||
unloadedCapacity = 0;
|
||||
sources.put(te, capacity);
|
||||
unloadedCapacity -= lastCapacity * getStressMultiplierForSpeed(te.getGeneratedSpeed());
|
||||
float addedStressCapacity = te.getAddedStressCapacity();
|
||||
sources.put(te, addedStressCapacity);
|
||||
}
|
||||
|
||||
unloadedStress -= lastStress * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
|
||||
float stressApplied = te.getStressApplied();
|
||||
unloadedStress -= stressApplied * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
|
||||
if (unloadedStress < 0)
|
||||
unloadedStress = 0;
|
||||
members.put(te, stressApplied);
|
||||
|
||||
unloadedMembers--;
|
||||
if (unloadedMembers < 0)
|
||||
unloadedMembers = 0;
|
||||
if (unloadedCapacity < 0)
|
||||
unloadedCapacity = 0;
|
||||
if (unloadedStress < 0)
|
||||
unloadedStress = 0;
|
||||
}
|
||||
|
||||
public void add(KineticTileEntity te) {
|
||||
|
|
|
@ -102,7 +102,6 @@ public abstract class KineticBlock extends Block implements IRotate {
|
|||
return;
|
||||
if (worldIn.isRemote())
|
||||
return;
|
||||
tileEntity.removeSource();
|
||||
RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,13 +51,12 @@ public abstract class KineticTileEntity extends SmartTileEntity implements ITick
|
|||
|
||||
@Override
|
||||
public void initialize() {
|
||||
if (!hasNetwork())
|
||||
return;
|
||||
|
||||
if (hasNetwork()) {
|
||||
KineticNetwork network = getOrCreateNetwork();
|
||||
if (!network.initialized)
|
||||
network.initFromTE(capacity, stress, networkSize);
|
||||
network.addSilently(this, lastCapacityProvided, lastStressApplied);
|
||||
}
|
||||
|
||||
super.initialize();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ public class SawMovementBehaviour extends BlockBreakingMovementBehaviour {
|
|||
|
||||
@Override
|
||||
public boolean canBreak(World world, BlockPos breakingPos, BlockState state) {
|
||||
return super.canBreak(world, breakingPos, state) && state.isIn(BlockTags.LOGS);
|
||||
return super.canBreak(world, breakingPos, state)
|
||||
&& (state.isIn(BlockTags.LOGS) || state.isIn(BlockTags.LEAVES));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,7 @@ public class MotorTileEntity extends GeneratingKineticTileEntity {
|
|||
generatedSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, slot);
|
||||
generatedSpeed.between(-max, max);
|
||||
generatedSpeed.value = DEFAULT_SPEED;
|
||||
generatedSpeed.scrollableValue = DEFAULT_SPEED;
|
||||
generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
|
||||
generatedSpeed.withCallback(i -> this.updateGeneratedRotation());
|
||||
generatedSpeed.withStepFunction(MotorTileEntity::step);
|
||||
|
|
Loading…
Reference in a new issue