From 475794640dabf307e338831fef3a8c66458d81b0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 25 Dec 2019 11:16:54 -0500 Subject: [PATCH] More cleanup --- .github/Mindustry-CodeStyle-IJ.xml | 2 +- .../annotations/RemoteWriteGenerator.java | 18 +++++++++--------- build.gradle | 6 +++--- core/src/mindustry/core/NetServer.java | 2 +- core/src/mindustry/core/Renderer.java | 2 +- core/src/mindustry/editor/MapEditorDialog.java | 2 +- .../mindustry/editor/MapGenerateDialog.java | 2 +- core/src/mindustry/editor/MapView.java | 16 ++++++++-------- core/src/mindustry/entities/Damage.java | 4 ++-- .../mindustry/entities/EntityCollisions.java | 8 ++++---- core/src/mindustry/entities/Predict.java | 16 ++++++++-------- .../entities/effect/ItemTransfer.java | 8 ++++---- .../mindustry/entities/effect/Lightning.java | 4 ++-- .../entities/traits/BuilderTrait.java | 2 +- .../mindustry/entities/traits/SolidTrait.java | 2 +- .../entities/traits/VelocityTrait.java | 4 ++-- core/src/mindustry/entities/type/Bullet.java | 4 ++-- core/src/mindustry/entities/type/Player.java | 6 +++--- .../mindustry/entities/type/SolidEntity.java | 10 +++++----- .../mindustry/entities/type/TileEntity.java | 6 +++--- core/src/mindustry/entities/type/Unit.java | 4 ++-- .../entities/type/base/FlyingUnit.java | 2 +- .../entities/type/base/GroundUnit.java | 4 ++-- core/src/mindustry/game/LoopControl.java | 2 +- core/src/mindustry/graphics/LightRenderer.java | 4 ++-- .../mindustry/graphics/OverlayRenderer.java | 4 ++-- core/src/mindustry/input/InputHandler.java | 8 ++++---- core/src/mindustry/input/MobileInput.java | 2 +- .../mindustry/maps/filters/MirrorFilter.java | 10 +++++----- core/src/mindustry/mod/ContentParser.java | 2 +- core/src/mindustry/net/Interpolator.java | 6 +++--- .../ui/fragments/BlockInventoryFragment.java | 2 +- .../mindustry/ui/fragments/HudFragment.java | 2 +- .../ui/fragments/PlacementFragment.java | 2 +- core/src/mindustry/world/Block.java | 2 +- core/src/mindustry/world/BlockStorage.java | 4 ++-- core/src/mindustry/world/Edges.java | 4 ++-- core/src/mindustry/world/Tile.java | 4 ++-- .../world/blocks/defense/DeflectorWall.java | 2 +- .../defense/turrets/ArtilleryTurret.java | 4 ++-- .../world/blocks/defense/turrets/Turret.java | 8 ++++---- .../world/blocks/distribution/Conveyor.java | 6 +++--- .../world/blocks/logic/MessageBlock.java | 2 +- .../world/blocks/power/NuclearReactor.java | 2 +- .../world/blocks/power/PowerNode.java | 2 +- .../src/mindustry/desktop/DesktopLauncher.java | 10 +++++----- .../mindustry/tools/ScriptStubGenerator.java | 6 +++--- 47 files changed, 117 insertions(+), 117 deletions(-) diff --git a/.github/Mindustry-CodeStyle-IJ.xml b/.github/Mindustry-CodeStyle-IJ.xml index 6a48acd1dd..94486ff95b 100644 --- a/.github/Mindustry-CodeStyle-IJ.xml +++ b/.github/Mindustry-CodeStyle-IJ.xml @@ -12,7 +12,7 @@ diff --git a/annotations/src/main/java/mindustry/annotations/RemoteWriteGenerator.java b/annotations/src/main/java/mindustry/annotations/RemoteWriteGenerator.java index ee5b7bc169..dfe3f1fa00 100644 --- a/annotations/src/main/java/mindustry/annotations/RemoteWriteGenerator.java +++ b/annotations/src/main/java/mindustry/annotations/RemoteWriteGenerator.java @@ -97,7 +97,7 @@ public class RemoteWriteGenerator{ if(!forwarded && methodEntry.local != Loc.none){ //add in local checks if(methodEntry.local != Loc.both){ - method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !io.anuke.mindustry.Vars.net.active())"); + method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !mindustry.Vars.net.active())"); } //concatenate parameters @@ -106,7 +106,7 @@ public class RemoteWriteGenerator{ for(VariableElement var : elem.getParameters()){ //special case: calling local-only methods uses the local player if(index == 0 && methodEntry.where == Loc.client){ - results.append("io.anuke.mindustry.Vars.player"); + results.append("mindustry.Vars.player"); }else{ results.append(var.getSimpleName()); } @@ -159,7 +159,7 @@ public class RemoteWriteGenerator{ boolean writePlayerSkipCheck = methodEntry.where == Loc.both && i == 0; if(writePlayerSkipCheck){ //write begin check - method.beginControlFlow("if(io.anuke.mindustry.Vars.net.server())"); + method.beginControlFlow("if(mindustry.Vars.net.server())"); } if(Utils.isPrimitive(typeName)){ //check if it's a primitive, and if so write it @@ -194,12 +194,12 @@ public class RemoteWriteGenerator{ if(forwarded){ //forward packet if(!methodEntry.local.isClient){ //if the client doesn't get it called locally, forward it back after validation - sendString = "io.anuke.mindustry.Vars.net.send("; + sendString = "mindustry.Vars.net.send("; }else{ - sendString = "io.anuke.mindustry.Vars.net.sendExcept(exceptConnection, "; + sendString = "mindustry.Vars.net.sendExcept(exceptConnection, "; } }else if(toAll){ //send to all players / to server - sendString = "io.anuke.mindustry.Vars.net.send("; + sendString = "mindustry.Vars.net.send("; }else{ //send to specific client from server sendString = "playerConnection.send("; } @@ -217,8 +217,8 @@ public class RemoteWriteGenerator{ } private String getCheckString(Loc loc){ - return loc.isClient && loc.isServer ? "io.anuke.mindustry.Vars.net.server() || io.anuke.mindustry.Vars.net.client()" : - loc.isClient ? "io.anuke.mindustry.Vars.net.client()" : - loc.isServer ? "io.anuke.mindustry.Vars.net.server()" : "false"; + return loc.isClient && loc.isServer ? "mindustry.Vars.net.server() || mindustry.Vars.net.client()" : + loc.isClient ? "mindustry.Vars.net.client()" : + loc.isServer ? "mindustry.Vars.net.server()" : "false"; } } diff --git a/build.gradle b/build.gradle index 7bb0e486b0..88e2b84a25 100644 --- a/build.gradle +++ b/build.gradle @@ -230,7 +230,7 @@ project(":core"){ task cleanGen{ doFirst{ delete{ - delete "../core/src/io/anuke/mindustry/gen/" + delete "../core/src/mindustry/gen/" } } } @@ -238,11 +238,11 @@ project(":core"){ task copyGen{ doLast{ copy{ - from("../core/build/generated/sources/annotationProcessor/java/main/io/anuke/mindustry/gen"){ + from("../core/build/generated/sources/annotationProcessor/java/main/mindustry/gen"){ include "**/*.java" } - into "../core/src/io/anuke/mindustry/gen" + into "../core/src/mindustry/gen" } } } diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index c602378e40..d00fc5a839 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -32,7 +32,7 @@ import static mindustry.Vars.*; public class NetServer implements ApplicationListener{ private final static int maxSnapshotSize = 430, timerBlockSync = 0; private final static float serverSyncTime = 12, kickDuration = 30 * 1000, blockSyncTime = 60 * 10; - private final static Vector2 vector = new Vector2(); + private final static Vec2 vector = new Vec2(); private final static Rectangle viewport = new Rectangle(); /** If a player goes away of their server-side coordinates by this distance, they get teleported back. */ private final static float correctDist = 16f; diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 68680ece3a..4dbb2ef4a1 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -120,7 +120,7 @@ public class Renderer implements ApplicationListener{ landTime = 0f; graphics.clear(Color.black); }else{ - Vector2 position = Tmp.v3.set(player); + Vec2 position = Tmp.v3.set(player); if(player.isDead()){ TileEntity core = player.getClosestCore(); diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index 4ff5df83cc..0ee0fca085 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -475,7 +475,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ } table.update(() -> { - Vector2 v = button.localToStageCoordinates(Tmp.v1.setZero()); + Vec2 v = button.localToStageCoordinates(Tmp.v1.setZero()); table.setPosition(v.x, v.y, Align.topLeft); if(!isShown()){ table.remove(); diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index e17510bbdb..6a18ebc089 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -187,7 +187,7 @@ public class MapGenerateDialog extends FloatingDialog{ return; } - Vector2 v = pane.stageToLocalCoordinates(Core.input.mouse()); + Vec2 v = pane.stageToLocalCoordinates(Core.input.mouse()); if(v.x >= 0 && v.y >= 0 && v.x <= pane.getWidth() && v.y <= pane.getHeight()){ Core.scene.setScrollFocus(pane); diff --git a/core/src/mindustry/editor/MapView.java b/core/src/mindustry/editor/MapView.java index 265788cc4e..4c99ffba61 100644 --- a/core/src/mindustry/editor/MapView.java +++ b/core/src/mindustry/editor/MapView.java @@ -27,9 +27,9 @@ public class MapView extends Element implements GestureListener{ private float zoom = 1f; private boolean grid = false; private GridImage image = new GridImage(0, 0); - private Vector2 vec = new Vector2(); + private Vec2 vec = new Vec2(); private Rectangle rect = new Rectangle(); - private Vector2[][] brushPolygons = new Vector2[MapEditor.brushSizes.length][0]; + private Vec2[][] brushPolygons = new Vec2[MapEditor.brushSizes.length][0]; private boolean drawing; private int lastx, lasty; @@ -214,7 +214,7 @@ public class MapView extends Element implements GestureListener{ } } - private Vector2 unproject(int x, int y){ + private Vec2 unproject(int x, int y){ float ratio = 1f / ((float)editor.width() / editor.height()); float size = Math.min(width, height); float sclwidth = size * zoom; @@ -268,9 +268,9 @@ public class MapView extends Element implements GestureListener{ if((!editor.drawBlock.isMultiblock() || tool == EditorTool.eraser) && tool != EditorTool.fill){ if(tool == EditorTool.line && drawing){ - Vector2 v1 = unproject(startx, starty).add(x, y); + Vec2 v1 = unproject(startx, starty).add(x, y); float sx = v1.x, sy = v1.y; - Vector2 v2 = unproject(lastx, lasty).add(x, y); + Vec2 v2 = unproject(lastx, lasty).add(x, y); Lines.poly(brushPolygons[index], sx, sy, scaling); Lines.poly(brushPolygons[index], v2.x, v2.y, scaling); @@ -278,7 +278,7 @@ public class MapView extends Element implements GestureListener{ if((tool.edit || (tool == EditorTool.line && !drawing)) && (!mobile || drawing)){ Point2 p = project(mousex, mousey); - Vector2 v = unproject(p.x, p.y).add(x, y); + Vec2 v = unproject(p.x, p.y).add(x, y); //pencil square outline if(tool == EditorTool.pencil && tool.mode == 1){ @@ -290,7 +290,7 @@ public class MapView extends Element implements GestureListener{ }else{ if((tool.edit || tool == EditorTool.line) && (!mobile || drawing)){ Point2 p = project(mousex, mousey); - Vector2 v = unproject(p.x, p.y).add(x, y); + Vec2 v = unproject(p.x, p.y).add(x, y); float offset = (editor.drawBlock.size % 2 == 0 ? scaling / 2f : 0f); Lines.square( v.x + scaling / 2f + offset, @@ -332,7 +332,7 @@ public class MapView extends Element implements GestureListener{ } @Override - public boolean pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2){ + public boolean pinch(Vec2 initialPointer1, Vec2 initialPointer2, Vec2 pointer1, Vec2 pointer2){ return false; } diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 99638a74f9..a5bc63bc52 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -24,7 +24,7 @@ import static mindustry.Vars.*; public class Damage{ private static Rectangle rect = new Rectangle(); private static Rectangle hitrect = new Rectangle(); - private static Vector2 tr = new Vector2(); + private static Vec2 tr = new Vec2(); private static GridBits bits = new GridBits(30, 30); private static IntQueue propagation = new IntQueue(); private static IntSet collidedBlocks = new IntSet(); @@ -133,7 +133,7 @@ public class Damage{ other.width += expand * 2; other.height += expand * 2; - Vector2 vec = Geometry.raycastRect(x, y, x2, y2, other); + Vec2 vec = Geometry.raycastRect(x, y, x2, y2, other); if(vec != null){ Effects.effect(effect, vec.x, vec.y); diff --git a/core/src/mindustry/entities/EntityCollisions.java b/core/src/mindustry/entities/EntityCollisions.java index eb972ffb1f..6a7fefffd1 100644 --- a/core/src/mindustry/entities/EntityCollisions.java +++ b/core/src/mindustry/entities/EntityCollisions.java @@ -18,8 +18,8 @@ public class EntityCollisions{ //tile collisions private Rectangle tmp = new Rectangle(); - private Vector2 vector = new Vector2(); - private Vector2 l1 = new Vector2(); + private Vec2 vector = new Vec2(); + private Vec2 l1 = new Vec2(); private Rectangle r1 = new Rectangle(); private Rectangle r2 = new Rectangle(); @@ -72,7 +72,7 @@ public class EntityCollisions{ tmp.setSize(tilesize).setCenter(wx * tilesize, wy * tilesize); if(tmp.overlaps(rect)){ - Vector2 v = Geometry.overlap(rect, tmp, x); + Vec2 v = Geometry.overlap(rect, tmp, x); rect.x += v.x; rect.y += v.y; } @@ -157,7 +157,7 @@ public class EntityCollisions{ } private boolean collide(float x1, float y1, float w1, float h1, float vx1, float vy1, - float x2, float y2, float w2, float h2, float vx2, float vy2, Vector2 out){ + float x2, float y2, float w2, float h2, float vx2, float vy2, Vec2 out){ float px = vx1, py = vy1; vx1 -= vx2; diff --git a/core/src/mindustry/entities/Predict.java b/core/src/mindustry/entities/Predict.java index c45883ce19..49910b2e81 100644 --- a/core/src/mindustry/entities/Predict.java +++ b/core/src/mindustry/entities/Predict.java @@ -9,8 +9,8 @@ import mindustry.entities.traits.*; * Class for predicting shoot angles based on velocities of targets. */ public class Predict{ - private static Vector2 vec = new Vector2(); - private static Vector2 vresult = new Vector2(); + private static Vec2 vec = new Vec2(); + private static Vec2 vresult = new Vec2(); /** * Calculates of intercept of a stationary and moving target. Do not call from multiple threads! @@ -23,7 +23,7 @@ public class Predict{ * @param v speed of bullet * @return the intercept location */ - public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){ + public static Vec2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){ dstvx /= Time.delta(); dstvy /= Time.delta(); float tx = dstx - srcx, @@ -35,10 +35,10 @@ public class Predict{ float c = tx * tx + ty * ty; // Solve quadratic - Vector2 ts = quad(a, b, c); + Vec2 ts = quad(a, b, c); // Find smallest positive solution - Vector2 sol = vresult.set(dstx, dsty); + Vec2 sol = vresult.set(dstx, dsty); if(ts != null){ float t0 = ts.x, t1 = ts.y; float t = Math.min(t0, t1); @@ -54,12 +54,12 @@ public class Predict{ /** * See {@link #intercept(float, float, float, float, float, float, float)}. */ - public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){ + public static Vec2 intercept(TargetTrait src, TargetTrait dst, float v){ return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.getTargetVelocityX() - src.getTargetVelocityX()/2f, dst.getTargetVelocityY() - src.getTargetVelocityY()/2f, v); } - private static Vector2 quad(float a, float b, float c){ - Vector2 sol = null; + private static Vec2 quad(float a, float b, float c){ + Vec2 sol = null; if(Math.abs(a) < 1e-6){ if(Math.abs(b) < 1e-6){ sol = Math.abs(c) < 1e-6 ? vec.set(0, 0) : null; diff --git a/core/src/mindustry/entities/effect/ItemTransfer.java b/core/src/mindustry/entities/effect/ItemTransfer.java index f4b4042226..ea8366c812 100644 --- a/core/src/mindustry/entities/effect/ItemTransfer.java +++ b/core/src/mindustry/entities/effect/ItemTransfer.java @@ -6,7 +6,7 @@ import arc.graphics.g2d.*; import arc.math.Interpolation; import arc.math.Mathf; import arc.math.geom.Position; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import arc.util.Time; import arc.util.pooling.Pools; import mindustry.entities.*; @@ -20,9 +20,9 @@ import mindustry.world.Tile; import static mindustry.Vars.*; public class ItemTransfer extends TimedEntity implements DrawTrait{ - private Vector2 from = new Vector2(); - private Vector2 current = new Vector2(); - private Vector2 tovec = new Vector2(); + private Vec2 from = new Vec2(); + private Vec2 current = new Vec2(); + private Vec2 tovec = new Vec2(); private Item item; private float seed; private Position to; diff --git a/core/src/mindustry/entities/effect/Lightning.java b/core/src/mindustry/entities/effect/Lightning.java index 5ecc937296..1e88c29df2 100644 --- a/core/src/mindustry/entities/effect/Lightning.java +++ b/core/src/mindustry/entities/effect/Lightning.java @@ -35,7 +35,7 @@ public class Lightning extends TimedEntity implements DrawTrait, TimeTrait{ private static final float hitRange = 30f; private static int lastSeed = 0; - private Array lines = new Array<>(); + private Array lines = new Array<>(); private Color color = Pal.lancerLaser; /** For pooling use only. Do not call directly! */ @@ -70,7 +70,7 @@ public class Lightning extends TimedEntity implements DrawTrait, TimeTrait{ for(int i = 0; i < length / 2; i++){ Bullet.create(Bullets.damageLightning, l, team, x, y, 0f, 1f, 1f, dmg); - l.lines.add(new Vector2(x + Mathf.range(3f), y + Mathf.range(3f))); + l.lines.add(new Vec2(x + Mathf.range(3f), y + Mathf.range(3f))); if(l.lines.size > 1){ bhit[0] = false; diff --git a/core/src/mindustry/entities/traits/BuilderTrait.java b/core/src/mindustry/entities/traits/BuilderTrait.java index 613723a6dd..2f302be8e6 100644 --- a/core/src/mindustry/entities/traits/BuilderTrait.java +++ b/core/src/mindustry/entities/traits/BuilderTrait.java @@ -229,7 +229,7 @@ public interface BuilderTrait extends Entity, TeamTrait{ //due to iOS weirdness, this is apparently required class BuildDataStatic{ - static Vector2[] tmptr = new Vector2[]{new Vector2(), new Vector2(), new Vector2(), new Vector2()}; + static Vec2[] tmptr = new Vec2[]{new Vec2(), new Vec2(), new Vec2(), new Vec2()}; } /** Draw placement effects for an entity. */ diff --git a/core/src/mindustry/entities/traits/SolidTrait.java b/core/src/mindustry/entities/traits/SolidTrait.java index 3f571f1f46..f799f13cba 100644 --- a/core/src/mindustry/entities/traits/SolidTrait.java +++ b/core/src/mindustry/entities/traits/SolidTrait.java @@ -11,7 +11,7 @@ public interface SolidTrait extends QuadTreeObject, MoveTrait, VelocityTrait, En void hitboxTile(Rectangle rectangle); - Vector2 lastPosition(); + Vec2 lastPosition(); default boolean collidesGrid(int x, int y){ return true; diff --git a/core/src/mindustry/entities/traits/VelocityTrait.java b/core/src/mindustry/entities/traits/VelocityTrait.java index 2f91ccedc1..6eb42254d7 100644 --- a/core/src/mindustry/entities/traits/VelocityTrait.java +++ b/core/src/mindustry/entities/traits/VelocityTrait.java @@ -1,11 +1,11 @@ package mindustry.entities.traits; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import arc.util.Time; public interface VelocityTrait extends MoveTrait{ - Vector2 velocity(); + Vec2 velocity(); default void applyImpulse(float x, float y){ velocity().x += x / mass(); diff --git a/core/src/mindustry/entities/type/Bullet.java b/core/src/mindustry/entities/type/Bullet.java index f538f67460..6afafb5f29 100644 --- a/core/src/mindustry/entities/type/Bullet.java +++ b/core/src/mindustry/entities/type/Bullet.java @@ -56,7 +56,7 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool bullet.velocity.set(0, type.speed).setAngle(angle).scl(velocityScl); if(type.keepVelocity){ - bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait)owner).velocity() : Vector2.ZERO); + bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait)owner).velocity() : Vec2.ZERO); } bullet.team = team; @@ -297,7 +297,7 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool } @Override - public Vector2 velocity(){ + public Vec2 velocity(){ return velocity; } diff --git a/core/src/mindustry/entities/type/Player.java b/core/src/mindustry/entities/type/Player.java index 8af51bc6a8..a6a74683bb 100644 --- a/core/src/mindustry/entities/type/Player.java +++ b/core/src/mindustry/entities/type/Player.java @@ -71,7 +71,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ private float walktime, itemtime; private Queue placeQueue = new Queue<>(); private Tile mining; - private Vector2 movement = new Vector2(); + private Vec2 movement = new Vec2(); private boolean moved; //endregion @@ -598,7 +598,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ movement.y += Mathf.clamp((Core.input.mouseY() - Core.graphics.getHeight() / 2) * 0.005f, -1, 1) * speed; } - Vector2 vec = Core.input.mouseWorld(control.input.getMouseX(), control.input.getMouseY()); + Vec2 vec = Core.input.mouseWorld(control.input.getMouseX(), control.input.getMouseY()); pointerX = vec.x; pointerY = vec.y; updateShooting(); @@ -738,7 +738,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f); } - Vector2 intercept = Predict.intercept(this, target, getWeapon().bullet.speed); + Vec2 intercept = Predict.intercept(this, target, getWeapon().bullet.speed); pointerX = intercept.x; pointerY = intercept.y; diff --git a/core/src/mindustry/entities/type/SolidEntity.java b/core/src/mindustry/entities/type/SolidEntity.java index 148e7d4c15..d3d0685f3f 100644 --- a/core/src/mindustry/entities/type/SolidEntity.java +++ b/core/src/mindustry/entities/type/SolidEntity.java @@ -1,19 +1,19 @@ package mindustry.entities.type; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import mindustry.entities.traits.SolidTrait; public abstract class SolidEntity extends BaseEntity implements SolidTrait{ - protected transient Vector2 velocity = new Vector2(0f, 0.0001f); - private transient Vector2 lastPosition = new Vector2(); + protected transient Vec2 velocity = new Vec2(0f, 0.0001f); + private transient Vec2 lastPosition = new Vec2(); @Override - public Vector2 lastPosition(){ + public Vec2 lastPosition(){ return lastPosition; } @Override - public Vector2 velocity(){ + public Vec2 velocity(){ return velocity; } } diff --git a/core/src/mindustry/entities/type/TileEntity.java b/core/src/mindustry/entities/type/TileEntity.java index 9ad9a1c7fe..85c6c9d2eb 100644 --- a/core/src/mindustry/entities/type/TileEntity.java +++ b/core/src/mindustry/entities/type/TileEntity.java @@ -5,7 +5,7 @@ import arc.Events; import arc.struct.Array; import arc.struct.ObjectSet; import arc.math.geom.Point2; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import arc.util.*; import arc.util.ArcAnnotate.*; import mindustry.entities.EntityGroup; @@ -288,8 +288,8 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ } @Override - public Vector2 velocity(){ - return Vector2.ZERO; + public Vec2 velocity(){ + return Vec2.ZERO; } @Override diff --git a/core/src/mindustry/entities/type/Unit.java b/core/src/mindustry/entities/type/Unit.java index b63ac04e1e..1bec11c029 100644 --- a/core/src/mindustry/entities/type/Unit.java +++ b/core/src/mindustry/entities/type/Unit.java @@ -39,7 +39,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ public static final float maxAbsVelocity = 127f / velocityPercision; public static final int noSpawner = Pos.get(-1, 1); - private static final Vector2 moveVector = new Vector2(); + private static final Vec2 moveVector = new Vec2(); public float rotation; @@ -118,7 +118,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } @Override - public Vector2 velocity(){ + public Vec2 velocity(){ return velocity; } diff --git a/core/src/mindustry/entities/type/base/FlyingUnit.java b/core/src/mindustry/entities/type/base/FlyingUnit.java index c32e778f18..35473b7a4e 100644 --- a/core/src/mindustry/entities/type/base/FlyingUnit.java +++ b/core/src/mindustry/entities/type/base/FlyingUnit.java @@ -65,7 +65,7 @@ public class FlyingUnit extends BaseUnit{ getWeapon().update(FlyingUnit.this, wx + Tmp.v2.x, wy + Tmp.v2.y, weaponAngles[wi], left); } }else{ - Vector2 to = Predict.intercept(FlyingUnit.this, target, ammo.speed); + Vec2 to = Predict.intercept(FlyingUnit.this, target, ammo.speed); getWeapon().update(FlyingUnit.this, to.x, to.y); } } diff --git a/core/src/mindustry/entities/type/base/GroundUnit.java b/core/src/mindustry/entities/type/base/GroundUnit.java index 9253d1f920..5f7c6d2768 100644 --- a/core/src/mindustry/entities/type/base/GroundUnit.java +++ b/core/src/mindustry/entities/type/base/GroundUnit.java @@ -20,7 +20,7 @@ import mindustry.world.meta.*; import static mindustry.Vars.*; public class GroundUnit extends BaseUnit{ - protected static Vector2 vec = new Vector2(); + protected static Vec2 vec = new Vec2(); protected float walkTime; protected float stuckTime; @@ -175,7 +175,7 @@ public class GroundUnit extends BaseUnit{ if(Angles.near(angleTo(target), rotation, 13f)){ BulletType ammo = getWeapon().bullet; - Vector2 to = Predict.intercept(GroundUnit.this, target, ammo.speed); + Vec2 to = Predict.intercept(GroundUnit.this, target, ammo.speed); getWeapon().update(GroundUnit.this, to.x, to.y); } diff --git a/core/src/mindustry/game/LoopControl.java b/core/src/mindustry/game/LoopControl.java index 368739c714..8e0a9f1801 100644 --- a/core/src/mindustry/game/LoopControl.java +++ b/core/src/mindustry/game/LoopControl.java @@ -53,7 +53,7 @@ public class LoopControl{ private class SoundData{ float volume; float total; - Vector2 sum = new Vector2(); + Vec2 sum = new Vec2(); int soundID; float curVolume; diff --git a/core/src/mindustry/graphics/LightRenderer.java b/core/src/mindustry/graphics/LightRenderer.java index 4defa7fdcf..0c0f94e02c 100644 --- a/core/src/mindustry/graphics/LightRenderer.java +++ b/core/src/mindustry/graphics/LightRenderer.java @@ -63,7 +63,7 @@ public class LightRenderer{ float v2 = lmid.getV(); - Vector2 v1 = Tmp.v1.trnsExact(rot + 90f, stroke); + Vec2 v1 = Tmp.v1.trnsExact(rot + 90f, stroke); float lx1 = x - v1.x, ly1 = y - v1.y, lx2 = x + v1.x, ly2 = y + v1.y, lx3 = x2 + v1.x, ly3 = y2 + v1.y, @@ -100,7 +100,7 @@ public class LightRenderer{ Draw.vert(ledge.getTexture(), vertices, 0, vertices.length); - Vector2 v3 = Tmp.v2.trnsExact(rot, stroke); + Vec2 v3 = Tmp.v2.trnsExact(rot, stroke); u = ledge.getU(); v = ledge.getV2(); diff --git a/core/src/mindustry/graphics/OverlayRenderer.java b/core/src/mindustry/graphics/OverlayRenderer.java index 7aae454a3e..3001159c74 100644 --- a/core/src/mindustry/graphics/OverlayRenderer.java +++ b/core/src/mindustry/graphics/OverlayRenderer.java @@ -122,7 +122,7 @@ public class OverlayRenderer{ //draw selected block if(input.block == null && !Core.scene.hasMouse()){ - Vector2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); + Vec2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); Tile tile = world.ltileWorld(vec.x, vec.y); if(tile != null && tile.block() != Blocks.air && tile.getTeam() == player.getTeam()){ @@ -139,7 +139,7 @@ public class OverlayRenderer{ //draw selection overlay when dropping item if(input.isDroppingItem()){ - Vector2 v = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); + Vec2 v = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); float size = 8; Draw.rect(player.item().item.icon(Cicon.medium), v.x, v.y, size, size); Draw.color(Pal.accent); diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 1bc3acefac..2a4ce0343f 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -43,7 +43,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ final static float playerSelectRange = mobile ? 17f : 11f; /** Maximum line length. */ final static int maxLength = 100; - final static Vector2 stackTrns = new Vector2(); + final static Vec2 stackTrns = new Vec2(); final static Rectangle r1 = new Rectangle(), r2 = new Rectangle(); /** Distance on the back from where items originate. */ final static float backTrns = 3f; @@ -120,7 +120,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ ItemTransfer.create(item, player.x + Angles.trnsx(player.rotation + 180f, backTrns), player.y + Angles.trnsy(player.rotation + 180f, backTrns), - new Vector2(tile.drawx() + stackTrns.x, tile.drawy() + stackTrns.y), () -> { + new Vec2(tile.drawx() + stackTrns.x, tile.drawy() + stackTrns.y), () -> { if(tile.block() != block || tile.entity == null || tile.entity.items == null) return; tile.block().handleStack(item, removed, tile, player); @@ -639,7 +639,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } int tileX(float cursorX){ - Vector2 vec = Core.input.mouseWorld(cursorX, 0); + Vec2 vec = Core.input.mouseWorld(cursorX, 0); if(selectedBlock()){ vec.sub(block.offset(), block.offset()); } @@ -647,7 +647,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } int tileY(float cursorY){ - Vector2 vec = Core.input.mouseWorld(0, cursorY); + Vec2 vec = Core.input.mouseWorld(0, cursorY); if(selectedBlock()){ vec.sub(block.offset(), block.offset()); } diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 743ee0e45a..5379caf113 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -36,7 +36,7 @@ public class MobileInput extends InputHandler implements GestureListener{ private final float edgePan = Scl.scl(60f); //gesture data - private Vector2 vector = new Vector2(); + private Vec2 vector = new Vec2(); private float lastZoom = -1; /** Position where the player started dragging a line. */ diff --git a/core/src/mindustry/maps/filters/MirrorFilter.java b/core/src/mindustry/maps/filters/MirrorFilter.java index 346b373d23..b9bf2a70d8 100644 --- a/core/src/mindustry/maps/filters/MirrorFilter.java +++ b/core/src/mindustry/maps/filters/MirrorFilter.java @@ -11,7 +11,7 @@ import mindustry.maps.filters.FilterOption.*; import mindustry.world.*; public class MirrorFilter extends GenerateFilter{ - private final Vector2 v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2(); + private final Vec2 v1 = new Vec2(), v2 = new Vec2(), v3 = new Vec2(); int angle = 45; @@ -44,12 +44,12 @@ public class MirrorFilter extends GenerateFilter{ public void draw(Image image){ super.draw(image); - Vector2 vsize = Scaling.fit.apply(image.getDrawable().getMinWidth(), image.getDrawable().getMinHeight(), image.getWidth(), image.getHeight()); + Vec2 vsize = Scaling.fit.apply(image.getDrawable().getMinWidth(), image.getDrawable().getMinHeight(), image.getWidth(), image.getHeight()); float imageWidth = Math.max(vsize.x, vsize.y); float imageHeight = Math.max(vsize.y, vsize.x); float size = Math.max(image.getWidth() *2, image.getHeight()*2); - Cons clamper = v -> + Cons clamper = v -> v.clamp( image.getX() + image.getWidth()/2f - imageWidth/2f, image.getX() + image.getWidth()/2f + imageWidth/2f, @@ -64,7 +64,7 @@ public class MirrorFilter extends GenerateFilter{ Draw.reset(); } - void mirror(Vector2 p, float x0, float y0, float x1, float y1){ + void mirror(Vec2 p, float x0, float y0, float x1, float y1){ //special case: uneven map mirrored at 45 degree angle if(in.width != in.height && angle % 90 != 0){ p.x = (p.x - in.width/2f) * -1 + in.width/2f; @@ -80,7 +80,7 @@ public class MirrorFilter extends GenerateFilter{ } } - boolean left(Vector2 a, Vector2 b, Vector2 c){ + boolean left(Vec2 a, Vec2 b, Vec2 c){ return ((b.x - a.x)*(c.y - a.y) - (b.y - a.y)*(c.x - a.x)) > 0; } } diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index edf716c9b0..3ea54d6160 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -460,7 +460,7 @@ public class ContentParser{ builder.append("[accent][[").append(e.getClass().getSimpleName().replace("Exception", "")) .append("][] ") .append(e.getMessage() != null ? - e.getMessage().replace("io.anuke.mindustry.", "").replace("io.anuke.arc.", "") : "").append("\n"); + e.getMessage().replace("mindustry.", "").replace("arc.", "") : "").append("\n"); } } return builder.toString(); diff --git a/core/src/mindustry/net/Interpolator.java b/core/src/mindustry/net/Interpolator.java index 8495c9bc0e..b2a544dbd6 100644 --- a/core/src/mindustry/net/Interpolator.java +++ b/core/src/mindustry/net/Interpolator.java @@ -6,14 +6,14 @@ import arc.util.*; public class Interpolator{ //used for movement - public Vector2 target = new Vector2(); - public Vector2 last = new Vector2(); + public Vec2 target = new Vec2(); + public Vec2 last = new Vec2(); public float[] targets = {}; public float[] lasts = {}; public long lastUpdated, updateSpacing; //current state - public Vector2 pos = new Vector2(); + public Vec2 pos = new Vec2(); public float[] values = {}; public void read(float cx, float cy, float x, float y, float... target1ds){ diff --git a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java index b39ee79650..e77a240e36 100644 --- a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java @@ -199,7 +199,7 @@ public class BlockInventoryFragment extends Fragment{ } private void updateTablePosition(){ - Vector2 v = Core.input.mouseScreen(tile.drawx() + tile.block().size * tilesize / 2f, tile.drawy() + tile.block().size * tilesize / 2f); + Vec2 v = Core.input.mouseScreen(tile.drawx() + tile.block().size * tilesize / 2f, tile.drawy() + tile.block().size * tilesize / 2f); table.pack(); table.setPosition(v.x, v.y, Align.topLeft); } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 1212b4bfa3..80e5dc0185 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -208,7 +208,7 @@ public class HudFragment extends Fragment{ if(b.isChecked()){ Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true); if(e == null){ - Vector2 world = Core.input.mouseWorld(); + Vec2 world = Core.input.mouseWorld(); Units.nearby(world.x, world.y, 1f, 1f, unit -> { if(!found[0] && unit instanceof BaseUnit){ if(Core.input.keyTap(KeyCode.MOUSE_LEFT)){ diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index 3091a52d4f..f02b0ab54f 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -433,7 +433,7 @@ public class PlacementFragment extends Fragment{ Block getSelected(){ Block toDisplay = null; - Vector2 v = topTable.stageToLocalCoordinates(Core.input.mouse()); + Vec2 v = topTable.stageToLocalCoordinates(Core.input.mouse()); //setup hovering tile if(!Core.scene.hasMouse() && topTable.hit(v.x, v.y, false) == null){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index a492643200..9bd64f023a 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -489,7 +489,7 @@ public class Block extends BlockStorage{ /** Update table alignment after configuring.*/ public void updateTableAlign(Tile tile, Table table){ - Vector2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1); + Vec2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1); table.setPosition(pos.x, pos.y, Align.top); } diff --git a/core/src/mindustry/world/BlockStorage.java b/core/src/mindustry/world/BlockStorage.java index f37be75f10..20c1ca8f98 100644 --- a/core/src/mindustry/world/BlockStorage.java +++ b/core/src/mindustry/world/BlockStorage.java @@ -2,7 +2,7 @@ package mindustry.world; import arc.struct.Array; import arc.math.Mathf; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import arc.util.*; import mindustry.Vars; import mindustry.content.Fx; @@ -83,7 +83,7 @@ public abstract class BlockStorage extends UnlockableContent{ } /** Returns offset for stack placement. */ - public void getStackOffset(Item item, Tile tile, Vector2 trns){ + public void getStackOffset(Item item, Tile tile, Vec2 trns){ } diff --git a/core/src/mindustry/world/Edges.java b/core/src/mindustry/world/Edges.java index fc292f09e8..86d6e31449 100644 --- a/core/src/mindustry/world/Edges.java +++ b/core/src/mindustry/world/Edges.java @@ -12,7 +12,7 @@ public class Edges{ private static final int maxRadius = 12; private static Point2[][] edges = new Point2[maxSize][0]; private static Point2[][] edgeInside = new Point2[maxSize][0]; - private static Vector2[][] polygons = new Vector2[maxRadius * 2][0]; + private static Vec2[][] polygons = new Vec2[maxRadius * 2][0]; static{ for(int i = 0; i < maxRadius * 2; i++){ @@ -60,7 +60,7 @@ public class Edges{ tiley + Mathf.clamp(other.y - tiley, -(size - 1) / 2, (size / 2))); } - public static Vector2[] getPixelPolygon(float radius){ + public static Vec2[] getPixelPolygon(float radius){ if(radius < 1 || radius > maxRadius) throw new RuntimeException("Polygon size must be between 1 and " + maxRadius); return polygons[(int)(radius * 2) - 1]; diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index 1e6ee5d517..1ac2871bab 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -449,8 +449,8 @@ public class Tile implements Position, TargetTrait{ } @Override - public Vector2 velocity(){ - return Vector2.ZERO; + public Vec2 velocity(){ + return Vec2.ZERO; } @Override diff --git a/core/src/mindustry/world/blocks/defense/DeflectorWall.java b/core/src/mindustry/world/blocks/defense/DeflectorWall.java index e9e9aa76b2..cf8f54a8ce 100644 --- a/core/src/mindustry/world/blocks/defense/DeflectorWall.java +++ b/core/src/mindustry/world/blocks/defense/DeflectorWall.java @@ -52,7 +52,7 @@ public class DeflectorWall extends Wall{ bullet.hitbox(rect2); - Vector2 position = Geometry.raycastRect(bullet.x - bullet.velocity().x*Time.delta(), bullet.y - bullet.velocity().y*Time.delta(), bullet.x + bullet.velocity().x*Time.delta(), bullet.y + bullet.velocity().y*Time.delta(), + Vec2 position = Geometry.raycastRect(bullet.x - bullet.velocity().x*Time.delta(), bullet.y - bullet.velocity().y*Time.delta(), bullet.x + bullet.velocity().x*Time.delta(), bullet.y + bullet.velocity().y*Time.delta(), rect.setSize(size * tilesize + rect2.width*2 + rect2.height*2).setCenter(entity.x, entity.y)); if(position != null){ diff --git a/core/src/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java index ba8eb7a872..a74e4abf94 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ArtilleryTurret.java @@ -1,7 +1,7 @@ package mindustry.world.blocks.defense.turrets; import arc.math.Mathf; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import mindustry.entities.Predict; import mindustry.entities.type.Bullet; import mindustry.entities.bullet.BulletType; @@ -31,7 +31,7 @@ public class ArtilleryTurret extends ItemTurret{ tr.trns(entity.rotation, size * tilesize / 2); - Vector2 predict = Predict.intercept(tile, entity.target, type.speed); + Vec2 predict = Predict.intercept(tile, entity.target, type.speed); float dst = entity.dst(predict.x, predict.y); float maxTraveled = type.lifetime * type.speed; diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 2c82960b6c..75ca4bcf2d 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -10,7 +10,7 @@ import arc.graphics.Color; import arc.graphics.g2d.*; import arc.math.Angles; import arc.math.Mathf; -import arc.math.geom.Vector2; +import arc.math.geom.Vec2; import arc.util.Time; import mindustry.content.Fx; import mindustry.entities.*; @@ -54,8 +54,8 @@ public abstract class Turret extends Block{ public boolean targetAir = true; public boolean targetGround = true; - protected Vector2 tr = new Vector2(); - protected Vector2 tr2 = new Vector2(); + protected Vec2 tr = new Vec2(); + protected Vec2 tr2 = new Vec2(); public TextureRegion baseRegion, heatRegion; @@ -162,7 +162,7 @@ public abstract class Turret extends Block{ float speed = type.speed; if(speed < 0.1f) speed = 9999999f; - Vector2 result = Predict.intercept(entity, entity.target, speed); + Vec2 result = Predict.intercept(entity, entity.target, speed); if(result.isZero()){ result.set(entity.target.getX(), entity.target.getY()); } diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index 09aee2f83c..23f564df04 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -28,8 +28,8 @@ public class Conveyor extends Block implements Autotiler{ private static ItemPos drawpos = new ItemPos(); private static ItemPos pos1 = new ItemPos(); private static ItemPos pos2 = new ItemPos(); - private final Vector2 tr1 = new Vector2(); - private final Vector2 tr2 = new Vector2(); + private final Vec2 tr1 = new Vec2(); + private final Vec2 tr2 = new Vec2(); private TextureRegion[][] regions = new TextureRegion[7][4]; public float speed = 0f; @@ -283,7 +283,7 @@ public class Conveyor extends Block implements Autotiler{ } @Override - public void getStackOffset(Item item, Tile tile, Vector2 trns){ + public void getStackOffset(Item item, Tile tile, Vec2 trns){ trns.trns(tile.rotation() * 90 + 180f, tilesize / 2f); } diff --git a/core/src/mindustry/world/blocks/logic/MessageBlock.java b/core/src/mindustry/world/blocks/logic/MessageBlock.java index 9cc778b540..cb7498138d 100644 --- a/core/src/mindustry/world/blocks/logic/MessageBlock.java +++ b/core/src/mindustry/world/blocks/logic/MessageBlock.java @@ -142,7 +142,7 @@ public class MessageBlock extends Block{ @Override public void updateTableAlign(Tile tile, Table table){ - Vector2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() + tile.block().size * tilesize / 2f + 1); + Vec2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() + tile.block().size * tilesize / 2f + 1); table.setPosition(pos.x, pos.y, Align.bottom); } diff --git a/core/src/mindustry/world/blocks/power/NuclearReactor.java b/core/src/mindustry/world/blocks/power/NuclearReactor.java index 4aa8663c86..31f95f10a6 100644 --- a/core/src/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/mindustry/world/blocks/power/NuclearReactor.java @@ -24,7 +24,7 @@ import static mindustry.Vars.*; public class NuclearReactor extends PowerGenerator{ public final int timerFuel = timers++; - public final Vector2 tr = new Vector2(); + public final Vec2 tr = new Vec2(); public Color lightColor = Color.valueOf("7f19ea"); public Color coolColor = new Color(1, 1, 1, 0f); diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 589c241d8e..7a267abeef 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -22,7 +22,7 @@ public class PowerNode extends PowerBlock{ protected static boolean returnValue = false; protected final ObjectSet graphs = new ObjectSet<>(); - protected final Vector2 t1 = new Vector2(), t2 = new Vector2(); + protected final Vec2 t1 = new Vec2(), t2 = new Vec2(); public TextureRegion laser, laserEnd; public float laserRange = 6; diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index b2957064f0..27b967f94e 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -1,17 +1,17 @@ package mindustry.desktop; import arc.*; -import club.minnced.discord.rpc.*; -import com.codedisaster.steamworks.*; import arc.Files.*; -import io.anuke.arc.backends.sdl.*; -import io.anuke.arc.backends.sdl.jni.*; -import arc.struct.*; +import arc.backend.sdl.*; import arc.files.*; import arc.func.*; import arc.math.*; +import arc.struct.*; import arc.util.*; import arc.util.serialization.*; +import club.minnced.discord.rpc.*; +import com.codedisaster.steamworks.*; +import io.anuke.arc.backends.sdl.jni.*; import mindustry.*; import mindustry.core.GameState.*; import mindustry.core.*; diff --git a/tools/src/mindustry/tools/ScriptStubGenerator.java b/tools/src/mindustry/tools/ScriptStubGenerator.java index 0bfa92675a..d13bbbdd49 100644 --- a/tools/src/mindustry/tools/ScriptStubGenerator.java +++ b/tools/src/mindustry/tools/ScriptStubGenerator.java @@ -21,7 +21,7 @@ import java.util.*; public class ScriptStubGenerator{ public static void main(String[] args){ - String base = "io.anuke.mindustry"; + String base = "mindustry"; Array blacklist = Array.with("plugin", "mod", "net", "io", "tools"); Array nameBlacklist = Array.with("ClientLauncher", "NetClient", "NetServer", "ClassAccess"); Array> whitelist = Array.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class, @@ -45,7 +45,7 @@ public class ScriptStubGenerator{ .setScanners(new SubTypesScanner(false), new ResourcesScanner()) .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0]))) .filterInputsBy(new FilterBuilder() - .include(FilterBuilder.prefix("io.anuke.mindustry")) + .include(FilterBuilder.prefix("mindustry")) .include(FilterBuilder.prefix("arc.func")) .include(FilterBuilder.prefix("arc.struct")) .include(FilterBuilder.prefix("arc.scene")) @@ -72,7 +72,7 @@ public class ScriptStubGenerator{ //Log.info(result); new Fi("core/assets/scripts/global.js").writeString(result.toString()); - new Fi("core/src/io/anuke/mindustry/mod/ClassAccess.java").writeString(fileTemplate + new Fi("core/src/mindustry/mod/ClassAccess.java").writeString(fileTemplate .replace("$ALLOWED_CLASSES$", classes.toString(", ", type -> type.getName() + ".class")) .replace("$ALLOWED_CLASS_NAMES$", classes.toString(", ", type -> "\"" + type.getName() + "\""))); }