Cleanup
This commit is contained in:
@@ -429,8 +429,6 @@ public class TechTree implements ContentList{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO research sectors
|
|
||||||
|
|
||||||
node(groundZero, () -> {
|
node(groundZero, () -> {
|
||||||
node(frozenForest, Seq.with(
|
node(frozenForest, Seq.with(
|
||||||
new SectorComplete(groundZero),
|
new SectorComplete(groundZero),
|
||||||
@@ -579,7 +577,7 @@ public class TechTree implements ContentList{
|
|||||||
public ItemStack[] requirements;
|
public ItemStack[] requirements;
|
||||||
/** Requirements that have been fulfilled. Always the same length as the requirement array. */
|
/** Requirements that have been fulfilled. Always the same length as the requirement array. */
|
||||||
public final ItemStack[] finishedRequirements;
|
public final ItemStack[] finishedRequirements;
|
||||||
/** Extra objectives needed to research this. TODO implement */
|
/** Extra objectives needed to research this. */
|
||||||
public Seq<Objective> objectives = new Seq<>();
|
public Seq<Objective> objectives = new Seq<>();
|
||||||
/** Time required to research this content, in seconds. */
|
/** Time required to research this content, in seconds. */
|
||||||
public float time;
|
public float time;
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ abstract class BuilderComp implements Unitc{
|
|||||||
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
boolean shouldSkip(BuildPlan request, @Nullable Building core){
|
||||||
//requests that you have at least *started* are considered
|
//requests that you have at least *started* are considered
|
||||||
if(state.rules.infiniteResources || team().rules().infiniteResources || request.breaking || core == null) return false;
|
if(state.rules.infiniteResources || team().rules().infiniteResources || request.breaking || core == null) return false;
|
||||||
//TODO these are bad criteria
|
|
||||||
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item)) && !request.initialized);
|
return (request.stuck && !core.items.has(request.block.requirements)) || (Structs.contains(request.block.requirements, i -> !core.items.has(i.item)) && !request.initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class CommandIssueEvent{
|
public static class CommandIssueEvent{
|
||||||
public final Building tile;
|
public final Building tile;
|
||||||
public final UnitCommand command;
|
public final UnitCommand command;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import mindustry.world.blocks.production.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class PayloadConveyor extends Block{
|
public class PayloadConveyor extends Block{
|
||||||
public float moveTime = 70f;
|
public float moveTime = 60f;
|
||||||
public @Load("@-top") TextureRegion topRegion;
|
public @Load("@-top") TextureRegion topRegion;
|
||||||
public @Load("@-edge") TextureRegion edgeRegion;
|
public @Load("@-edge") TextureRegion edgeRegion;
|
||||||
public Interp interp = Interp.pow5;
|
public Interp interp = Interp.pow5;
|
||||||
@@ -98,7 +98,7 @@ public class PayloadConveyor extends Block{
|
|||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
if(!enabled) return;
|
if(!enabled) return;
|
||||||
|
|
||||||
progress = Time.time() % moveTime;
|
progress = time() % moveTime;
|
||||||
|
|
||||||
updatePayload();
|
updatePayload();
|
||||||
|
|
||||||
@@ -187,6 +187,10 @@ public class PayloadConveyor extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float time(){
|
||||||
|
return Time.time();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptPayload(Building source, Payload payload){
|
public boolean acceptPayload(Building source, Payload payload){
|
||||||
//accepting payloads from units isn't supported
|
//accepting payloads from units isn't supported
|
||||||
@@ -276,7 +280,7 @@ public class PayloadConveyor extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int curStep(){
|
public int curStep(){
|
||||||
return (int)((Time.time()) / moveTime);
|
return (int)((time()) / moveTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float fract(){
|
public float fract(){
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public enum BlockFlag{
|
|||||||
turret,
|
turret,
|
||||||
/** Repair point. */
|
/** Repair point. */
|
||||||
repair,
|
repair,
|
||||||
/** Rally point. TODO remove*/
|
/** Rally point. */
|
||||||
rally,
|
rally,
|
||||||
/** Any block that boosts unit capacity. */
|
/** Any block that boosts unit capacity. */
|
||||||
unitModifier;
|
unitModifier;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
private Fi currentLogFile;
|
private Fi currentLogFile;
|
||||||
private boolean inExtraRound;
|
private boolean inExtraRound;
|
||||||
private Task lastTask;
|
private Task lastTask;
|
||||||
private Gamemode lastMode = Gamemode.survival;
|
private Gamemode lastMode;
|
||||||
private @Nullable Map nextMapOverride;
|
private @Nullable Map nextMapOverride;
|
||||||
private Interval autosaveCount = new Interval();
|
private Interval autosaveCount = new Interval();
|
||||||
|
|
||||||
@@ -67,6 +67,12 @@ public class ServerControl implements ApplicationListener{
|
|||||||
//update log level
|
//update log level
|
||||||
Config.debug.set(Config.debug.bool());
|
Config.debug.set(Config.debug.bool());
|
||||||
|
|
||||||
|
try{
|
||||||
|
lastMode = Gamemode.valueOf(Core.settings.getString("lastServerMode", "survival"));
|
||||||
|
}catch(Exception e){ //handle enum parse exception
|
||||||
|
lastMode = Gamemode.survival;
|
||||||
|
}
|
||||||
|
|
||||||
Log.setLogger((level, text) -> {
|
Log.setLogger((level, text) -> {
|
||||||
String result = "[" + dateTime.format(LocalDateTime.now()) + "] " + format(tags[level.ordinal()] + " " + text + "&fr");
|
String result = "[" + dateTime.format(LocalDateTime.now()) + "] " + format(tags[level.ordinal()] + " " + text + "&fr");
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
@@ -304,6 +310,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
|
|
||||||
logic.reset();
|
logic.reset();
|
||||||
lastMode = preset;
|
lastMode = preset;
|
||||||
|
Core.settings.put("lastServerMode", lastMode.name());
|
||||||
try{
|
try{
|
||||||
world.loadMap(result, result.applyRules(lastMode));
|
world.loadMap(result, result.applyRules(lastMode));
|
||||||
state.rules = result.applyRules(preset);
|
state.rules = result.applyRules(preset);
|
||||||
|
|||||||
Reference in New Issue
Block a user