diff --git a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java index c144abc534..0a0538483b 100644 --- a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java +++ b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java @@ -87,18 +87,18 @@ public class AssetsProcess extends BaseProcessor{ filename = filename.substring(0, filename.indexOf(".")); String sfilen = filename; - String dtype = p.name().endsWith(".9.png") ? "arc.scene.style.NinePatchDrawable" : "arc.scene.style.TextureRegionDrawable"; + String dtype = "arc.scene.style.Drawable"; String varname = capitalize(sfilen); if(SourceVersion.isKeyword(varname)) varname += "s"; type.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC); - load.addStatement(varname + " = (" + dtype + ")arc.Core.atlas.drawable($S)", sfilen); + load.addStatement(varname + " = arc.Core.atlas.drawable($S)", sfilen); }); for(Element elem : elements){ - Seq.with(((TypeElement)elem).getEnclosedElements()).each(e -> e.getKind() == ElementKind.FIELD, field -> { + Seq.with(elem.getEnclosedElements()).each(e -> e.getKind() == ElementKind.FIELD, field -> { String fname = field.getSimpleName().toString(); if(fname.startsWith("default")){ loadStyles.addStatement("arc.Core.scene.addStyle(" + field.asType().toString() + ".class, mindustry.ui.Styles." + fname + ")"); @@ -124,7 +124,7 @@ public class AssetsProcess extends BaseProcessor{ String name = p.nameWithoutExtension(); if(names.contains(name)){ - BaseProcessor.err("Duplicate file name: " + p.toString() + "!"); + BaseProcessor.err("Duplicate file name: " + p + "!"); }else{ names.add(name); } diff --git a/annotations/src/main/resources/revisions/BulletComp/2.json b/annotations/src/main/resources/revisions/BulletComp/2.json new file mode 100644 index 0000000000..3a075d3fbf --- /dev/null +++ b/annotations/src/main/resources/revisions/BulletComp/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:collided,type:arc.struct.IntSeq},{name:damage,type:float},{name:data,type:java.lang.Object},{name:fdata,type:float},{name:lifetime,type:float},{name:owner,type:mindustry.gen.Entityc},{name:rotation,type:float},{name:team,type:mindustry.game.Team},{name:time,type:float},{name:type,type:mindustry.entities.bullet.BulletType},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/alpha/2.json b/annotations/src/main/resources/revisions/alpha/2.json new file mode 100644 index 0000000000..5bf10ed861 --- /dev/null +++ b/annotations/src/main/resources/revisions/alpha/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/arkyid/2.json b/annotations/src/main/resources/revisions/arkyid/2.json new file mode 100644 index 0000000000..5bf10ed861 --- /dev/null +++ b/annotations/src/main/resources/revisions/arkyid/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/beta/2.json b/annotations/src/main/resources/revisions/beta/2.json new file mode 100644 index 0000000000..5bf10ed861 --- /dev/null +++ b/annotations/src/main/resources/revisions/beta/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/block/6.json b/annotations/src/main/resources/revisions/block/6.json new file mode 100644 index 0000000000..2fa2662e57 --- /dev/null +++ b/annotations/src/main/resources/revisions/block/6.json @@ -0,0 +1 @@ +{version:6,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/corvus/6.json b/annotations/src/main/resources/revisions/corvus/6.json new file mode 100644 index 0000000000..2fa2662e57 --- /dev/null +++ b/annotations/src/main/resources/revisions/corvus/6.json @@ -0,0 +1 @@ +{version:6,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/flare/6.json b/annotations/src/main/resources/revisions/flare/6.json new file mode 100644 index 0000000000..2fa2662e57 --- /dev/null +++ b/annotations/src/main/resources/revisions/flare/6.json @@ -0,0 +1 @@ +{version:6,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/gamma/2.json b/annotations/src/main/resources/revisions/gamma/2.json new file mode 100644 index 0000000000..5bf10ed861 --- /dev/null +++ b/annotations/src/main/resources/revisions/gamma/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/mace/6.json b/annotations/src/main/resources/revisions/mace/6.json new file mode 100644 index 0000000000..625b446d65 --- /dev/null +++ b/annotations/src/main/resources/revisions/mace/6.json @@ -0,0 +1 @@ +{version:6,fields:[{name:ammo,type:float},{name:baseRotation,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/mega/4.json b/annotations/src/main/resources/revisions/mega/4.json new file mode 100644 index 0000000000..647e3ce02a --- /dev/null +++ b/annotations/src/main/resources/revisions/mega/4.json @@ -0,0 +1 @@ +{version:4,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/mono/5.json b/annotations/src/main/resources/revisions/mono/5.json new file mode 100644 index 0000000000..a914b97628 --- /dev/null +++ b/annotations/src/main/resources/revisions/mono/5.json @@ -0,0 +1 @@ +{version:5,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/nova/4.json b/annotations/src/main/resources/revisions/nova/4.json new file mode 100644 index 0000000000..2562a5f0c5 --- /dev/null +++ b/annotations/src/main/resources/revisions/nova/4.json @@ -0,0 +1 @@ +{version:4,fields:[{name:ammo,type:float},{name:baseRotation,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/oct/4.json b/annotations/src/main/resources/revisions/oct/4.json new file mode 100644 index 0000000000..647e3ce02a --- /dev/null +++ b/annotations/src/main/resources/revisions/oct/4.json @@ -0,0 +1 @@ +{version:4,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/poly/4.json b/annotations/src/main/resources/revisions/poly/4.json new file mode 100644 index 0000000000..7d090769e7 --- /dev/null +++ b/annotations/src/main/resources/revisions/poly/4.json @@ -0,0 +1 @@ +{version:4,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/pulsar/2.json b/annotations/src/main/resources/revisions/pulsar/2.json new file mode 100644 index 0000000000..a3a3b83466 --- /dev/null +++ b/annotations/src/main/resources/revisions/pulsar/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:baseRotation,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/quad/5.json b/annotations/src/main/resources/revisions/quad/5.json new file mode 100644 index 0000000000..b8e94f88a9 --- /dev/null +++ b/annotations/src/main/resources/revisions/quad/5.json @@ -0,0 +1 @@ +{version:5,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/quasar/2.json b/annotations/src/main/resources/revisions/quasar/2.json new file mode 100644 index 0000000000..a3a3b83466 --- /dev/null +++ b/annotations/src/main/resources/revisions/quasar/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:baseRotation,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/risso/6.json b/annotations/src/main/resources/revisions/risso/6.json new file mode 100644 index 0000000000..2fa2662e57 --- /dev/null +++ b/annotations/src/main/resources/revisions/risso/6.json @@ -0,0 +1 @@ +{version:6,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/spiroct/5.json b/annotations/src/main/resources/revisions/spiroct/5.json new file mode 100644 index 0000000000..a914b97628 --- /dev/null +++ b/annotations/src/main/resources/revisions/spiroct/5.json @@ -0,0 +1 @@ +{version:5,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/toxopid/2.json b/annotations/src/main/resources/revisions/toxopid/2.json new file mode 100644 index 0000000000..5bf10ed861 --- /dev/null +++ b/annotations/src/main/resources/revisions/toxopid/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/core/assets/cubemaps/stars/back.png b/core/assets/cubemaps/stars/back.png index 05f3375811..b0f9074a31 100644 Binary files a/core/assets/cubemaps/stars/back.png and b/core/assets/cubemaps/stars/back.png differ diff --git a/core/assets/cubemaps/stars/bottom.png b/core/assets/cubemaps/stars/bottom.png index bfcded64e3..089cefc75e 100644 Binary files a/core/assets/cubemaps/stars/bottom.png and b/core/assets/cubemaps/stars/bottom.png differ diff --git a/core/assets/cubemaps/stars/front.png b/core/assets/cubemaps/stars/front.png index 8e9dbcd437..7916c07721 100644 Binary files a/core/assets/cubemaps/stars/front.png and b/core/assets/cubemaps/stars/front.png differ diff --git a/core/assets/cubemaps/stars/left.png b/core/assets/cubemaps/stars/left.png index f99a70ab1b..f1ddf1b770 100644 Binary files a/core/assets/cubemaps/stars/left.png and b/core/assets/cubemaps/stars/left.png differ diff --git a/core/assets/cubemaps/stars/right.png b/core/assets/cubemaps/stars/right.png index f1c6f5c807..87f4c3c20f 100644 Binary files a/core/assets/cubemaps/stars/right.png and b/core/assets/cubemaps/stars/right.png differ diff --git a/core/assets/cubemaps/stars/top.png b/core/assets/cubemaps/stars/top.png index 078e1a3d3f..6cc55de5b2 100644 Binary files a/core/assets/cubemaps/stars/top.png and b/core/assets/cubemaps/stars/top.png differ diff --git a/core/assets/shaders/mud.frag b/core/assets/shaders/mud.frag index 3858cdec63..c185c0e552 100644 --- a/core/assets/shaders/mud.frag +++ b/core/assets/shaders/mud.frag @@ -20,9 +20,9 @@ void main(){ vec4 color = texture2D(u_texture, c); if(noise > 0.54 && noise < 0.68){ - color.rgb *= 1.4; + color.rgb *= vec3(1.4); }else if(!(noise > 0.40 && noise < 0.54)){ - color.rgb *= 1.2; + color.rgb *= vec3(1.2); } gl_FragColor = color; diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index dcf55e93d5..bb156a6587 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -801,12 +801,12 @@ public class Blocks implements ContentList{ }}; disassembler = new Separator("disassembler"){{ - requirements(Category.crafting, with(Items.graphite, 140, Items.titanium, 100, Items.silicon, 150, Items.surgeAlloy, 70)); + requirements(Category.crafting, with(Items.plastanium, 40, Items.titanium, 100, Items.silicon, 150, Items.thorium, 80)); results = with( Items.sand, 4, Items.graphite, 2, Items.titanium, 2, - Items.thorium, 1 + Items.thorium, 2 ); hasPower = true; craftTime = 15f; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index f4f2214c74..b6a8d995d6 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -120,7 +120,7 @@ public class UnitTypes implements ContentList{ hitSize = 13f; rotateSpeed = 3f; targetAir = false; - health = 820; + health = 900; armor = 9f; mechFrontSway = 0.55f; @@ -133,15 +133,15 @@ public class UnitTypes implements ContentList{ shake = 2f; ejectEffect = Fx.casing2; shootSound = Sounds.artillery; - bullet = new ArtilleryBulletType(2f, 8, "shell"){{ + bullet = new ArtilleryBulletType(2f, 20, "shell"){{ hitEffect = Fx.blastExplosion; knockback = 0.8f; lifetime = 120f; width = height = 14f; collides = true; collidesTiles = true; - splashDamageRadius = 30f; - splashDamage = 60f; + splashDamageRadius = 35f; + splashDamage = 80f; backColor = Pal.bulletYellowBack; frontColor = Pal.bulletYellow; }}; @@ -2155,6 +2155,7 @@ public class UnitTypes implements ContentList{ bullet = new EmpBulletType(){{ float rad = 100f; + scaleVelocity = true; lightOpacity = 0.7f; unitDamageScl = 0.8f; healPercent = 20f; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 7ed52813a7..ebe84d0f24 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -93,7 +93,7 @@ public class BulletType extends Content implements Cloneable{ public boolean collides = true; /** Whether velocity is inherited from the shooter. */ public boolean keepVelocity = true; - /** Whether to scale velocity to disappear at the target position. Used for artillery. */ + /** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */ public boolean scaleVelocity; /** Whether this bullet can be hit by point defense. */ public boolean hittable = true; diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index c967d4dff4..e1254670f0 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -44,6 +44,13 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw } } + //bullets always considered local + @Override + @Replace + public boolean isLocal(){ + return true; + } + @Override public void add(){ type.init(self()); diff --git a/core/src/mindustry/entities/comp/ShieldComp.java b/core/src/mindustry/entities/comp/ShieldComp.java index d1d3b50a87..aa77d1e8bc 100644 --- a/core/src/mindustry/entities/comp/ShieldComp.java +++ b/core/src/mindustry/entities/comp/ShieldComp.java @@ -16,8 +16,8 @@ abstract class ShieldComp implements Healthc, Posc{ /** Absorbs health damage. */ float shield; - /** Subtracts an amount from damage. */ - float armor; + /** Subtracts an amount from damage. No need to save. */ + transient float armor; /** Shield opacity. */ transient float shieldAlpha = 0f; diff --git a/core/src/mindustry/entities/comp/VelComp.java b/core/src/mindustry/entities/comp/VelComp.java index 3e79b04e17..8be3a30151 100644 --- a/core/src/mindustry/entities/comp/VelComp.java +++ b/core/src/mindustry/entities/comp/VelComp.java @@ -13,20 +13,24 @@ import static mindustry.Vars.*; abstract class VelComp implements Posc{ @Import float x, y; - //TODO @SyncLocal this? does it even need to be sent? - transient final Vec2 vel = new Vec2(); + @SyncLocal Vec2 vel = new Vec2(); + transient float drag = 0f; //velocity needs to be called first, as it affects delta and lastPosition @MethodPriority(-1) @Override public void update(){ - float px = x, py = y; - move(vel.x * Time.delta, vel.y * Time.delta); - if(Mathf.equal(px, x)) vel.x = 0; - if(Mathf.equal(py, y)) vel.y = 0; + //do not update velocity on the client at all, unless it's non-interpolated + //velocity conflicts with interpolation. + if(!net.client() || isLocal()){ + float px = x, py = y; + move(vel.x * Time.delta, vel.y * Time.delta); + if(Mathf.equal(px, x)) vel.x = 0; + if(Mathf.equal(py, y)) vel.y = 0; - vel.scl(Math.max(1f - drag * Time.delta, 0)); + vel.scl(Math.max(1f - drag * Time.delta, 0)); + } } /** @return function to use for check solid state. if null, no checking is done. */ diff --git a/core/src/mindustry/logic/LCanvas.java b/core/src/mindustry/logic/LCanvas.java index 1be513c7de..8ebedb101a 100644 --- a/core/src/mindustry/logic/LCanvas.java +++ b/core/src/mindustry/logic/LCanvas.java @@ -181,7 +181,7 @@ public class LCanvas extends Table{ float dst = Math.min(y - this.y, Core.graphics.getHeight() - y); if(dst < Scl.scl(100f)){ //scroll margin int sign = Mathf.sign(Core.graphics.getHeight()/2f - y); - pane.setScrollY(pane.getScrollY() + sign * Scl.scl(15f)); + pane.setScrollY(pane.getScrollY() + sign * Scl.scl(15f) * Time.delta); } } } diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index 318ebe04d0..6fc58c9e06 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -1,7 +1,6 @@ package mindustry.net; import arc.*; -import arc.Net.*; import arc.files.*; import arc.func.*; import arc.util.*; @@ -62,27 +61,25 @@ public class BeControl{ /** asynchronously checks for updates. */ public void checkUpdate(Boolc done){ - Core.net.httpGet("https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest", res -> { - if(res.getStatus() == HttpStatus.OK){ - Jval val = Jval.read(res.getResultAsString()); - int newBuild = Strings.parseInt(val.getString("tag_name", "0")); - if(newBuild > Version.build){ - Jval asset = val.get("assets").asArray().find(v -> v.getString("name", "").startsWith(headless ? "Mindustry-BE-Server" : "Mindustry-BE-Desktop")); - String url = asset.getString("browser_download_url", ""); - updateAvailable = true; - updateBuild = newBuild; - updateUrl = url; - Core.app.post(() -> { - showUpdateDialog(); - done.get(true); - }); - }else{ - Core.app.post(() -> done.get(false)); - } + Http.get("https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest") + .error(e -> {}) //ignore errors + .submit(res -> { + Jval val = Jval.read(res.getResultAsString()); + int newBuild = Strings.parseInt(val.getString("tag_name", "0")); + if(newBuild > Version.build){ + Jval asset = val.get("assets").asArray().find(v -> v.getString("name", "").startsWith(headless ? "Mindustry-BE-Server" : "Mindustry-BE-Desktop")); + String url = asset.getString("browser_download_url", ""); + updateAvailable = true; + updateBuild = newBuild; + updateUrl = url; + Core.app.post(() -> { + showUpdateDialog(); + done.get(true); + }); }else{ Core.app.post(() -> done.get(false)); } - }, error -> {}); //ignore errors + }); } /** @return whether a new update is available */ diff --git a/core/src/mindustry/net/CrashSender.java b/core/src/mindustry/net/CrashSender.java index fb84190307..b1cbfdbf58 100644 --- a/core/src/mindustry/net/CrashSender.java +++ b/core/src/mindustry/net/CrashSender.java @@ -1,7 +1,6 @@ package mindustry.net; import arc.*; -import arc.Net.*; import arc.files.*; import arc.func.*; import arc.struct.*; @@ -150,12 +149,12 @@ public class CrashSender{ Log.info("Sending crash report."); //post to crash report URL, exit code indicates send success - new arc.Net().http(new HttpRequest().block(true).method(HttpMethod.POST).content(value.toJson(OutputType.json)).url(Vars.crashReportURL), r -> { - Log.info("Crash sent successfully."); - System.exit(1); - }, t -> { + Http.post(Vars.crashReportURL, value.toJson(OutputType.json)).error(t -> { Log.info("Crash report not sent."); System.exit(-1); + }).block(r -> { + Log.info("Crash sent successfully."); + System.exit(1); }); ret(); diff --git a/core/src/mindustry/ui/Styles.java b/core/src/mindustry/ui/Styles.java index 90ffbaae89..4e7042fe80 100644 --- a/core/src/mindustry/ui/Styles.java +++ b/core/src/mindustry/ui/Styles.java @@ -39,6 +39,8 @@ public class Styles{ public static TreeStyle defaultTree; public static void load(){ + var whiteui = (TextureRegionDrawable)Tex.whiteui; + black = whiteui.tint(0f, 0f, 0f, 1f); black9 = whiteui.tint(0f, 0f, 0f, 0.9f); black8 = whiteui.tint(0f, 0f, 0f, 0.8f); diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 459a6471f7..2d42534be5 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -1,7 +1,6 @@ package mindustry.ui.dialogs; import arc.*; -import arc.Net.*; import arc.graphics.*; import arc.input.*; import arc.math.*; @@ -533,38 +532,27 @@ public class JoinDialog extends BaseDialog{ Log.info("Fetching community servers at @", url); //get servers - Core.net.httpGet(url, result -> { - try{ - if(result.getStatus() != HttpStatus.OK){ - Log.warn("Failed to fetch community servers: @", result.getStatus()); - return; + Http.get(url) + .error(t -> Log.err("Failed to fetch community servers", t)) + .submit(result -> { + Jval val = Jval.read(result.getResultAsString()); + Seq servers = new Seq<>(); + val.asArray().each(child -> { + String name = child.getString("name", ""); + String[] addresses; + if(child.has("addresses") || (child.has("address") && child.get("address").isArray())){ + addresses = (child.has("addresses") ? child.get("addresses") : child.get("address")).asArray().map(Jval::asString).toArray(String.class); + }else{ + addresses = new String[]{child.getString("address", "")}; } - - Jval val = Jval.read(result.getResultAsString()); - Core.app.post(() -> { - try{ - defaultServers.clear(); - val.asArray().each(child -> { - String name = child.getString("name", ""); - String[] addresses; - if(child.has("addresses") || (child.has("address") && child.get("address").isArray())){ - addresses = (child.has("addresses") ? child.get("addresses") : child.get("address")).asArray().map(Jval::asString).toArray(String.class); - }else{ - addresses = new String[]{child.getString("address", "")}; - } - defaultServers.add(new ServerGroup(name, addresses)); - }); - Log.info("Fetched @ community servers.", defaultServers.size); - }catch(Throwable e){ - Log.err("Failed to parse community servers."); - Log.err(e); - } - }); - }catch(Throwable e){ - Log.err("Failed to fetch community servers."); - Log.err(e); - } - }, Log::err); + servers.add(new ServerGroup(name, addresses)); + }); + //modify default servers on main thread + Core.app.post(() -> { + defaultServers.addAll(servers); + Log.info("Fetched @ community servers.", defaultServers.size); + }); + }); } private void saveServers(){ diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index afe38d02d7..944995a20c 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -1,7 +1,7 @@ package mindustry.ui.dialogs; import arc.*; -import arc.Net.*; +import arc.util.Http.*; import arc.files.*; import arc.func.*; import arc.graphics.*; @@ -104,6 +104,8 @@ public class ModsDialog extends BaseDialog{ if(Strings.getCauses(error).contains(t -> t.getMessage() != null && (t.getMessage().contains("trust anchor") || t.getMessage().contains("SSL") || t.getMessage().contains("protocol")))){ ui.showErrorMessage("@feature.unsupported"); + }else if(error instanceof HttpStatusException st){ + ui.showErrorMessage(Core.bundle.format("connectfail", Strings.capitalize(st.status.toString().toLowerCase()))); }else{ ui.showException(error); } @@ -111,33 +113,27 @@ public class ModsDialog extends BaseDialog{ void getModList(Cons> listener){ if(modList == null){ - Core.net.httpGet("https://raw.githubusercontent.com/Anuken/MindustryMods/master/mods.json", response -> { + Http.get("https://raw.githubusercontent.com/Anuken/MindustryMods/master/mods.json", response -> { String strResult = response.getResultAsString(); - var status = response.getStatus(); Core.app.post(() -> { - if(status != HttpStatus.OK){ - ui.showErrorMessage(Core.bundle.format("connectfail", status)); - }else{ - try{ - modList = JsonIO.json.fromJson(Seq.class, ModListing.class, strResult); + try{ + modList = JsonIO.json.fromJson(Seq.class, ModListing.class, strResult); - var d = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - Func parser = text -> { - try{ - return d.parse(text); - }catch(Exception e){ - return new Date(); - } - }; - - modList.sortComparing(m -> parser.get(m.lastUpdated)).reverse(); - listener.get(modList); - }catch(Exception e){ - e.printStackTrace(); - ui.showException(e); - } + var d = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + Func parser = text -> { + try{ + return d.parse(text); + }catch(Exception e){ + return new Date(); + } + }; + modList.sortComparing(m -> parser.get(m.lastUpdated)).reverse(); + listener.get(modList); + }catch(Exception e){ + e.printStackTrace(); + ui.showException(e); } }); }, error -> Core.app.post(() -> modError(error))); @@ -423,21 +419,19 @@ public class ModsDialog extends BaseDialog{ //textures are only requested when the rendering happens; this assists with culling if(!textureCache.containsKey(repo)){ - textureCache.put(repo, last = Tex.nomap.getRegion()); - Core.net.httpGet("https://raw.githubusercontent.com/Anuken/MindustryMods/master/icons/" + repo.replace("/", "_"), res -> { - if(res.getStatus() == HttpStatus.OK){ - Pixmap pix = new Pixmap(res.getResult()); - Core.app.post(() -> { - try{ - var tex = new Texture(pix); - tex.setFilter(TextureFilter.linear); - textureCache.put(repo, new TextureRegion(tex)); - pix.dispose(); - }catch(Exception e){ - Log.err(e); - } - }); - } + textureCache.put(repo, last = Core.atlas.find("nomap")); + Http.get("https://raw.githubusercontent.com/Anuken/MindustryMods/master/icons/" + repo.replace("/", "_"), res -> { + Pixmap pix = new Pixmap(res.getResult()); + Core.app.post(() -> { + try{ + var tex = new Texture(pix); + tex.setFilter(TextureFilter.linear); + textureCache.put(repo, new TextureRegion(tex)); + pix.dispose(); + }catch(Exception e){ + Log.err(e); + } + }); }, err -> {}); } @@ -522,19 +516,17 @@ public class ModsDialog extends BaseDialog{ githubImportJavaMod(repo); }else{ ui.loadfrag.show(); - Core.net.httpGet(ghApi + "/repos/" + repo, res -> { - if(checkError(res)){ - var json = Jval.read(res.getResultAsString()); - String mainBranch = json.getString("default_branch"); - String language = json.getString("language", ""); + Http.get(ghApi + "/repos/" + repo, res -> { + var json = Jval.read(res.getResultAsString()); + String mainBranch = json.getString("default_branch"); + String language = json.getString("language", ""); - //this is a crude heuristic for class mods; only required for direct github import - //TODO make a more reliable way to distinguish java mod repos - if(language.equals("Java") || language.equals("Kotlin")){ - githubImportJavaMod(repo); - }else{ - githubImportBranch(mainBranch, repo, this::showStatus); - } + //this is a crude heuristic for class mods; only required for direct github import + //TODO make a more reliable way to distinguish java mod repos + if(language.equals("Java") || language.equals("Kotlin")){ + githubImportJavaMod(repo); + }else{ + githubImportBranch(mainBranch, repo); } }, this::importFail); } @@ -542,62 +534,33 @@ public class ModsDialog extends BaseDialog{ private void githubImportJavaMod(String repo){ //grab latest release - Core.net.httpGet(ghApi + "/repos/" + repo + "/releases/latest", res -> { - if(checkError(res)){ - var json = Jval.read(res.getResultAsString()); - var assets = json.get("assets").asArray(); + Http.get(ghApi + "/repos/" + repo + "/releases/latest", res -> { + var json = Jval.read(res.getResultAsString()); + var assets = json.get("assets").asArray(); - //prioritize dexed jar, as that's what Sonnicon's mod template outputs - var dexedAsset = assets.find(j -> j.getString("name").startsWith("dexed") && j.getString("name").endsWith(".jar")); - var asset = dexedAsset == null ? assets.find(j -> j.getString("name").endsWith(".jar")) : dexedAsset; + //prioritize dexed jar, as that's what Sonnicon's mod template outputs + var dexedAsset = assets.find(j -> j.getString("name").startsWith("dexed") && j.getString("name").endsWith(".jar")); + var asset = dexedAsset == null ? assets.find(j -> j.getString("name").endsWith(".jar")) : dexedAsset; - if(asset != null){ - //grab actual file - var url = asset.getString("browser_download_url"); - Core.net.httpGet(url, result -> { - if(checkError(result)){ - handleMod(repo, result); - } - }, this::importFail); - }else{ - throw new ArcRuntimeException("No JAR file found in releases. Make sure you have a valid jar file in the mod's latest Github Release."); - } + if(asset != null){ + //grab actual file + var url = asset.getString("browser_download_url"); + + Http.get(url, result -> handleMod(repo, result), this::importFail); + }else{ + throw new ArcRuntimeException("No JAR file found in releases. Make sure you have a valid jar file in the mod's latest Github Release."); } }, this::importFail); } - private boolean checkError(HttpResponse res){ - if(res.getStatus() == HttpStatus.OK){ - return true; - }else{ - showStatus(res.getStatus()); - return false; - } - } - - private void showStatus(HttpStatus status){ - Core.app.post(() -> { - ui.showErrorMessage(Core.bundle.format("connectfail", Strings.capitalize(status.toString().toLowerCase()))); - ui.loadfrag.hide(); - }); - } - - private void githubImportBranch(String branch, String repo, Cons err){ - Core.net.httpGet(ghApi + "/repos/" + repo + "/zipball/" + branch, loc -> { - if(loc.getStatus() == HttpStatus.OK){ - if(loc.getHeader("Location") != null){ - Core.net.httpGet(loc.getHeader("Location"), result -> { - if(result.getStatus() != HttpStatus.OK){ - err.get(result.getStatus()); - }else{ - handleMod(repo, result); - } - }, this::importFail); - }else{ - handleMod(repo, loc); - } + private void githubImportBranch(String branch, String repo){ + Http.get(ghApi + "/repos/" + repo + "/zipball/" + branch, loc -> { + if(loc.getHeader("Location") != null){ + Http.get(loc.getHeader("Location"), result -> { + handleMod(repo, result); + }, this::importFail); }else{ - err.get(loc.getStatus()); + handleMod(repo, loc); } }, this::importFail); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/LiquidTurret.java b/core/src/mindustry/world/blocks/defense/turrets/LiquidTurret.java index 29ba6b9f77..c03f196367 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/LiquidTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/LiquidTurret.java @@ -85,7 +85,7 @@ public class LiquidTurret extends Turret{ @Override public boolean shouldActiveSound(){ - return wasShooting; + return wasShooting && enabled; } @Override diff --git a/core/src/mindustry/world/blocks/environment/Prop.java b/core/src/mindustry/world/blocks/environment/Prop.java index 6adfff5edb..45da9aae88 100644 --- a/core/src/mindustry/world/blocks/environment/Prop.java +++ b/core/src/mindustry/world/blocks/environment/Prop.java @@ -12,8 +12,6 @@ public class Prop extends Block{ breakable = true; alwaysReplace = true; instantDeconstruct = true; - - deconstructThreshold = 0.35f; breakEffect = Fx.breakProp; } diff --git a/core/src/mindustry/world/blocks/payloads/PayloadMassDriver.java b/core/src/mindustry/world/blocks/payloads/PayloadMassDriver.java index 0d1821c2f6..71a1aa1f23 100644 --- a/core/src/mindustry/world/blocks/payloads/PayloadMassDriver.java +++ b/core/src/mindustry/world/blocks/payloads/PayloadMassDriver.java @@ -34,7 +34,7 @@ public class PayloadMassDriver extends PayloadBlock{ public Sound shootSound = Sounds.shootBig; public float shake = 3f; - public Effect transferEffect = new Effect(11f, 300f, e -> { + public Effect transferEffect = new Effect(11f, 600f, e -> { if(!(e.data instanceof PayloadMassDriverData data)) return; Tmp.v1.set(data.x, data.y).lerp(data.ox, data.oy, Interp.sineIn.apply(e.fin())); data.payload.set(Tmp.v1.x, Tmp.v1.y, e.rotation); diff --git a/core/src/mindustry/world/blocks/production/Separator.java b/core/src/mindustry/world/blocks/production/Separator.java index 3809ce3e80..a863178208 100644 --- a/core/src/mindustry/world/blocks/production/Separator.java +++ b/core/src/mindustry/world/blocks/production/Separator.java @@ -128,19 +128,17 @@ public class Separator extends Block{ return !consumes.itemFilters.get(item.id); } - //TODO write seed in 128 release, don't write it now for compatibility with 127.x - //@Override - //public byte version(){ - // return 1; - //} + @Override + public byte version(){ + return 1; + } @Override public void write(Writes write){ super.write(write); write.f(progress); write.f(warmup); - //TODO see above - //write.i(seed); + write.i(seed); } @Override @@ -148,8 +146,7 @@ public class Separator extends Block{ super.read(read, revision); progress = read.f(); warmup = read.f(); - //TODO see above - //if(revision == 1) seed = read.i(); + if(revision == 1) seed = read.i(); } } } diff --git a/gradle.properties b/gradle.properties index 95715623ae..fce1f0cf7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,4 @@ kapt.include.compile.classpath=false kotlin.stdlib.default.dependency=false #needed for android compilation android.useAndroidX=true -archash=33c4976f8084fbb6fc26cfdcca2dda3442711d17 +archash=b4dc34071be92f154034d9d9621e015f5c49030c diff --git a/tests/src/test/java/GenericModTest.java b/tests/src/test/java/GenericModTest.java index 621b4d2f0f..46843116f7 100644 --- a/tests/src/test/java/GenericModTest.java +++ b/tests/src/test/java/GenericModTest.java @@ -1,5 +1,4 @@ -import arc.*; -import arc.Net.*; +import arc.util.*; import arc.util.io.*; import mindustry.*; import org.junit.jupiter.api.*; @@ -14,13 +13,13 @@ public class GenericModTest{ static void grabMod(String url){ //clear older mods ApplicationTests.testDataFolder.deleteDirectory(); - new Net().http(new HttpRequest().block(true).url(url).method(HttpMethod.GET), httpResponse -> { + Http.get(url).error(Assertions::fail).block(httpResponse -> { try{ ApplicationTests.testDataFolder.child("mods").child("test_mod." + (url.endsWith("jar") ? "jar" : "zip")).writeBytes(Streams.copyBytes(httpResponse.getResultAsStream())); }catch(IOException e){ Assertions.fail(e); } - }, Assertions::fail); + }); ApplicationTests.launchApplication(false); } diff --git a/tools/src/mindustry/tools/FontGenerator.java b/tools/src/mindustry/tools/FontGenerator.java index 6a3fb62476..bd9cd34235 100644 --- a/tools/src/mindustry/tools/FontGenerator.java +++ b/tools/src/mindustry/tools/FontGenerator.java @@ -1,13 +1,9 @@ package mindustry.tools; -import arc.*; -import arc.Net.*; import arc.files.*; import arc.util.*; import arc.util.io.*; -import java.io.*; - /* icon font pipeline: 1. take set of pre-defined icons and SVGs 2. use Fontello API to get a font with these @@ -18,7 +14,6 @@ public class FontGenerator{ //E000 to F8FF public static void main(String[] args){ - Net net = Core.net = new Net(); Fi folder = Fi.get("core/assets-raw/fontgen/out/"); folder.mkdirs(); @@ -29,13 +24,10 @@ public class FontGenerator{ Log.info("Zip..."); String session = folder.child("session").readString(); - net.http(new HttpRequest().method(HttpMethod.GET).url("https://fontello.com/" + session + "/get").block(true), result -> { - try{ - Streams.copy(result.getResultAsStream(), folder.child("font.zip").write()); - }catch(IOException e){ - throw new RuntimeException(e); - } - }, Log::err); + + Http.get("https://fontello.com/" + session + "/get").block(result -> { + Streams.copy(result.getResultAsStream(), folder.child("font.zip").write()); + }); Log.info("Icon font..."); @@ -49,9 +41,9 @@ public class FontGenerator{ //TODO this is broken Log.info(OS.exec("fontforge", "-script", - Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(), - Fi.get("core/assets/fonts/font.woff").absolutePath(), - Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath()) + Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(), + Fi.get("core/assets/fonts/font.woff").absolutePath(), + Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath()) ); Log.info("Done.");