From a2dd2c88a283403157fa4de3c70dfcc2bf62b55d Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 20 Jun 2023 13:09:50 -0400 Subject: [PATCH] Fixed #8733 --- core/src/mindustry/game/Waves.java | 18 +++++++++--------- core/src/mindustry/logic/LAssembler.java | 2 +- core/src/mindustry/mod/Mods.java | 2 +- .../ui/fragments/PlayerListFragment.java | 2 +- .../world/blocks/units/UnitFactory.java | 2 +- gradle.properties | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/src/mindustry/game/Waves.java b/core/src/mindustry/game/Waves.java index ea59f4224c..563d809f77 100644 --- a/core/src/mindustry/game/Waves.java +++ b/core/src/mindustry/game/Waves.java @@ -10,7 +10,7 @@ import mindustry.type.*; import static mindustry.content.UnitTypes.*; public class Waves{ - public static final int waveVersion = 6; + public static final int waveVersion = 7; private Seq spawns; @@ -303,7 +303,7 @@ public class Waves{ Intc createProgression = start -> { //main sequence - UnitType[] curSpecies = Structs.random(fspec); + UnitType[] curSpecies = Structs.random(rand, fspec); int curTier = 0; for(int i = start; i < cap;){ @@ -348,7 +348,7 @@ public class Waves{ //small chance to switch species if(rand.chance(0.3)){ - curSpecies = Structs.random(fspec); + curSpecies = Structs.random(rand, fspec); } } }; @@ -368,7 +368,7 @@ public class Waves{ int bossTier = difficulty < 0.6 ? 3 : 4; //main boss progression - out.add(new SpawnGroup(Structs.random(species)[bossTier]){{ + out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{ unitAmount = 1; begin = bossWave; spacing = bossSpacing; @@ -380,7 +380,7 @@ public class Waves{ }}); //alt boss progression - out.add(new SpawnGroup(Structs.random(species)[bossTier]){{ + out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{ unitAmount = 1; begin = bossWave + rand.random(3, 5) * bossSpacing; spacing = bossSpacing; @@ -394,7 +394,7 @@ public class Waves{ int finalBossStart = 120 + rand.random(30); //final boss waves - out.add(new SpawnGroup(Structs.random(species)[bossTier]){{ + out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{ unitAmount = 1; begin = finalBossStart; spacing = bossSpacing/2; @@ -406,7 +406,7 @@ public class Waves{ }}); //final boss waves (alt) - out.add(new SpawnGroup(Structs.random(species)[bossTier]){{ + out.add(new SpawnGroup(Structs.random(rand, species)[bossTier]){{ unitAmount = 1; begin = finalBossStart + 15; spacing = bossSpacing/2; @@ -419,10 +419,10 @@ public class Waves{ //add megas to heal the base. if(attack && difficulty >= 0.5){ - int amount = Mathf.random(1, 3 + (int)(difficulty*2)); + int amount = rand.random(1, 3 + (int)(difficulty*2)); for(int i = 0; i < amount; i++){ - int wave = Mathf.random(3, 20); + int wave = rand.random(3, 20); out.add(new SpawnGroup(mega){{ unitAmount = 1; begin = wave; diff --git a/core/src/mindustry/logic/LAssembler.java b/core/src/mindustry/logic/LAssembler.java index a18194f44d..17d0d69bb2 100644 --- a/core/src/mindustry/logic/LAssembler.java +++ b/core/src/mindustry/logic/LAssembler.java @@ -34,7 +34,7 @@ public class LAssembler{ Seq st = read(data, privileged); - asm.instructions = st.map(l -> l.build(asm)).filter(l -> l != null).toArray(LInstruction.class); + asm.instructions = st.map(l -> l.build(asm)).retainAll(l -> l != null).toArray(LInstruction.class); return asm; } diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 601ad1f41a..11f3e6b5ff 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -424,7 +424,7 @@ public class Mods implements Loadable{ // Add local mods Seq.with(modDirectory.list()) - .filter(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && Structs.contains(metaFiles, meta -> f.child(meta).exists()))) + .retainAll(f -> f.extEquals("jar") || f.extEquals("zip") || (f.isDirectory() && Structs.contains(metaFiles, meta -> f.child(meta).exists()))) .each(candidates::add); // Add Steam workshop mods diff --git a/core/src/mindustry/ui/fragments/PlayerListFragment.java b/core/src/mindustry/ui/fragments/PlayerListFragment.java index 983a835ab8..efdf671cdb 100644 --- a/core/src/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/mindustry/ui/fragments/PlayerListFragment.java @@ -85,7 +85,7 @@ public class PlayerListFragment{ players.sort(Structs.comps(Structs.comparing(Player::team), Structs.comparingBool(p -> !p.admin))); if(search.getText().length() > 0){ - players.filter(p -> Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase())); + players.retainAll(p -> Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase())); } for(var user : players){ diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index 0f4293cb83..b4dba33998 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -212,7 +212,7 @@ public class UnitFactory extends UnitBlock{ @Override public void buildConfiguration(Table table){ - Seq units = Seq.with(plans).map(u -> u.unit).filter(u -> u.unlockedNow() && !u.isBanned()); + Seq units = Seq.with(plans).map(u -> u.unit).retainAll(u -> u.unlockedNow() && !u.isBanned()); if(units.any()){ ItemSelection.buildTable(UnitFactory.this, table, units, () -> currentPlan == -1 ? null : plans.get(currentPlan).unit, unit -> configure(plans.indexOf(u -> u.unit == unit)), selectionRows, selectionColumns); diff --git a/gradle.properties b/gradle.properties index 4ca67cb5b5..837e002445 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=b718875065 +archash=93f098213f