diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties new file mode 100644 index 0000000000..545dae5693 --- /dev/null +++ b/annotations/src/main/resources/classids.properties @@ -0,0 +1,16 @@ +#Maps entity names to IDs. Autogenerated. + +draug=0 +mindustry.entities.comp.BulletComp=1 +mindustry.entities.comp.DecalComp=2 +mindustry.entities.comp.EffectComp=3 +mindustry.entities.comp.FireComp=4 +mindustry.entities.comp.PlayerComp=5 +mindustry.entities.comp.PuddleComp=6 +mindustry.entities.comp.TileComp=7 +mindustry.type.Weather.WeatherComp=8 +mindustry.world.blocks.storage.LaunchPad.LaunchPayloadComp=9 +phantom=10 +titan=11 +vanguard=12 +wraith=13 \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/BuilderUnitEntity/0.json b/annotations/src/main/resources/revisions/BuilderUnitEntity/0.json new file mode 100644 index 0000000000..2b9663c159 --- /dev/null +++ b/annotations/src/main/resources/revisions/BuilderUnitEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:requests,type:arc.struct.Queue,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json b/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json new file mode 100644 index 0000000000..25aa74f6fe --- /dev/null +++ b/annotations/src/main/resources/revisions/CommanderUnitWaterMoveEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/FireEntity/0.json b/annotations/src/main/resources/revisions/FireEntity/0.json new file mode 100644 index 0000000000..a5423a835b --- /dev/null +++ b/annotations/src/main/resources/revisions/FireEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:baseFlammability,type:float,size:4},{name:block,type:mindustry.world.Block,size:-1},{name:lifetime,type:float,size:4},{name:puddleFlammability,type:float,size:4},{name:tile,type:mindustry.world.Tile,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/LaunchPayloadEntity/0.json b/annotations/src/main/resources/revisions/LaunchPayloadEntity/0.json new file mode 100644 index 0000000000..13ca6b7f49 --- /dev/null +++ b/annotations/src/main/resources/revisions/LaunchPayloadEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:lifetime,type:float,size:4},{name:stacks,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/LegsUnitEntity/0.json b/annotations/src/main/resources/revisions/LegsUnitEntity/0.json new file mode 100644 index 0000000000..1351f965a9 --- /dev/null +++ b/annotations/src/main/resources/revisions/LegsUnitEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:baseRotation,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/MinerUnitEntity/0.json b/annotations/src/main/resources/revisions/MinerUnitEntity/0.json new file mode 100644 index 0000000000..d9c2fbd34f --- /dev/null +++ b/annotations/src/main/resources/revisions/MinerUnitEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/PuddleEntity/0.json b/annotations/src/main/resources/revisions/PuddleEntity/0.json new file mode 100644 index 0000000000..09114ed8ea --- /dev/null +++ b/annotations/src/main/resources/revisions/PuddleEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:accepting,type:float,size:4},{name:amount,type:float,size:4},{name:generation,type:int,size:4},{name:lastRipple,type:float,size:4},{name:liquid,type:mindustry.type.Liquid,size:-1},{name:tile,type:mindustry.world.Tile,size:-1},{name:updateTime,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/UnitEntity/0.json b/annotations/src/main/resources/revisions/UnitEntity/0.json new file mode 100644 index 0000000000..25aa74f6fe --- /dev/null +++ b/annotations/src/main/resources/revisions/UnitEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/WeatherEntity/0.json b/annotations/src/main/resources/revisions/WeatherEntity/0.json new file mode 100644 index 0000000000..84ba06dbcd --- /dev/null +++ b/annotations/src/main/resources/revisions/WeatherEntity/0.json @@ -0,0 +1 @@ +{fields:[{name:intensity,type:float,size:4},{name:life,type:float,size:4},{name:opacity,type:float,size:4},{name:weather,type:mindustry.type.Weather,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} \ No newline at end of file diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 93176b3534..2ca9a20960 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -282,7 +282,7 @@ public class UnitTypes implements ContentList{ shootY = 1f; x = 1f; shootX = 3f; - reload = 70f; + reload = 50f; alternate = true; recoil = 4f; shootSound = Sounds.laser; diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index b85e67810d..fe626cdf29 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -571,7 +571,7 @@ public class NetClient implements ApplicationListener{ unit instanceof Legsc ? ((Legsc)unit).baseRotation() : 0, unit.vel().x, unit.vel().y, player.miner().mineTile(), - /*player.isBoosting*/false, control.input.isShooting, ui.chatfrag.shown(), + control.input.isBoosting, control.input.isShooting, ui.chatfrag.shown(), requests, Core.camera.position.x, Core.camera.position.y, Core.camera.width * viewScale, Core.camera.height * viewScale); diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 7461016a49..0b206fa85b 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -591,6 +591,8 @@ public class NetServer implements ApplicationListener{ connection.rejectedRequests.clear(); if(!player.dead()){ + player.unit().elevation(!player.unit().type().flying && boosting && player.unit().type().canBoost ? 1f : 0f); + Unitc unit = player.unit(); long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime); float maxSpeed = player.dead() ? Float.MAX_VALUE : player.unit().type().speed; diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 2a544edd67..c1178e703f 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -504,9 +504,7 @@ public class DesktopInput extends InputHandler{ removeSelection(selectX, selectY, cursorX, cursorY); } - if(selected != null && selected.entity != null){ - tryDropItems(selected.entity, Core.input.mouseWorld().x, Core.input.mouseWorld().y); - } + tryDropItems(selected == null ? null : selected.entity, Core.input.mouseWorld().x, Core.input.mouseWorld().y); if(sreq != null){ if(getRequest(sreq.x, sreq.y, sreq.block.size, sreq) != null){ diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 410de92f4c..3a8f1541c8 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -802,7 +802,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ return droppingItem; } - public void tryDropItems(Tilec tile, float x, float y){ + public void tryDropItems(@Nullable Tilec tile, float x, float y){ if(!droppingItem || player.unit().stack().amount <= 0 || canTapPlayer(x, y) || state.isPaused() ){ droppingItem = false; return; @@ -812,7 +812,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ ItemStack stack = player.unit().stack(); - if(tile.acceptStack(stack.item, stack.amount, player.unit()) > 0 && tile.interactable(player.team()) && tile.block().hasItems && player.unit().stack().amount > 0 && tile.interactable(player.team())){ + if(tile != null && tile.acceptStack(stack.item, stack.amount, player.unit()) > 0 && tile.interactable(player.team()) && tile.block().hasItems && player.unit().stack().amount > 0 && tile.interactable(player.team())){ Call.transferInventory(player, tile); }else{ Call.dropItem(player.angleTo(x, y)); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index f0d9cb381f..d8762fad42 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -325,7 +325,6 @@ public class UnitType extends UnlockableContent{ } for(int i : Mathf.signs){ - //Draw.mixcol(Color.valueOf("989aa4"), Math.max(sin * i, 0)); Draw.rect(legRegion, unit.x() + Angles.trnsx(unit.baseRotation(), ft * i - boostTrns, -boostTrns*i), unit.y() + Angles.trnsy(unit.baseRotation(), ft * i - boostTrns, -boostTrns*i), @@ -333,7 +332,6 @@ public class UnitType extends UnlockableContent{ legRegion.getHeight() * Draw.scl - Math.max(-sin * i, 0) * legRegion.getHeight() * 0.5f * Draw.scl, unit.baseRotation() - 90 + 35f*i*e); } - //Draw.mixcol(); if(floor.isLiquid){ Draw.color(Color.white, floor.mapColor, unit.drownTime() * 0.4f);