diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 6e0a662482..a0d3fd7682 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1544,6 +1544,8 @@ lenum.configure = Building configuration, e.g. sorter item. lenum.enabled = Whether the block is enabled. laccess.color = Illuminator color. +laccess.controller = Unit controller. If processor controlled, returns processor.\nIf in a formation, returns leader.\nOtherwise, returns the unit itself. +laccess.dead = Whether a unit/building is dead or no longer valid. graphicstype.clear = Fill the display with a color. graphicstype.color = Set color for next drawing operations. diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index ae987d7592..407fe6a9d1 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1312,7 +1312,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return switch(sensor){ case x -> World.conv(x); case y -> World.conv(y); - //case dead -> !isValid(); //TODO 126 + case dead -> !isValid() ? 1 : 0; case team -> team.id; case health -> health; case maxHealth -> maxHealth; diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 83dcf435c1..e6afbc4f1a 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -128,7 +128,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I case ammoCapacity -> type.ammoCapacity; case x -> World.conv(x); case y -> World.conv(y); - //case dead -> dead || !isAdded(); //TODO 126 + case dead -> dead || !isAdded() ? 1 : 0; case team -> team.id; case shooting -> isShooting() ? 1 : 0; case range -> range() / tilesize; @@ -151,6 +151,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I case type -> type; case name -> controller instanceof Player p ? p.name : null; case firstItem -> stack().amount == 0 ? null : item(); + case controller -> controller instanceof LogicAI log ? log.controller : controller instanceof FormationAI form ? form.leader : this; case payloadType -> self() instanceof Payloadc pay ? (pay.payloads().isEmpty() ? null : pay.payloads().peek() instanceof UnitPayload p1 ? p1.unit.type : diff --git a/core/src/mindustry/logic/LAccess.java b/core/src/mindustry/logic/LAccess.java index bf3f9dd3b1..a928418404 100644 --- a/core/src/mindustry/logic/LAccess.java +++ b/core/src/mindustry/logic/LAccess.java @@ -27,7 +27,7 @@ public enum LAccess{ y, shootX, shootY, - //dead, //TODO 126 + dead, range, shooting, mineX, @@ -42,6 +42,7 @@ public enum LAccess{ config, payloadCount, payloadType, + controller, //values with parameters are considered controllable enabled("to"), //"to" is standard for single parameter access diff --git a/gradle.properties b/gradle.properties index f7f78d81b9..83c7ad7b59 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=7e4bc7e1c7c25bdf4321a22356f6ddb1943f6d60 +archash=26a96b2eb63608f200e5b93873013dd85c31e39f diff --git a/server/build.gradle b/server/build.gradle index a62fb66121..0f526c9f56 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -42,6 +42,9 @@ task dist(type: Jar, dependsOn: configurations.runtimeClasspath){ exclude("zones/**") exclude("icons/**") exclude("bundles/**") + exclude("cubemaps/**") + exclude("cursors/**") + exclude("shaders/**") manifest{ attributes 'Main-Class': project.mainClassName