Skip to content

Commit

Permalink
Merge pull request #177 from Anuken/erekir
Browse files Browse the repository at this point in the history
Fixed StackOverflow on init
  • Loading branch information
sk7725 authored May 16, 2023
2 parents 87bf06e + 99a6b13 commit 95def54
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 104 deletions.
4 changes: 2 additions & 2 deletions assets/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"author": "[royal]sk7725[]",
"description": "My first Java mod, has the same amount of chaotic energy of sk7725/Commandblocks.",
"subtitle": "Demo of Chaos Itself",
"version": "1.09",
"version": "1.1",
"main": "betamindy.BetaMindy",
"minGameVersion": "138",
"minGameVersion": "144",
"dependencies": [],
"hidden": false
}
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ repositories{

dependencies{
annotationProcessor 'com.github.Anuken:jabel:0.8.0'
compileOnly "com.github.Anuken.Mindustry:core:v138"
compileOnly "com.github.Anuken.Arc:flabel:v138"
compileOnly "com.github.Anuken.Arc:arc-core:v138"
compileOnly "com.github.Anuken.MindustryJitpack:core:v144"
compileOnly "com.github.Anuken.Arc:arc-core:v144"
}

jar.archiveFileName.set("raw-$artifactFilename")
Expand Down
3 changes: 0 additions & 3 deletions src/betamindy/BetaMindy.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ public void init(){

hints.load();
mui.init();
UnitLib.init();
});

Events.run(ServerLoadEvent.class, UnitLib::init);

Events.run(WorldLoadEvent.class, () -> {
if(!headless){
Useful.unlockCam();
Expand Down
4 changes: 1 addition & 3 deletions src/betamindy/util/ScoreLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ public float getScoreUnit(UnitType unit){
float score = getScoreUnitWeapons(unit);

score += (unit.health * 0.3f + unit.dpsEstimate * 0.2f) * unit.speed * Math.max(unit.mineTier, 1f) * Math.max(unit.abilities.size, 1);
score += getStacksCost(UnitLib.calcCost(unit));
score += getStacksCost(unit.getTotalRequirements());

return score;
}

public void itemsLoad(){
UnitLib.init();

Seq<Item> tmpItemArray = new Seq<>();
Seq<Float> tmpItemScores = new Seq<>();
Seq<Integer> tmpItemTypes = new Seq<>();
Expand Down
92 changes: 0 additions & 92 deletions src/betamindy/util/UnitLib.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ItemStack[] payloadCost(Payload pay){
return ((BuildPayload)pay).block().requirements;
}
else if(pay instanceof UnitPayload){
return UnitLib.costs.get(((UnitPayload)pay).unit.type);
return ((UnitPayload)pay).unit.type.getTotalRequirements();
}
return defaultStack;
}
Expand Down

0 comments on commit 95def54

Please sign in to comment.