mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 03:00:29 +03:00
Removed default loadout from generator
This commit is contained in:
@@ -182,6 +182,7 @@ public class Planets{
|
||||
clipRadius = 2f;
|
||||
defaultEnv = Env.space;
|
||||
icon = "commandRally";
|
||||
defaultCore = Blocks.coreBastion;
|
||||
generator = new AsteroidGenerator();
|
||||
cgen.get((AsteroidGenerator)generator);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user