Merge remote-tracking branch 'origin/mc1.14-v0.2.1' into mc1.14-v0.2.1

This commit is contained in:
Zelophed 2020-03-22 14:42:18 +01:00
commit cbc5eaebf9
9 changed files with 31 additions and 24 deletions

View File

@ -8,6 +8,7 @@ import org.apache.logging.log4j.Logger;
import com.simibubi.create.config.AllConfigs; import com.simibubi.create.config.AllConfigs;
import com.simibubi.create.foundation.command.CreateCommand; import com.simibubi.create.foundation.command.CreateCommand;
import com.simibubi.create.foundation.command.ServerLagger; 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.ModuleLoadedCondition;
import com.simibubi.create.modules.contraptions.TorquePropagator; import com.simibubi.create.modules.contraptions.TorquePropagator;
import com.simibubi.create.modules.logistics.RedstoneLinkNetworkHandler; import com.simibubi.create.modules.logistics.RedstoneLinkNetworkHandler;
@ -62,6 +63,7 @@ public class Create {
modEventBus.addListener(AllConfigs::onLoad); modEventBus.addListener(AllConfigs::onLoad);
modEventBus.addListener(AllConfigs::onReload); modEventBus.addListener(AllConfigs::onReload);
CreateClient.addListeners(modEventBus); CreateClient.addListeners(modEventBus);
AllWorldFeatures.reload();
} }
public static void init(final FMLCommonSetupEvent event) { public static void init(final FMLCommonSetupEvent event) {

View File

@ -20,6 +20,12 @@ public class CWorldGen extends ConfigBase {
super.onReload(); super.onReload();
} }
@Override
public void onLoad() {
AllWorldFeatures.reload();
super.onLoad();
}
@Override @Override
public String getName() { public String getName() {
return "world"; return "world";

View File

@ -136,8 +136,7 @@ public class ItemDescription {
String genSpeed = generatorSpeed(block, rpmUnit); String genSpeed = generatorSpeed(block, rpmUnit);
if (!genSpeed.equals("")) { if (!genSpeed.equals("")) {
add(linesOnShift, ""); add(linesOnShift, GREEN + " " + genSpeed);
add(linesOnShift, GREEN + genSpeed);
} }
} }

View File

@ -37,22 +37,22 @@ public class KineticNetwork {
if (members.containsKey(te)) if (members.containsKey(te))
return; return;
if (te.isSource()) { if (te.isSource()) {
float capacity = te.getAddedStressCapacity(); unloadedCapacity -= lastCapacity * getStressMultiplierForSpeed(te.getGeneratedSpeed());
unloadedCapacity -= capacity * getStressMultiplierForSpeed(te.getGeneratedSpeed()); float addedStressCapacity = te.getAddedStressCapacity();
if (unloadedCapacity < 0) sources.put(te, addedStressCapacity);
unloadedCapacity = 0;
sources.put(te, capacity);
} }
unloadedStress -= lastStress * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
float stressApplied = te.getStressApplied(); float stressApplied = te.getStressApplied();
unloadedStress -= stressApplied * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
if (unloadedStress < 0)
unloadedStress = 0;
members.put(te, stressApplied); members.put(te, stressApplied);
unloadedMembers--; unloadedMembers--;
if (unloadedMembers < 0) if (unloadedMembers < 0)
unloadedMembers = 0; unloadedMembers = 0;
if (unloadedCapacity < 0)
unloadedCapacity = 0;
if (unloadedStress < 0)
unloadedStress = 0;
} }
public void add(KineticTileEntity te) { public void add(KineticTileEntity te) {

View File

@ -102,7 +102,6 @@ public abstract class KineticBlock extends Block implements IRotate {
return; return;
if (worldIn.isRemote()) if (worldIn.isRemote())
return; return;
tileEntity.removeSource();
RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity); RotationPropagator.handleAdded(worldIn.getWorld(), pos, tileEntity);
} }

View File

@ -51,13 +51,12 @@ public abstract class KineticTileEntity extends SmartTileEntity implements ITick
@Override @Override
public void initialize() { public void initialize() {
if (!hasNetwork()) if (hasNetwork()) {
return;
KineticNetwork network = getOrCreateNetwork(); KineticNetwork network = getOrCreateNetwork();
if (!network.initialized) if (!network.initialized)
network.initFromTE(capacity, stress, networkSize); network.initFromTE(capacity, stress, networkSize);
network.addSilently(this, lastCapacityProvided, lastStressApplied); network.addSilently(this, lastCapacityProvided, lastStressApplied);
}
super.initialize(); super.initialize();
} }

View File

@ -31,7 +31,8 @@ public class SawMovementBehaviour extends BlockBreakingMovementBehaviour {
@Override @Override
public boolean canBreak(World world, BlockPos breakingPos, BlockState state) { 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 @Override

View File

@ -32,6 +32,7 @@ public class MotorTileEntity extends GeneratingKineticTileEntity {
generatedSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, slot); generatedSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, slot);
generatedSpeed.between(-max, max); generatedSpeed.between(-max, max);
generatedSpeed.value = DEFAULT_SPEED; generatedSpeed.value = DEFAULT_SPEED;
generatedSpeed.scrollableValue = DEFAULT_SPEED;
generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm")); generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
generatedSpeed.withCallback(i -> this.updateGeneratedRotation()); generatedSpeed.withCallback(i -> this.updateGeneratedRotation());
generatedSpeed.withStepFunction(MotorTileEntity::step); generatedSpeed.withStepFunction(MotorTileEntity::step);