From 1a6d2e9dd697d723de9b5e51beef61467d7140a6 Mon Sep 17 00:00:00 2001 From: TranquillyUnpleasant <62061444+TranquillyUnpleasant@users.noreply.github.com> Date: Sun, 31 Oct 2021 18:30:33 +0500 Subject: [PATCH 1/5] fix ai (#6273) --- core/src/mindustry/ai/Pathfinder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index de447c3a59..9652c73d07 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -54,9 +54,9 @@ public class Pathfinder implements Runnable{ (PathTile.solid(tile) ? 5 : 0), //water - (team, tile) -> PathTile.solid(tile) || !PathTile.liquid(tile) ? 200 : 2 + + (team, tile) -> (PathTile.solid(tile) || !PathTile.liquid(tile) ? 6000 : 1) + (PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) + - (PathTile.deep(tile) ? -1 : 0) + + (PathTile.deep(tile) ? 0 : 1) + (PathTile.damages(tile) ? 35 : 0) ); From d16739f86adf100f9932d868949091cac11eac9e Mon Sep 17 00:00:00 2001 From: Leonid Skorospelov Date: Sun, 31 Oct 2021 13:31:53 +0000 Subject: [PATCH 2/5] Add event PlayerConnectionConfirmed (#6274) --- core/src/mindustry/core/NetServer.java | 2 ++ core/src/mindustry/game/EventType.java | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 39ddb35bb9..9a72f7ad51 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -757,6 +757,8 @@ public class NetServer implements ApplicationListener{ player.add(); + Events.fire(new PlayerConnectionConfirmed(player)); + if(player.con == null || player.con.hasConnected) return; player.con.hasConnected = true; diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 452f07c3e6..26d7dcb740 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -480,7 +480,19 @@ public class EventType{ } } - /** Called after connecting; when a player receives world data and is ready to play.*/ + /** + * Called after player confirmed it has received world data and is ready to play. + * Note that if this is the first world receival, then player.con.hasConnected is false. + */ + public static class PlayerConnectionConfirmed{ + public final Player player; + + public PlayerConnectionConfirmed(Player player){ + this.player = player; + } + } + + /** Called after connecting; when a player receives world data and is ready to play. Fired only once, after initial connection. */ public static class PlayerJoin{ public final Player player; From 24810ddbf5b99c222ec4c3710b12a5d61182bbef Mon Sep 17 00:00:00 2001 From: Zelaux <58040045+Zelaux@users.noreply.github.com> Date: Sun, 31 Oct 2021 18:35:16 +0500 Subject: [PATCH 3/5] Block classes are now responsible for flipping of blocks in schematics. (#6254) --- core/src/mindustry/input/InputHandler.java | 4 +--- core/src/mindustry/world/Block.java | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 3ce9851aaf..0bcc17727e 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -696,9 +696,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ }); //flip rotation - if(x == (req.rotation % 2 == 0)){ - req.rotation = Mathf.mod(req.rotation + 2, 4); - } + req.block.flipRotation(req, x); }); } diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 0327c36ab0..167f7e8b4b 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -468,7 +468,7 @@ public class Block extends UnlockableContent{ if(hasItems && configurable){ bars.add("items", entity -> new Bar(() -> Core.bundle.format("bar.items", entity.items.total()), () -> Pal.items, () -> (float)entity.items.total() / itemCapacity)); } - + if(unitCapModifier != 0){ stats.add(Stat.maxUnits, (unitCapModifier < 0 ? "-" : "+") + Math.abs(unitCapModifier)); } @@ -824,7 +824,7 @@ public class Block extends UnlockableContent{ } clipSize = Math.max(clipSize, size * tilesize); - + //only kept to ensure compatibility with v6 mods. if(expanded){ clipSize += tilesize * 10f; @@ -989,4 +989,9 @@ public class Block extends UnlockableContent{ packer.add(PageType.editor, name + "-icon-editor", editorBase); } + public void flipRotation(BuildPlan req, boolean x){ + if(x == (req.rotation % 2 == 0)){ + req.rotation = Mathf.mod(req.rotation + 2, 4); + } + } } From 4999c257230908f73270a7c774e145fe389c37f6 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 31 Oct 2021 10:03:19 -0700 Subject: [PATCH 4/5] Homing on healing bullets does not take collided into account (#6276) --- core/src/mindustry/entities/bullet/BulletType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 7e515281bb..8836c6b5cd 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -359,8 +359,9 @@ public class BulletType extends Content implements Cloneable{ //home in on allies if possible if(healPercent > 0){ target = Units.closestTarget(null, b.x, b.y, homingRange, - e -> e.checkTarget(collidesAir, collidesGround) && e.team != b.team, - t -> collidesGround && (t.team != b.team || t.damaged())); + e -> e.checkTarget(collidesAir, collidesGround) && e.team != b.team && !b.hasCollided(e.id), + t -> collidesGround && (t.team != b.team || t.damaged()) && !b.hasCollided(t.id) + ); }else{ target = Units.closestTarget(b.team, b.x, b.y, homingRange, e -> e.checkTarget(collidesAir, collidesGround) && !b.hasCollided(e.id), t -> collidesGround && !b.hasCollided(t.id)); } From 34180a66027404b8d8fa32a3bd615dd0ac9ce583 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Sun, 31 Oct 2021 13:19:37 -0400 Subject: [PATCH 5/5] AdoptOpenJDK -> Adoptium (#6275) AdoptOpenJDK has been replaced by adoptium --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2756d1ed1..ce534d7c63 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ See [CONTRIBUTING](CONTRIBUTING.md). Bleeding-edge builds are generated automatically for every commit. You can see them [here](https://github.com/Anuken/MindustryBuilds/releases). If you'd rather compile on your own, follow these instructions. -First, make sure you have [JDK 16-17](https://adoptopenjdk.net/archive.html?variant=openjdk16&jvmVariant=hotspot) installed. **Other JDK versions will not work.** Open a terminal in the Mindustry directory and run the following commands: +First, make sure you have [JDK 16-17](https://adoptium.net/archive.html?variant=openjdk17&jvmVariant=hotspot) installed. **Other JDK versions will not work.** Open a terminal in the Mindustry directory and run the following commands: ### Windows