Skip to content

Commit

Permalink
202402131227
Browse files Browse the repository at this point in the history
  • Loading branch information
PiggyChu620 committed Feb 12, 2024
1 parent aa16771 commit b77d756
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mindustry Java Mod - Random Planet v0.4.6
# Mindustry Java Mod - Random Planet v0.4.7
A Java Mindustry mod.

Randomly generate a planet and its sectors, including the starting sector.
Expand Down Expand Up @@ -131,6 +131,10 @@ I combined both technologies from Serpulo and Erekir as best as I could, includi
*v0.4.6*
- Fix new sector loading forever if Mineable Alloys is not installed.

*v0.4.7*
- Change versioning to Semantic (Major.Minor/New Features.Patch/Bug fixes).
- Change type of ores per sector to a minimum of 5.

---

**1.** [Schematic Instruction](SchematicInstruction.md)
Expand Down
4 changes: 2 additions & 2 deletions mod.hjson
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#the mod name as displayed in-game
displayName: "Random Planet v0.4.6"
displayName: "Random Planet v0.4.7"

repo: "PiggyChu620/MindustryRandomPlanet"

Expand All @@ -16,7 +16,7 @@ main: "ec620.EC620JavaMod"
description: "Randomly generate a planet and its sectors.\nIt's a mixtech mod, I myself don't like the idea of \"Oh, you can only use these things here, and you can only use those things there, bruh, bruh, bruh!\", so I make one myself, if you don't like mixtech and think it's \"unbalanced\" and \"boring\", then please go away, much appreciated!"

#the mod version
version: 0.4.6
version: 0.4.7

#the minimum game build required to run this mod
minGameVersion: 140
Expand Down
2 changes: 1 addition & 1 deletion src/ec620/EC620JavaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public EC620JavaMod()
dd.titleFont= Fonts.def;
dd.titleFontColor=new Color(1,0,0);
BaseDialog dialog = new BaseDialog("Random Planet", dd);
dialog.cont.add("Welcome to Random Planet v0.4.6",Color.green,1.2f).center().row();
dialog.cont.add("Welcome to Random Planet v0.4.7",Color.green,1.2f).center().row();
dialog.cont.add("Please see Settings for customization",Color.cyan).center().row();
//dialog.cont.add("in order to see the setting info,",Color.cyan).row();
//dialog.cont.add("I can not figure out how to make it wrap,",Color.cyan).row();
Expand Down
17 changes: 14 additions & 3 deletions src/ec620/content/EC620PlanetGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ void setOre(Block block)
Seq<Block> ores = Seq.with(oreCopper,oreLead);
Seq<Block> availableOres= content.blocks().select(b->b instanceof OreBlock && !ores.contains(b) && !b.itemDrop.hidden);
int l= availableOres.size;
if(l<5) l=5;

if(sector.id==0)
{
Expand All @@ -599,13 +598,25 @@ void setOre(Block block)
{
Block b=availableOres.get(i);
String name="ma620."+b.name;
if(Core.settings.has(name)) if(pgRand.chance(Core.settings.getFloat(name)/100f)) ores.add(b);
else if(pgRand.nextDouble()*2>=b.itemDrop.cost) ores.add(b);
if(Core.settings.has(name))
{
if(!ores.contains(b) && pgRand.chance(Core.settings.getFloat(name)/100f)) ores.add(b);
}
else if(!ores.contains(b) && pgRand.nextDouble()*2>=b.itemDrop.cost) ores.add(b);
// if(Simplex.noise3d(seed, 2, 0.5, scl, sector.tile.v.x+i, sector.tile.v.y, sector.tile.v.z)*nmag + poles > (i+1)*addscl/(l+1))
// {
// ores.add(availableOres.get(i));
// }
}
if(ores.size<5)
{
for(int i=0;i<l;i++)
{
Block b=availableOres.get(i);
if(!ores.contains(b)) ores.add(b);
if(ores.size>=5) break;
}
}
// while(ores.size<5)
// {
// Block b=availableOres.getFrac(pgRand.nextFloat());
Expand Down

0 comments on commit b77d756

Please sign in to comment.