diff --git a/android/build.gradle b/android/build.gradle index d073b66a15..b2a1d49e4d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,8 +7,7 @@ buildscript{ } dependencies{ - //note that later versions, like alpha05, fail to work correctly - classpath 'com.android.tools.build:gradle:7.1.0-alpha02' + classpath 'com.android.tools.build:gradle:7.0.1' } } diff --git a/core/assets-raw/sprites/blocks/extra/block-select.png b/core/assets-raw/sprites/blocks/extra/block-select.png index e9d19b9e7e..62f6a9576f 100644 Binary files a/core/assets-raw/sprites/blocks/extra/block-select.png and b/core/assets-raw/sprites/blocks/extra/block-select.png differ diff --git a/core/assets-raw/sprites/statuses/status-shielded.png b/core/assets-raw/sprites/statuses/status-shielded.png new file mode 100644 index 0000000000..b079c1bfef Binary files /dev/null and b/core/assets-raw/sprites/statuses/status-shielded.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 7479623f14..4b23c006a4 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -395,6 +395,11 @@ waves.load = Load from Clipboard waves.invalid = Invalid waves in clipboard. waves.copied = Waves copied. waves.none = No enemies defined.\nNote that empty wave layouts will automatically be replaced with the default layout. +waves.sort = Sort By +waves.sort.reverse = Reverse Sort +waves.sort.begin = Begin +waves.sort.health = Health +waves.sort.type = Type #these are intentionally in lower case wavemode.counts = counts @@ -650,6 +655,7 @@ status.sapped.name = Sapped status.electrified.name = Electrified status.spore-slowed.name = Spore Slowed status.tarred.name = Tarred +status.overdrive.name = Overdrive status.overclock.name = Overclock status.shocked.name = Shocked status.blasted.name = Blasted diff --git a/core/assets/contributors b/core/assets/contributors index 5099ab7e37..55e0341789 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -127,3 +127,4 @@ WilloIzCitron SAMBUYYA genNAowl TranquillyUnpleasant +Darkness6030 diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java index 5ea23d3555..a7d1791e20 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -83,7 +83,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform Fonts.loadDefaultFont(); //load fallback atlas if max texture size is below 4096 - assets.load(new AssetDescriptor<>(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class)).loaded = t -> atlas = (TextureAtlas)t; + assets.load(new AssetDescriptor<>(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class)).loaded = t -> atlas = t; assets.loadRun("maps", Map.class, () -> maps.loadPreviews()); Musics.load(); diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index ea40754222..c977d42a24 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -197,6 +197,7 @@ public class WaveSpawner{ unit.add(); unit.unloaded(); + Events.fire(new UnitSpawnEvent(unit)); Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type); } diff --git a/core/src/mindustry/ctype/UnlockableContent.java b/core/src/mindustry/ctype/UnlockableContent.java index c45f076061..0c1c610b9a 100644 --- a/core/src/mindustry/ctype/UnlockableContent.java +++ b/core/src/mindustry/ctype/UnlockableContent.java @@ -27,6 +27,8 @@ public abstract class UnlockableContent extends MappableContent{ public boolean alwaysUnlocked = false; /** Whether to show the description in the research dialog preview. */ public boolean inlineDescription = true; + /** Whether details of blocks are hidden in custom games if they haven't been unlocked in campaign mode. */ + public boolean hideDetails = true; /** Special logic icon ID. */ public int iconId = 0; /** Icon of the content to use in UI. */ diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index eb3ce423e1..359c0b2499 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -1,9 +1,11 @@ package mindustry.editor; import arc.*; +import arc.func.*; import arc.graphics.*; import arc.math.*; import arc.scene.event.*; +import arc.scene.style.*; import arc.scene.ui.*; import arc.scene.ui.TextField.*; import arc.scene.ui.layout.*; @@ -29,6 +31,8 @@ public class WaveInfoDialog extends BaseDialog{ private Table table; private int start = 0; private UnitType lastType = UnitTypes.dagger; + private Sort sort = Sort.begin; + private boolean reverseSort = false; private float updateTimer, updatePeriod = 1f; private WaveGraph graph = new WaveGraph(); @@ -41,6 +45,27 @@ public class WaveInfoDialog extends BaseDialog{ addCloseListener(); onResize(this::setup); + buttons.button(Icon.filter, () -> { + BaseDialog dialog = new BaseDialog("@waves.sort"); + dialog.setFillParent(false); + dialog.cont.table(Tex.button, t -> { + for(Sort s : Sort.all){ + t.button("@waves.sort." + s, Styles.clearTogglet, () -> { + sort = s; + dialog.hide(); + buildGroups(); + }).size(150f, 60f).checked(s == sort); + } + }).row(); + dialog.cont.check("@waves.sort.reverse", b -> { + reverseSort = b; + buildGroups(); + }).padTop(4).checked(reverseSort).padBottom(8f); + dialog.addCloseButton(); + dialog.show(); + buildGroups(); + }).size(60f, 64f); + addCloseButton(); buttons.button("@waves.edit", () -> { @@ -165,7 +190,8 @@ public class WaveInfoDialog extends BaseDialog{ table.margin(10f); if(groups != null){ - groups.sort(g -> g.begin); + groups.sort(sort.sort); + if(reverseSort) groups.reverse(); for(SpawnGroup group : groups){ table.table(Tex.button, t -> { @@ -179,6 +205,11 @@ public class WaveInfoDialog extends BaseDialog{ b.label(() -> (group.begin + 1) + "").color(Color.lightGray).minWidth(45f).labelAlign(Align.left).left(); + b.button(group.effect != null && group.effect != StatusEffects.none ? + new TextureRegionDrawable(group.effect.uiIcon) : + Icon.logicSmall, + Styles.emptyi, () -> showEffect(group)).pad(-6).size(46f); + b.button(Icon.unitsSmall, Styles.emptyi, () -> showUpdate(group)).pad(-6).size(46f); b.button(Icon.cancel, Styles.emptyi, () -> { groups.remove(group); @@ -269,7 +300,10 @@ public class WaveInfoDialog extends BaseDialog{ a.add("@waves.shields").padLeft(4); }).row(); - t.check("@waves.guardian", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f); + t.check("@waves.guardian", b -> { + group.effect = (b ? StatusEffects.boss : null); + buildGroups(); + }).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)).padBottom(8f); } }).width(340f).pad(8); @@ -306,6 +340,53 @@ public class WaveInfoDialog extends BaseDialog{ dialog.show(); } + void showEffect(SpawnGroup group){ + BaseDialog dialog = new BaseDialog(""); + dialog.setFillParent(true); + dialog.cont.pane(p -> { + int i = 0; + for(StatusEffect effect : content.statusEffects()){ + if(effect != StatusEffects.none && (effect.isHidden() || effect.reactive)) continue; + + p.button(t -> { + t.left(); + if(effect.uiIcon != null && effect != StatusEffects.none){ + t.image(effect.uiIcon).size(8 * 4).scaling(Scaling.fit).padRight(2f); + }else{ + t.image(Icon.none).size(8 * 4).scaling(Scaling.fit).padRight(2f); + } + + if(effect != StatusEffects.none){ + t.add(effect.localizedName); + }else{ + t.add("@settings.resetKey"); + } + }, () -> { + group.effect = effect; + dialog.hide(); + buildGroups(); + }).pad(2).margin(12f).fillX(); + if(++i % 3 == 0) p.row(); + } + }); + dialog.addCloseButton(); + dialog.show(); + } + + enum Sort{ + begin(g -> g.begin), + health(g -> g.type.health), + type(g -> g.type.id); + + static final Sort[] all = values(); + + final Floatf sort; + + Sort(Floatf sort){ + this.sort = sort; + } + } + void updateWaves(){ graph.groups = groups; graph.from = start; diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index cc11cf29fa..e1d9e4e857 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -465,8 +465,8 @@ public class Damage{ for(int dx = -trad; dx <= trad; dx++){ for(int dy = -trad; dy <= trad; dy++){ Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy); - if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && Mathf.dst(dx, dy) <= trad){ - tile.build.damage(damage); + if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad){ + tile.build.damage(team, damage); } } } diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index f10b221c8f..07e1e6dddb 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -7,6 +7,9 @@ import mindustry.entities.*; import mindustry.gen.*; public class RailBulletType extends BulletType{ + //for calculating the furthest point + static float furthest = 0; + public Effect pierceEffect = Fx.hitBulletSmall, updateEffect = Fx.none; /** Multiplier of damage decreased per health pierced. */ public float pierceDamageFactor = 1f; @@ -47,6 +50,11 @@ public class RailBulletType extends BulletType{ //subtract health from each consecutive pierce b.damage -= Math.min(b.damage, sub); + + //bullet was stopped, decrease furthest distance + if(b.damage <= 0f){ + furthest = Math.min(furthest, b.dst(pos)); + } } @Override @@ -54,8 +62,9 @@ public class RailBulletType extends BulletType{ super.init(b); b.fdata = length; + furthest = length; Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false); - float resultLen = b.fdata; + float resultLen = furthest; Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor(); for(float i = 0; i <= resultLen; i += updateEffectSeg){ diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index 27a92be992..d36a399150 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -133,8 +133,9 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw int x = x0f, dx = Math.abs(x1 - x), sx = x < x1 ? 1 : -1; int y = y0f, dy = Math.abs(y1 - y), sy = y < y1 ? 1 : -1; int e2, err = dx - dy; + int ww = world.width(), wh = world.height(); - while(true){ + while(x >= 0 && y >= 0 && x < ww && y < wh){ Building build = world.build(x, y); if(build != null && isAdded() && build.collide(self()) && type.testCollision(self(), build) && !build.dead() && (type.collidesTeam || build.team != team) && !(type.pierceBuilding && hasCollided(build.id))){ diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index c72ffc403c..66bc472c6f 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -428,6 +428,15 @@ public class EventType{ } } + /** Called when a unit is spawned by wave. */ + public static class UnitSpawnEvent{ + public final Unit unit; + + public UnitSpawnEvent(Unit unit) { + this.unit = unit; + } + } + /** Called when a unit is dumped from any payload block. */ public static class UnitUnloadEvent{ public final Unit unit; diff --git a/core/src/mindustry/game/Waves.java b/core/src/mindustry/game/Waves.java index 415ccea8fc..867c1476ce 100644 --- a/core/src/mindustry/game/Waves.java +++ b/core/src/mindustry/game/Waves.java @@ -116,7 +116,7 @@ public class Waves{ spacing = 5; unitAmount = 1; unitScaling = 3; - effect = StatusEffects.shielded; + shields = 640f; max = 25; }}, diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index fdfadf1389..75673c4b13 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -236,7 +236,6 @@ public class PlanetRenderer implements Disposable{ Tmp.c1.set(from).lerp(to, (f+ Time.globalTime /timeScale)%1f); batch.color(Tmp.c1); batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f)); - } batch.flush(Gl.lineStrip); } diff --git a/core/src/mindustry/maps/generators/FileMapGenerator.java b/core/src/mindustry/maps/generators/FileMapGenerator.java index ebebd03877..f2e38e8d6b 100644 --- a/core/src/mindustry/maps/generators/FileMapGenerator.java +++ b/core/src/mindustry/maps/generators/FileMapGenerator.java @@ -21,6 +21,16 @@ public class FileMapGenerator implements WorldGenerator{ this.preset = preset; } + public FileMapGenerator(Map map, SectorPreset preset){ + this.map = map; + this.preset = preset; + } + + /** If you use this constructor, make sure to override generate()! */ + public FileMapGenerator(SectorPreset preset){ + this(emptyMap, preset); + } + @Override public void generate(Tiles tiles){ if(map == null) throw new RuntimeException("Generator has null map, cannot be used."); diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index e53de0a4ad..8e3f3ad2b1 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -225,6 +225,10 @@ public class Mods implements Loadable{ var shadow = Core.atlas; //dummy texture atlas that returns the 'shadow' regions; used for mod loading Core.atlas = new TextureAtlas(){ + { + //needed for the correct operation of the found() method in the TextureRegion + error = shadow.find("error"); + } @Override public AtlasRegion find(String name){ diff --git a/core/src/mindustry/net/ArcNetProvider.java b/core/src/mindustry/net/ArcNetProvider.java index 4cc05ecccb..907ec63920 100644 --- a/core/src/mindustry/net/ArcNetProvider.java +++ b/core/src/mindustry/net/ArcNetProvider.java @@ -162,7 +162,9 @@ public class ArcNetProvider implements NetProvider{ client.connect(5000, ip, port, port); success.run(); }catch(Exception e){ - net.handleException(e); + if(netClient.isConnecting()){ + net.handleException(e); + } } }); } diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index 6fc58c9e06..35c881ea31 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -39,7 +39,7 @@ public class BeControl{ public BeControl(){ if(active()){ Timer.schedule(() -> { - if(Vars.clientLoaded && checkUpdates && !mobile){ + if((Vars.clientLoaded || headless) && checkUpdates && !mobile){ checkUpdate(t -> {}); } }, updateInterval, updateInterval); diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java index 2d5b3c4a4d..2596292bfb 100644 --- a/core/src/mindustry/ui/Fonts.java +++ b/core/src/mindustry/ui/Fonts.java @@ -196,12 +196,12 @@ public class Fonts{ size = 18; }}; - Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = (Font)t; + Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = t; Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{ size = 18; }})).loaded = f -> { - Fonts.tech = (Font)f; + Fonts.tech = f; Fonts.tech.getData().down *= 1.5f; }; } diff --git a/core/src/mindustry/ui/dialogs/ContentInfoDialog.java b/core/src/mindustry/ui/dialogs/ContentInfoDialog.java index f62ede3957..9e120155b4 100644 --- a/core/src/mindustry/ui/dialogs/ContentInfoDialog.java +++ b/core/src/mindustry/ui/dialogs/ContentInfoDialog.java @@ -81,7 +81,7 @@ public class ContentInfoDialog extends BaseDialog{ } if(content.details != null){ - table.add("[gray]" + (content.unlocked() ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX(); + table.add("[gray]" + (content.unlocked() || !content.hideDetails ? content.details : Iconc.lock + " " + Core.bundle.get("unlock.incampaign"))).pad(6).padTop(20).width(400f).wrap().fillX(); table.row(); } diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 5c9b13323d..7f8d771664 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -119,7 +119,7 @@ public class JoinDialog extends BaseDialog{ refreshLocal(); refreshRemote(); - refreshGlobal(); + refreshCommunity(); } void setupRemote(){ @@ -331,7 +331,7 @@ public class JoinDialog extends BaseDialog{ if(eye){ name.button(Icon.eyeSmall, Styles.emptyi, () -> { showHidden = !showHidden; - refreshGlobal(); + refreshCommunity(); }).update(i -> i.getStyle().imageUp = (showHidden ? Icon.eyeSmall : Icon.eyeOffSmall)) .size(40f).right().padRight(3).tooltip("@servers.showhidden"); } @@ -357,7 +357,7 @@ public class JoinDialog extends BaseDialog{ net.discoverServers(this::addLocalHost, this::finishLocalHosts); } - void refreshGlobal(){ + void refreshCommunity(){ int cur = refreshes; global.clear(); diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index fbd6fa2ee9..8c1dc4701d 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -375,8 +375,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ } if(selectAlpha > 0.001f){ - - for(Sector sec : planet.sectors){ if(sec.hasBase()){ for(Sector enemy : sec.near()){ diff --git a/core/src/mindustry/ui/fragments/LoadingFragment.java b/core/src/mindustry/ui/fragments/LoadingFragment.java index a8ba631420..41e3ca537d 100644 --- a/core/src/mindustry/ui/fragments/LoadingFragment.java +++ b/core/src/mindustry/ui/fragments/LoadingFragment.java @@ -83,6 +83,7 @@ public class LoadingFragment extends Fragment{ } public void show(String text){ + button.visible = false; nameLabel.setColor(Color.white); bar.visible = false; table.clearActions(); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 65e06f9fbe..a9f22fe395 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -850,6 +850,10 @@ public class Block extends UnlockableContent{ if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){ throw new IllegalArgumentException("Consumer using buffered power: " + name); } + + if(buildVisibility == BuildVisibility.sandboxOnly){ + hideDetails = false; + } } @Override diff --git a/core/src/mindustry/world/blocks/payloads/PayloadBlock.java b/core/src/mindustry/world/blocks/payloads/PayloadBlock.java index 86023894e3..ea4de86c26 100644 --- a/core/src/mindustry/world/blocks/payloads/PayloadBlock.java +++ b/core/src/mindustry/world/blocks/payloads/PayloadBlock.java @@ -79,7 +79,7 @@ public class PayloadBlock extends Block{ @Override public boolean canControlSelect(Player player){ - return !player.unit().spawnedByCore && this.payload == null && acceptUnitPayload(player.unit()) && player.tileOn().build == this; + return !player.unit().spawnedByCore && this.payload == null && acceptUnitPayload(player.unit()) && player.tileOn() != null && player.tileOn().build == this; } @Override diff --git a/core/src/mindustry/world/blocks/power/PowerGraph.java b/core/src/mindustry/world/blocks/power/PowerGraph.java index b510ef2285..5e5ff19022 100644 --- a/core/src/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/mindustry/world/blocks/power/PowerGraph.java @@ -174,9 +174,9 @@ public class PowerGraph{ return Math.min(excess, capacity); } - public void distributePower(float needed, float produced){ + public void distributePower(float needed, float produced, boolean charged){ //distribute even if not needed. this is because some might be requiring power but not using it; it updates consumers - float coverage = Mathf.zero(needed) && Mathf.zero(produced) ? 0f : Mathf.zero(needed) ? 1f : Math.min(1, produced / needed); + float coverage = Mathf.zero(needed) && Mathf.zero(produced) && !charged ? 0f : Mathf.zero(needed) ? 1f : Math.min(1, produced / needed); for(Building consumer : consumers){ Consumers consumes = consumer.block.consumes; if(consumes.hasPower()){ @@ -233,6 +233,7 @@ public class PowerGraph{ energyDelta = 0f; if(!(consumers.size == 0 && producers.size == 0 && batteries.size == 0)){ + boolean charged = false; if(!Mathf.equal(powerNeeded, powerProduced)){ if(powerNeeded > powerProduced){ @@ -240,11 +241,12 @@ public class PowerGraph{ powerProduced += powerBatteryUsed; lastPowerProduced += powerBatteryUsed; }else if(powerProduced > powerNeeded){ + charged = true; powerProduced -= chargeBatteries(powerProduced - powerNeeded); } } - distributePower(powerNeeded, powerProduced); + distributePower(powerNeeded, powerProduced, charged); } } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index 57ddeb67ae..fc1e86d120 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -195,7 +195,7 @@ public class Drill extends Block{ } public boolean canMine(Tile tile){ - if(tile == null) return false; + if(tile == null || tile.block().isStatic()) return false; Item drops = tile.drop(); return drops != null && drops.hardness <= tier; } diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index ab7fa7024b..948b85f0ff 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -39,12 +39,15 @@ public class UnitFactory extends UnitBlock{ rotate = true; config(Integer.class, (UnitFactoryBuild tile, Integer i) -> { + if(tile.currentPlan == i) return; tile.currentPlan = i < 0 || i >= plans.size ? -1 : i; tile.progress = 0; }); config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> { - tile.currentPlan = plans.indexOf(p -> p.unit == val); + int next = plans.indexOf(p -> p.unit == val); + if(tile.currentPlan == next) return; + tile.currentPlan = next; tile.progress = 0; }); diff --git a/core/src/mindustry/world/draw/DrawRotator.java b/core/src/mindustry/world/draw/DrawRotator.java index 3bbf1accc8..a6f2817748 100644 --- a/core/src/mindustry/world/draw/DrawRotator.java +++ b/core/src/mindustry/world/draw/DrawRotator.java @@ -9,14 +9,15 @@ import mindustry.world.blocks.production.GenericCrafter.*; public class DrawRotator extends DrawBlock{ public TextureRegion rotator, top; public boolean drawSpinSprite = false; + public float spinSpeed = 2f; @Override public void draw(GenericCrafterBuild build){ Draw.rect(build.block.region, build.x, build.y); if(drawSpinSprite){ - Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * 2f); + Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * spinSpeed); }else{ - Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f); + Draw.rect(rotator, build.x, build.y, build.totalProgress * spinSpeed); } if(top.found()) Draw.rect(top, build.x, build.y); } diff --git a/gradle.properties b/gradle.properties index b3ec89f9e1..09cc4bfc63 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=7e96b986053ce489aae161aa6bcbb5d921c609d4 +archash=dd43cacc5c5a68bd7160234a97b4fd48d9a816d7 diff --git a/servers_be.json b/servers_be.json index eff76d37c5..8d93d2bf8f 100644 --- a/servers_be.json +++ b/servers_be.json @@ -3,7 +3,7 @@ "address": "be.mindustry.nydus.app:6567" }, { - "address": "mindustry.pl:7777" + "address": "46.105.36.238:7777" }, { "address": "v7.mindurka.tk:9999" diff --git a/servers_v7.json b/servers_v7.json index 217026029a..eccd6ced6d 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -13,7 +13,7 @@ }, { "name": "Omega", - "address": ["yeet.mindustry.me:6567", "yeet.mindustry.me:2345", "n3.mindustry.me:4444","n2.mindustry.me:4040", "n2.mindustry.me:4002", "n2.mindustry.me:4001"] + "address": ["yeet.mindustry.me", "yeet.mindustry.me:2345", "n3.mindustry.me:4444","n2.mindustry.me:4040", "n2.mindustry.me:4002", "n2.mindustry.me:4001", "n3.mindustry.me", "n2.mindustry.me:4004"] }, { "name": "MeowLand",