diff --git a/build.gradle b/build.gradle index 342a85c96c8d..d051101a24a1 100644 --- a/build.gradle +++ b/build.gradle @@ -185,7 +185,7 @@ allprojects{ tasks.withType(JavaCompile){ targetCompatibility = 8 - sourceCompatibility = JavaVersion.VERSION_16 + sourceCompatibility = JavaVersion.VERSION_17 options.encoding = "UTF-8" options.compilerArgs += ["-Xlint:deprecation"] dependsOn clearCache diff --git a/core/src/mindustry/audio/SoundControl.java b/core/src/mindustry/audio/SoundControl.java index f035306b2ccf..980166227ad1 100644 --- a/core/src/mindustry/audio/SoundControl.java +++ b/core/src/mindustry/audio/SoundControl.java @@ -17,7 +17,7 @@ /** Controls playback of multiple audio tracks.*/ public class SoundControl{ - public float finTime = 120f, foutTime = 120f, musicInterval = 3f * Time.toMinutes, musicChance = 0.6f, musicWaveChance = 0.46f; + public float finTime = 120f, foutTime = 120f, musicInterval = 3f * Time.toMinutes, musicChance = 0.8f, musicWaveChance = 0.46f; /** normal, ambient music, plays at any time */ public Seq ambientMusic = Seq.with(); @@ -28,6 +28,7 @@ public class SoundControl{ protected Music lastRandomPlayed; protected Interval timer = new Interval(4); + protected long lastPlayed; protected @Nullable Music current; protected float fade; protected boolean silenced; @@ -55,6 +56,10 @@ public SoundControl(){ })); setupFilters(); + + Events.on(ResetEvent.class, e -> { + lastPlayed = Time.millis(); + }); } protected void setupFilters(){ @@ -160,9 +165,10 @@ public void update(){ silence(); //play music at intervals - if(timer.get(musicInterval)){ + if(Time.timeSinceMillis(lastPlayed) > 1000 * musicInterval / 60f){ //chance to play it per interval if(Mathf.chance(musicChance)){ + lastPlayed = Time.millis(); playRandom(); } } diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 1275b3b16960..c86f3ffe5628 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2433,6 +2433,7 @@ public static void load(){ itemDuration = 140f; ambientSound = Sounds.pulse; ambientSoundVolume = 0.07f; + liquidCapacity = 60f; consumePower(25f); consumeItem(Items.blastCompound); diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index aea4dde5c5f6..16a09e89901e 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -105,6 +105,8 @@ public class Rules{ public boolean coreDestroyClear = false; /** If true, banned blocks are hidden from the build menu. */ public boolean hideBannedBlocks = false; + /** If true, most blocks (including environmental walls) can be deconstructed. This is only meant to be used internally in sandbox/test maps. */ + public boolean allowEnvironmentDeconstruct = false; /** If true, bannedBlocks becomes a whitelist. */ public boolean blockWhitelist = false; /** If true, bannedUnits becomes a whitelist. */ diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index b7f5163e60c4..44e03ef12c81 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -1230,7 +1230,6 @@ public static class WaitI implements LInstruction{ public int value; public float curTime; - public long frameId; public WaitI(int value){ this.value = value; @@ -1247,11 +1246,7 @@ public void run(LExecutor exec){ //skip back to self. exec.var(varCounter).numval --; exec.yield = true; - } - - if(state.updateId != frameId){ curTime += Time.delta / 60f; - frameId = state.updateId; } } } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index d49e2e7a2119..b5855f69b5e2 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -960,7 +960,7 @@ public void createIcons(MultiPacker packer){ getRegionsToOutline(toOutline); for(var region : toOutline){ - if(region instanceof AtlasRegion atlas){ + if(region instanceof AtlasRegion atlas && !Core.atlas.has(atlas.name + "-outline")){ String regionName = atlas.name; Pixmap outlined = Pixmaps.outline(Core.atlas.getPixmap(region), outlineColor, outlineRadius); diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 0864d670eb60..0dc98432085e 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -366,7 +366,7 @@ public void update(Unit unit, WeaponMount mount){ mount.bullet.set(bulletX, bulletY); mount.reload = reload; mount.recoil = 1f; - unit.vel.add(Tmp.v1.trns(unit.rotation + 180f, mount.bullet.type.recoil * Time.delta)); + unit.vel.add(Tmp.v1.trns(mount.bullet.rotation() + 180f, mount.bullet.type.recoil * Time.delta)); if(shootSound != Sounds.none && !headless){ if(mount.sound == null) mount.sound = new SoundLoop(shootSound, 1f); mount.sound.update(bulletX, bulletY, true); diff --git a/core/src/mindustry/world/Build.java b/core/src/mindustry/world/Build.java index 4377eb521a4e..42c37c3bcfad 100644 --- a/core/src/mindustry/world/Build.java +++ b/core/src/mindustry/world/Build.java @@ -281,9 +281,9 @@ public static boolean contactsShallows(int x, int y, Block block){ return false; } - /** Returns whether the tile at this position is breakable by this team */ + /** @return whether the tile at this position is breakable by this team */ public static boolean validBreak(Team team, int x, int y){ Tile tile = world.tile(x, y); - return tile != null && tile.block().canBreak(tile) && tile.breakable() && tile.interactable(team); + return tile != null && tile.block() != Blocks.air && (tile.block().canBreak(tile) && (tile.breakable() || state.rules.allowEnvironmentDeconstruct)) && tile.interactable(team); } } diff --git a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java index 97e38584f766..2c0077cc9955 100644 --- a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java +++ b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java @@ -40,6 +40,7 @@ public DirectionBridge(String name){ priority = TargetPriority.transport; envEnabled = Env.space | Env.terrestrial | Env.underwater; drawArrow = false; + allowDiagonal = false; regionRotated1 = 1; } diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 8688ae7889b1..2663365fc253 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -53,6 +53,7 @@ public ItemBridge(String name){ unloadable = false; group = BlockGroup.transportation; noUpdateDisabled = true; + allowDiagonal = false; copyConfig = false; //disabled as to not be annoying allowConfigInventory = false; diff --git a/gradle.properties b/gradle.properties index b18f49c04787..e69588eb44f9 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=8fdcdbfccc +archash=137d14855f diff --git a/servers_v7.json b/servers_v7.json index d6b3b00ba35b..9700334f24c9 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -9,7 +9,7 @@ }, { "name": "meiqiuMDT", - "address": ["cn1.meiqiumdy.top:7000","cn1.meiqiumdt.top:7002","cn1.meiqiumdt.top:7006","bj-1.lcf.icu:10240"] + "address": ["cn1.meiqiumdy.top:7000","cn1.meiqiumdt.top:7002","cn1.meiqiumdt.top:7006","cn1.meiqiumdt.top:7013"] }, { "name": "Crux's Revelations", @@ -17,7 +17,7 @@ }, { "name": "CMS Empire", - "address": ["195.2.84.144","178.20.45.250"] + "address": ["195.2.84.144","95.84.198.97"] }, { "name": "ShardDustry Eventos", @@ -230,7 +230,7 @@ }, { "name": "ABCXYZ Community", - "address": ["23.88.73.88:23591", "23.88.73.88:23539", "144.76.57.59:14996", "144.76.57.59:16881", "144.76.57.59:13885", "23.88.73.88:32113", "144.76.57.59:9269", "144.76.57.59:24235", "144.76.57.59:24133", "140.238.246.78:7000", "5.9.8.124:28848"] + "address": ["23.88.73.88:23591", "23.88.73.88:23539", "144.76.57.59:14996", "144.76.57.59:16881", "144.76.57.59:13885", "23.88.73.88:32113", "144.76.57.59:9269", "144.76.57.59:24235", "144.76.57.59:24133", "140.238.246.78:7000", "5.9.8.124:28848", "free2.titaniumhost.tech:25669"] }, { "name": "CroCraft Network", @@ -242,7 +242,7 @@ }, { "name": "Alex Multiverse", - "address": ["alexmindustryv7.servegame.com:25588", "172.234.80.96:6768", "139.162.41.78:6767", "172.245.187.143:6868", "172.245.187.143:6869" ] + "address": ["alexmindustryv7.servegame.com:25588", "172.234.80.96:6768", "139.162.41.78:6767", "172.245.187.143:6868", "172.245.187.143:6869", "92.119.127.171:6888" ] }, { "name": "Open PVP", @@ -252,10 +252,6 @@ "name": "XuwenHost", "address": ["mdt.xuwenblock.cn:6568","mdt.xuwenblock.cn:6567","106.14.14.210"] }, - { - "name": "MineCore", - "address": ["194.247.42.11:27792"] - }, { "name": "Atomic", "address": ["atomic-de.ddns.net:35199", "atomic-de.ddns.net:35176", "atomic-de.ddns.net:35845", "atomic-de.ddns.net:35313"] @@ -266,14 +262,22 @@ }, { "name": "Gadgetroch's Server", - "address": ["mindustry.gadgetroch.com", "mindustry.gadgetroch.com:6568"] + "address": ["mindustry.gadgetroch.com", "mindustry.gadgetroch.com:6568", "mindustry.gadgetroch.com:6569"] }, { "name": "Duel.Server", - "address":["160.251.41.148:6568","160.251.41.148:6569"] + "address":["160.251.41.148:6567","160.251.41.148:6568","160.251.41.148:6569","160.251.41.148:6570"] }, { "name": "AZDustry", "address": ["118.127.8.162:25628"] + }, + { + "name": "Erepulo", + "address": ["95.84.198.97:5401", "95.84.198.97:5402", "95.84.198.97:5403"] + }, + { + "name": "MineCore", + "address": ["194.247.42.11:27792", "194.247.42.11:27977", "194.247.42.61:27989", "194.247.42.181:28514"] } ]