Removed default loadout from generator

This commit is contained in:
Anuken
2026-09-11 14:50:26 -04:00
parent 1a34b786a7
commit 240d7667f6
8 changed files with 11 additions and 10 deletions
+1
View File
@@ -182,6 +182,7 @@ public class Planets{
clipRadius = 2f;
defaultEnv = Env.space;
icon = "commandRally";
defaultCore = Blocks.coreBastion;
generator = new AsteroidGenerator();
cgen.get((AsteroidGenerator)generator);
+4
View File
@@ -123,6 +123,10 @@ public class Schematic implements Publishable, Comparable<Schematic>{
return name().compareTo(schematic.name());
}
public static Schematic ofBlock(Block block){
return new Schematic(Seq.with(new Stile(block, 0, 0, null, (byte)0)), new StringMap(), block.size, block.size);
}
public static class Stile{
public Block block;
public short x, y;
+1 -1
View File
@@ -127,7 +127,7 @@ public class Universe{
}
public Schematic getLastLoadout(){
if(lastLoadout == null) lastLoadout = state.rules.sector == null || state.rules.sector.planet.generator == null ? Loadouts.basicShard : state.rules.sector.planet.generator.defaultLoadout;
if(lastLoadout == null) lastLoadout = state.rules.sector == null ? Loadouts.basicShard : state.rules.sector.planet.defaultLoadout;
return lastLoadout;
}
@@ -9,7 +9,6 @@ import mindustry.*;
import mindustry.ai.*;
import mindustry.ai.Astar.*;
import mindustry.content.*;
import mindustry.game.*;
import mindustry.world.*;
import mindustry.world.blocks.environment.*;
@@ -26,8 +25,6 @@ public abstract class BasicGenerator implements WorldGenerator{
//for drawing
protected @Nullable Block floor, block, ore;
public Schematic defaultLoadout = Loadouts.basicShard;
@Override
public void generate(Tiles tiles, WorldParams params){
this.tiles = tiles;
@@ -24,10 +24,6 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
@Nullable Rand rand;
int seed;
{
defaultLoadout = Loadouts.basicNucleus;
}
void asteroid(int ax, int ay, int radius){
Floor floor = (
rand.chance(iceChance) ? Blocks.ice :
@@ -30,7 +30,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
{
baseSeed = 2;
defaultLoadout = Loadouts.basicBastion;
}
@Override
+4
View File
@@ -151,6 +151,8 @@ public class Planet extends UnlockableContent{
public boolean alwaysPlayMusic = false;
/** Default core block for launching. */
public Block defaultCore = Blocks.coreShard;
/** Default loadout schematic; if not set, gets initialized to the default core provided. */
public @Nullable Schematic defaultLoadout;
/** Parent body that this planet orbits around. If null, this planet is considered to be in the middle of the solar system. */
public @Nullable Planet parent;
/** The root parent of the whole solar system this planet is in. */
@@ -451,6 +453,8 @@ public class Planet extends UnlockableContent{
loadRules();
loadStats();
if(defaultLoadout == null) defaultLoadout = Schematic.ofBlock(defaultCore);
if(techTree == null){
techTree = TechTree.roots.find(n -> n.planet == this);
}
+1 -1
View File
@@ -26,4 +26,4 @@ org.gradle.caching=true
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false
archash=b43a5b04ce
archash=fa3f8b009d