From ec2c273c9784c6aea3339ed64b8a0d0d96c5b9ed Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 9 Jun 2021 22:55:48 -0400 Subject: [PATCH 01/16] Add an automatic item produce requirement --- core/src/mindustry/mod/ContentParser.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 6738257d79..6862b1a540 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -707,6 +707,11 @@ public class ContentParser{ node.objectives.addAll(parser.readValue(Objective[].class, research.get("objectives"))); } + //all items have a produce requirement unless already specified + if(object instanceof Item i && !node.objectives.contains(o -> o instanceof Produce p && p.content == i)){ + node.objectives.add(new Produce(i)); + } + //remove old node from parent if(node.parent != null){ node.parent.children.remove(node); From 86bf068ac36881535df7fbfb2c387704ba4e3c56 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 09:03:57 -0400 Subject: [PATCH 02/16] Fixed #5406 --- .../mindustry/world/blocks/logic/LogicBlock.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java index f38644e5f5..a12ed08399 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -174,6 +174,7 @@ public class LogicBlock extends Block{ public boolean active = true, valid; public int x, y; public String name; + Building lastBuild; public LogicLink(int x, int y, String name, boolean valid){ this.x = x; @@ -405,20 +406,22 @@ public class LogicBlock extends Block{ if(!l.active) continue; - boolean valid = validLink(world.build(l.x, l.y)); - if(valid != l.valid){ + var cur = world.build(l.x, l.y); + + boolean valid = validLink(cur); + if(valid != l.valid || (l.lastBuild != null && l.lastBuild != cur)){ + l.lastBuild = cur; changed = true; l.valid = valid; if(valid){ - Building lbuild = world.build(l.x, l.y); //this prevents conflicts l.name = ""; //finds a new matching name after toggling - l.name = findLinkName(lbuild.block); + l.name = findLinkName(cur.block); //remove redundant links - links.removeAll(o -> world.build(o.x, o.y) == lbuild && o != l); + links.removeAll(o -> world.build(o.x, o.y) == cur && o != l); //break to prevent concurrent modification updates = true; From dd500a747b7f1011d74e725ad95947826d867172 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 09:06:05 -0400 Subject: [PATCH 03/16] Update deployment.yml --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f3e83da601..29dad558e5 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -47,7 +47,7 @@ jobs: git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds cd ../MindustryBuilds echo "Updating version to ${RELEASE_VERSION:1}" - echo versionName=6-fdroid-${RELEASE_VERSION:1}$'\n'versionCode=${RELEASE_VERSION:1} > version_fdroid.txt + echo versionName=6-fdroid-${RELEASE_VERSION:1}$'\n'versionCode=${GITHUB_RUN_NUMBER} > version_fdroid.txt git add . git commit -m "Updating to build ${RELEASE_VERSION:1}" git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds From bcdbca7337419ddd69b31edff2a453483943925d Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 09:32:01 -0400 Subject: [PATCH 04/16] Fixed #5410 --- core/src/mindustry/ui/fragments/HudFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 79dcf85e40..9cb5d850e0 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -322,7 +322,7 @@ public class HudFragment extends Fragment{ } return max == 0f ? 0f : val / max; }).blink(Color.white).outline(new Color(0, 0, 0, 0.6f), 7f)).grow()) - .fillX().width(320f).height(60f).name("boss").visible(() -> state.rules.waves && state.boss() != null).padTop(7).row(); + .fillX().width(320f).height(60f).name("boss").visible(() -> state.rules.waves && state.boss() != null && !(mobile && Core.graphics.isPortrait())).padTop(7).row(); t.table(Styles.black3, p -> p.margin(4).label(() -> hudText).style(Styles.outlineLabel)).touchable(Touchable.disabled).with(p -> p.visible(() -> { p.color.a = Mathf.lerpDelta(p.color.a, Mathf.num(showHudText), 0.2f); From abcea8dd39de35137abbe0b1bace45d2ac4996c8 Mon Sep 17 00:00:00 2001 From: ulwepo <85295540+ulwepo@users.noreply.github.com> Date: Thu, 10 Jun 2021 22:35:44 +0900 Subject: [PATCH 05/16] Update servers_v6.json (#5407) This is Japanese server. Add a survival server and a sandbox server. Thank you --- servers_v6.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers_v6.json b/servers_v6.json index 79c86fc799..dfcd37de1b 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -101,7 +101,7 @@ }, { "name": "Sakura", - "address": ["160.16.207.141"] + "address": ["160.16.207.141", "160.16.207.141:21527", "160.16.207.141:31587"] }, { "name": "MeowLand", From a180aae8389147fc1c884699c696354bd8d53259 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 15:10:52 -0400 Subject: [PATCH 06/16] Blending cleanup / Misc bugfixes --- core/src/mindustry/ui/dialogs/GameOverDialog.java | 3 +-- core/src/mindustry/world/Block.java | 1 + .../mindustry/world/blocks/distribution/ArmoredConveyor.java | 1 + core/src/mindustry/world/blocks/distribution/Duct.java | 1 + .../src/mindustry/world/blocks/distribution/StackConveyor.java | 3 +-- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/ui/dialogs/GameOverDialog.java b/core/src/mindustry/ui/dialogs/GameOverDialog.java index 083e49c116..32e593ea0e 100644 --- a/core/src/mindustry/ui/dialogs/GameOverDialog.java +++ b/core/src/mindustry/ui/dialogs/GameOverDialog.java @@ -5,7 +5,6 @@ import mindustry.core.GameState.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.type.*; -import mindustry.ui.*; import static mindustry.Vars.*; @@ -31,7 +30,7 @@ public class GameOverDialog extends BaseDialog{ } void rebuild(){ - title.setText(state.isCampaign() ? "@sector.curlost" : "@gameover"); + title.setText(state.isCampaign() ? Core.bundle.format("sector.lost", state.getSector().name()) : "@gameover"); buttons.clear(); cont.clear(); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index bcee08544e..4f2f9a8ccd 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -46,6 +46,7 @@ public class Block extends UnlockableContent{ public boolean outputsPayload = false; public boolean acceptsPayload = false; public boolean outputFacing = true; + public boolean noSideBlend = false; public boolean acceptsItems = false; public int itemCapacity = 10; diff --git a/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java b/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java index af7e2c985b..e5e2c05545 100644 --- a/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java @@ -8,6 +8,7 @@ public class ArmoredConveyor extends Conveyor{ public ArmoredConveyor(String name){ super(name); + noSideBlend = true; } @Override diff --git a/core/src/mindustry/world/blocks/distribution/Duct.java b/core/src/mindustry/world/blocks/distribution/Duct.java index c2a63f238e..b485fe6341 100644 --- a/core/src/mindustry/world/blocks/distribution/Duct.java +++ b/core/src/mindustry/world/blocks/distribution/Duct.java @@ -38,6 +38,7 @@ public class Duct extends Block implements Autotiler{ itemCapacity = 1; noUpdateDisabled = true; rotate = true; + noSideBlend = true; envEnabled = Env.space | Env.terrestrial | Env.underwater; } diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index 7c7007cb54..030319a447 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -12,7 +12,6 @@ import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.type.*; -import mindustry.ui.*; import mindustry.world.*; import mindustry.world.blocks.*; import mindustry.world.blocks.distribution.Conveyor.*; @@ -63,7 +62,7 @@ public class StackConveyor extends Block implements Autotiler{ return otherblock.outputsItems() && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock); }else if(state == stateUnload){ //router mode return otherblock.acceptsItems && - (!(otherblock instanceof ArmoredConveyor) || lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock)) && + (!otherblock.noSideBlend || lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock)) && (notLookingAt(tile, rotation, otherx, othery, otherrot, otherblock) || (otherblock instanceof StackConveyor && facing(otherx, othery, otherrot, tile.x, tile.y))) && !(world.build(otherx, othery) instanceof StackConveyorBuild s && s.state == stateUnload) && From e4bd3fab7cbb24015bfbb76bcadcb428c7404466 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 15:39:43 -0400 Subject: [PATCH 07/16] Removed MetalFloor class --- core/src/mindustry/content/Blocks.java | 28 ++++++++----------- .../world/blocks/environment/Floor.java | 5 ++++ .../world/blocks/environment/MetalFloor.java | 19 ------------- 3 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 core/src/mindustry/world/blocks/environment/MetalFloor.java diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b64c2aca99..b1fac7921a 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -410,24 +410,20 @@ public class Blocks implements ContentList{ wall = sporeWall; }}; - metalFloor = new MetalFloor("metal-floor"){{ - variants = 0; - attributes.set(Attribute.water, -1f); - }}; + metalFloor = new Floor("metal-floor", 0); + metalFloorDamaged = new Floor("metal-floor-damaged", 3); - metalFloorDamaged = new MetalFloor("metal-floor-damaged", 3); + metalFloor2 = new Floor("metal-floor-2", 0); + metalFloor3 = new Floor("metal-floor-3", 0); + metalFloor4 = new Floor("metal-floor-4", 0); + metalFloor5 = new Floor("metal-floor-5", 0); - metalFloor2 = new MetalFloor("metal-floor-2"); - metalFloor3 = new MetalFloor("metal-floor-3"); - metalFloor4 = new MetalFloor("metal-floor-4"); - metalFloor5 = new MetalFloor("metal-floor-5"); - - darkPanel1 = new MetalFloor("dark-panel-1"); - darkPanel2 = new MetalFloor("dark-panel-2"); - darkPanel3 = new MetalFloor("dark-panel-3"); - darkPanel4 = new MetalFloor("dark-panel-4"); - darkPanel5 = new MetalFloor("dark-panel-5"); - darkPanel6 = new MetalFloor("dark-panel-6"); + darkPanel1 = new Floor("dark-panel-1", 0); + darkPanel2 = new Floor("dark-panel-2", 0); + darkPanel3 = new Floor("dark-panel-3", 0); + darkPanel4 = new Floor("dark-panel-4", 0); + darkPanel5 = new Floor("dark-panel-5", 0); + darkPanel6 = new Floor("dark-panel-6", 0); darkMetal = new StaticWall("dark-metal"); diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index 7cee47c4d0..b6697991c8 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -78,6 +78,11 @@ public class Floor extends Block{ super(name); } + public Floor(String name, int variants){ + super(name); + this.variants = variants; + } + @Override public void load(){ super.load(); diff --git a/core/src/mindustry/world/blocks/environment/MetalFloor.java b/core/src/mindustry/world/blocks/environment/MetalFloor.java deleted file mode 100644 index fd26f90183..0000000000 --- a/core/src/mindustry/world/blocks/environment/MetalFloor.java +++ /dev/null @@ -1,19 +0,0 @@ -package mindustry.world.blocks.environment; - -import mindustry.world.meta.*; - -/** Class for quickly defining a floor with no water and no variants. Offers no new functionality. */ -public class MetalFloor extends Floor{ - - public MetalFloor(String name){ - super(name); - variants = 0; - attributes.set(Attribute.water, -1); - } - - public MetalFloor(String name, int variants){ - super(name); - this.variants = variants; - attributes.set(Attribute.water, -1); - } -} From af2830602d04a5c811a949a4da3c45000641c5a5 Mon Sep 17 00:00:00 2001 From: MEEP of Faith <54301439+MEEPofFaith@users.noreply.github.com> Date: Thu, 10 Jun 2021 12:42:01 -0700 Subject: [PATCH 08/16] Let any block have variants. (#5372) --- .../mindustry/entities/comp/BuildingComp.java | 6 ++++- core/src/mindustry/world/Block.java | 24 +++++++++++++++---- .../mindustry/world/blocks/defense/Wall.java | 16 ------------- .../world/blocks/environment/Floor.java | 6 ++--- .../world/blocks/environment/Prop.java | 15 ------------ 5 files changed, 27 insertions(+), 40 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 8493610a4f..6c6bf1250d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -907,7 +907,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } public void draw(){ - Draw.rect(block.region, x, y, block.rotate ? rotdeg() : 0); + if(block.variants == 0){ + Draw.rect(block.region, x, y, block.rotate ? rotdeg() : 0); + }else{ + Draw.rect(block.variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, block.variantRegions.length - 1))], x, y, block.rotate ? rotdeg() : 0); + } drawTeamTop(); } diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 4f2f9a8ccd..b854d6bbab 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -78,6 +78,8 @@ public class Block extends UnlockableContent{ public boolean solidifes; /** whether this is rotateable */ public boolean rotate; + /** number of different variant regions to use */ + public int variants = 0; /** whether to draw a rotation arrow - this does not apply to lines of blocks */ public boolean drawArrow = true; /** for static blocks only: if true, tile data() is saved in world data. */ @@ -240,11 +242,11 @@ public class Block extends UnlockableContent{ public ObjectMap, Cons2> configurations = new ObjectMap<>(); protected TextureRegion[] generatedIcons; - protected TextureRegion[] variantRegions, editorVariantRegions; + protected TextureRegion[] editorVariantRegions; public TextureRegion region, editorIcon; public @Load("@-team") TextureRegion teamRegion; - public TextureRegion[] teamRegions; + public TextureRegion[] teamRegions, variantRegions; protected static final Seq tempTiles = new Seq<>(); protected static final Seq tempTileEnts = new Seq<>(); @@ -264,7 +266,11 @@ public class Block extends UnlockableContent{ if(tile.build != null){ tile.build.draw(); }else{ - Draw.rect(region, tile.drawx(), tile.drawy()); + if(variants == 0){ + Draw.rect(region, tile.drawx(), tile.drawy()); + }else{ + Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.drawx(), tile.drawy()); + } } } @@ -588,7 +594,8 @@ public class Block extends UnlockableContent{ protected TextureRegion[] icons(){ //use team region in vanilla team blocks - return teamRegion.found() && minfo.mod == null ? new TextureRegion[]{region, teamRegions[Team.sharded.id]} : new TextureRegion[]{region}; + TextureRegion r = variants > 0 ? Core.atlas.find(name + "1") : region; + return teamRegion.found() && minfo.mod == null ? new TextureRegion[]{r, teamRegions[Team.sharded.id]} : new TextureRegion[]{r}; } public TextureRegion[] getGeneratedIcons(){ @@ -831,6 +838,15 @@ public class Block extends UnlockableContent{ for(Team team : Team.all){ teamRegions[team.id] = teamRegion.found() ? Core.atlas.find(name + "-team-" + team.name, teamRegion) : teamRegion; } + + if(variants != 0){ + variantRegions = new TextureRegion[variants]; + + for(int i = 0; i < variants; i++){ + variantRegions[i] = Core.atlas.find(name + (i + 1)); + } + region = variantRegions[0]; + } } @Override diff --git a/core/src/mindustry/world/blocks/defense/Wall.java b/core/src/mindustry/world/blocks/defense/Wall.java index cde36ba964..10c5a7e5a9 100644 --- a/core/src/mindustry/world/blocks/defense/Wall.java +++ b/core/src/mindustry/world/blocks/defense/Wall.java @@ -15,8 +15,6 @@ import mindustry.world.meta.*; import static mindustry.Vars.*; public class Wall extends Block{ - public int variants = 0; - /** Lighting chance. -1 to disable */ public float lightningChance = -1f; public float lightningDamage = 20f; @@ -51,20 +49,6 @@ public class Wall extends Block{ } } - @Override - public void load(){ - super.load(); - - if(variants != 0){ - variantRegions = new TextureRegion[variants]; - - for(int i = 0; i < variants; i++){ - variantRegions[i] = Core.atlas.find(name + (i + 1)); - } - region = variantRegions[0]; - } - } - @Override public TextureRegion[] icons(){ return new TextureRegion[]{Core.atlas.find(Core.atlas.has(name) ? name : name + "1")}; diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index b6697991c8..8dcc228d4e 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -20,8 +20,6 @@ import mindustry.world.blocks.*; import static mindustry.Vars.*; public class Floor extends Block{ - /** number of different variant regions to use */ - public int variants = 3; /** edge fallback, used mainly for ores */ public String edge = "stone"; /** Multiplies unit velocity by this when walked on. */ @@ -76,6 +74,8 @@ public class Floor extends Block{ public Floor(String name){ super(name); + + variants = 3; } public Floor(String name, int variants){ @@ -90,7 +90,6 @@ public class Floor extends Block{ //load variant regions for drawing if(variants > 0){ variantRegions = new TextureRegion[variants]; - for(int i = 0; i < variants; i++){ variantRegions[i] = Core.atlas.find(name + (i + 1)); } @@ -98,7 +97,6 @@ public class Floor extends Block{ variantRegions = new TextureRegion[1]; variantRegions[0] = Core.atlas.find(name); } - int size = (int)(tilesize / Draw.scl); if(Core.atlas.has(name + "-edge")){ edges = Core.atlas.find(name + "-edge").split(size, size); diff --git a/core/src/mindustry/world/blocks/environment/Prop.java b/core/src/mindustry/world/blocks/environment/Prop.java index 1056748bce..6adfff5edb 100644 --- a/core/src/mindustry/world/blocks/environment/Prop.java +++ b/core/src/mindustry/world/blocks/environment/Prop.java @@ -7,8 +7,6 @@ import mindustry.content.*; import mindustry.world.*; public class Prop extends Block{ - public int variants; - public Prop(String name){ super(name); breakable = true; @@ -28,17 +26,4 @@ public class Prop extends Block{ public TextureRegion[] icons(){ return variants == 0 ? super.icons() : new TextureRegion[]{Core.atlas.find(name + "1")}; } - - @Override - public void load(){ - super.load(); - - if(variants > 0){ - variantRegions = new TextureRegion[variants]; - - for(int i = 0; i < variants; i++){ - variantRegions[i] = Core.atlas.find(name + (i + 1)); - } - } - } } From 8d9d6385f93158d5b2f3094a27229f5732a21498 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 15:52:33 -0400 Subject: [PATCH 09/16] Editor variant regions for wall blocks --- core/src/mindustry/editor/MapRenderer.java | 13 ++++++++++--- core/src/mindustry/world/Block.java | 7 +++++++ core/src/mindustry/world/blocks/defense/Wall.java | 6 +----- .../mindustry/world/blocks/environment/Floor.java | 10 +--------- tools/src/mindustry/tools/Generators.java | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core/src/mindustry/editor/MapRenderer.java b/core/src/mindustry/editor/MapRenderer.java index abbd4baa1a..e5a0ce1c01 100644 --- a/core/src/mindustry/editor/MapRenderer.java +++ b/core/src/mindustry/editor/MapRenderer.java @@ -18,6 +18,7 @@ public class MapRenderer implements Disposable{ private IndexedRenderer[][] chunks; private IntSet updates = new IntSet(); private IntSet delayedUpdates = new IntSet(); + private TextureRegion clearEditor; private int width, height; public void resize(int width, int height){ @@ -45,6 +46,7 @@ public class MapRenderer implements Disposable{ public void draw(float tx, float ty, float tw, float th){ Draw.flush(); + clearEditor = Core.atlas.find("clear-editor"); updates.each(i -> render(i % width, i / width)); updates.clear(); @@ -80,6 +82,7 @@ public class MapRenderer implements Disposable{ } public void updateAll(){ + clearEditor = Core.atlas.find("clear-editor"); for(int x = 0; x < width; x++){ for(int y = 0; y < height; y++){ render(x, y); @@ -103,7 +106,7 @@ public class MapRenderer implements Disposable{ boolean center = tile.isCenter(); if(wall != Blocks.air && wall.synthetic()){ - region = !Core.atlas.isFound(wall.editorIcon()) || !center ? Core.atlas.find("clear-editor") : wall.editorIcon(); + region = !wall.editorIcon().found() || !center ? clearEditor : wall.editorIcon(); float width = region.width * Draw.scl, height = region.height * Draw.scl; @@ -124,13 +127,17 @@ public class MapRenderer implements Disposable{ mesh.setColor(team.color); region = Core.atlas.find("block-border-editor"); }else if(!wall.synthetic() && wall != Blocks.air && center){ - region = !Core.atlas.isFound(wall.editorIcon()) ? Core.atlas.find("clear-editor") : wall.editorIcon(); + region = !wall.editorIcon().found() ? + clearEditor : wall.variants > 0 ? + wall.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, wall.editorVariantRegions().length - 1)] : + wall.editorIcon(); + offsetX = tilesize / 2f - region.width / 2f * Draw.scl; offsetY = tilesize / 2f - region.height / 2f * Draw.scl; }else if(wall == Blocks.air && !tile.overlay().isAir()){ region = tile.overlay().editorVariantRegions()[Mathf.randomSeed(idxWall, 0, tile.overlay().editorVariantRegions().length - 1)]; }else{ - region = Core.atlas.find("clear-editor"); + region = clearEditor; } float width = region.width * Draw.scl, height = region.height * Draw.scl; diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index b854d6bbab..11eb6b3bef 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -863,6 +863,13 @@ public class Block extends UnlockableContent{ mapColor.set(image.get(image.width/2, image.height/2)); } + if(variants > 0){ + for(int i = 0; i < variants; i++){ + String rname = name + (i + 1); + packer.add(PageType.editor, "editor-" + rname, Core.atlas.getPixmap(rname)); + } + } + Pixmap last = null; var gen = icons(); diff --git a/core/src/mindustry/world/blocks/defense/Wall.java b/core/src/mindustry/world/blocks/defense/Wall.java index 10c5a7e5a9..d8d1c620b4 100644 --- a/core/src/mindustry/world/blocks/defense/Wall.java +++ b/core/src/mindustry/world/blocks/defense/Wall.java @@ -59,11 +59,7 @@ public class Wall extends Block{ @Override public void draw(){ - if(variants == 0){ - Draw.rect(region, x, y); - }else{ - Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], x, y); - } + super.draw(); //draw flashing white overlay if enabled if(flashHit){ diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index 8dcc228d4e..762a5e4f9d 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -74,7 +74,6 @@ public class Floor extends Block{ public Floor(String name){ super(name); - variants = 3; } @@ -133,19 +132,12 @@ public class Floor extends Block{ @Override public void createIcons(MultiPacker packer){ super.createIcons(packer); - packer.add(PageType.editor, "editor-" + name, Core.atlas.getPixmap(fullIcon).crop()); + packer.add(PageType.editor, "editor-" + name, Core.atlas.getPixmap(fullIcon)); if(blendGroup != this){ return; } - if(variants > 0){ - for(int i = 0; i < variants; i++){ - String rname = name + (i + 1); - packer.add(PageType.editor, "editor-" + rname, Core.atlas.getPixmap(rname).crop()); - } - } - PixmapRegion image = Core.atlas.getPixmap(icons()[0]); PixmapRegion edge = Core.atlas.getPixmap("edge-stencil"); Pixmap result = new Pixmap(edge.width, edge.height); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 6f7ba3f5c5..626986b5ce 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -220,7 +220,7 @@ public class Generators{ TextureRegion[] regions = block.getGeneratedIcons(); - if(block instanceof Floor){ + if(block.variants > 0){ for(TextureRegion region : block.variantRegions()){ GenRegion gen = (GenRegion)region; if(gen.path == null) continue; From a0acf1a04010e643353f8dc4e0347abde15fdecc Mon Sep 17 00:00:00 2001 From: VozDuh <61590217+Voz-Duh@users.noreply.github.com> Date: Thu, 10 Jun 2021 23:01:04 +0300 Subject: [PATCH 10/16] Melter & Pulverizer Fixed (#5098) Co-authored-by: Anuken --- .../blocks/production/melter-liquid.png | Bin 0 -> 198 bytes .../blocks/production/pulverizer-rotator.png | Bin 210 -> 281 bytes .../blocks/production/pulverizer-top.png | Bin 0 -> 296 bytes .../sprites/blocks/production/pulverizer.png | Bin 292 -> 163 bytes core/src/mindustry/content/Blocks.java | 1 + core/src/mindustry/world/draw/DrawLiquid.java | 34 ++++++++++++++++++ .../src/mindustry/world/draw/DrawRotator.java | 12 ++++--- 7 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/production/melter-liquid.png create mode 100644 core/assets-raw/sprites/blocks/production/pulverizer-top.png create mode 100644 core/src/mindustry/world/draw/DrawLiquid.java diff --git a/core/assets-raw/sprites/blocks/production/melter-liquid.png b/core/assets-raw/sprites/blocks/production/melter-liquid.png new file mode 100644 index 0000000000000000000000000000000000000000..19d66fa18a06d9ded298f7982a1e8ae673813db6 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}jKx9jP7LeL$-HD>U|>mi z^mSxl*x1kgCy|wbfq}EYBeIx*f$uN~Gak=hk;1^h5bf#W7!u+B_L?CVg94B9#aDmd z#|X;Ecr7dx_{hGb*;!60qquzc%ze+cGJrsX@PQhaZ>p}WF0DdNj47_EEYm-DIz$_L qZ4-C1ZCtS;#_sTZ0g%Ev_8GiO7V??Cl+)P`;(NOKxvXEy*irU|?Wa@?5Z(fq{XwB*-uL|NsC08Gdi$3ua(o;4JWnEM{Qf zI}E~%$MaXDFfcGQdAc};SolA^V9nQHz{4ECwfFx_#clPUSGUYaI5@fRUckn)?KPao zM6X_xy2 zIyD`IcZvkKNNP!Z6X~`S-f`hBqaTaVF76LX4hyXt`S=t T6&M&87(8A5T-G@;B{Ts5)*@Z( delta 193 zcmbQqbcu0-WIY=L14D6D)fWZ^hMAr&jv*Ddk`p9Y7dLQhNW9+o-@qpMn$RAJNZn9f zwd0H;mMpU!pI9}dxIZvz5n`Y4gu{zx;SI(s9~fQJ0#x}l4coI;&WPFkiA(CAa4zEhJJ?bKeXOpZ$~dq(*{Mz7R9i?P zgPr??*9@zcCKbszT)k$f$tUslLJw0C0|Uz%UdicUSAQ}vFfe$!`njxgN@xNAgpx_5 diff --git a/core/assets-raw/sprites/blocks/production/pulverizer-top.png b/core/assets-raw/sprites/blocks/production/pulverizer-top.png new file mode 100644 index 0000000000000000000000000000000000000000..621e52e4cb60c9cafc9497f5b8cdbb05198b9063 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4rT@h2A3sW#~2tG7>k44ofy`glX=O&z`&C3 z=7ySSKe+CDwm0uVb z7&r?&B8wRq_zr)jvVo;Z+&Mv)qjBjG zmSg;@ekZo^#?6#Ax=YFerIHBd=qF<}u$*-<|r+@gjfR}Pr%OQ#X+=otI(BN)= r7$`Q$aZ2l1g@Wdj3*+{l_{tD6pW|gf*#u<<1_lOCS3j3^P68eREP%Ijl1n7#KJUJR*x382Ao@Fyrz36)6l1 z47Hvvjv*T7mrigLYEa-|R@PUjZG8M+Uh~2c$LcNODR-T?)`hBH_{6<2tVd`8ONw@a z#{{NL4JY`%@;Gp=^tr%0i(!N2jh3Ye_x+h3g^H{ESh7r>{r=j|djD8&FMN7SXpNix z;j15CGuwJel(ZWz*nC9%!UFAo0YVp;FD+Q^aEzDvugJ~!#;LzR9`SVbb6Mw<&;$T( C;ZEWJ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b1fac7921a..469eba9ce4 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -637,6 +637,7 @@ public class Blocks implements ContentList{ outputLiquid = new LiquidStack(Liquids.slag, 2f); craftTime = 10f; hasLiquids = hasPower = true; + drawer = new DrawLiquid(); consumes.power(1f); consumes.item(Items.scrap, 1); diff --git a/core/src/mindustry/world/draw/DrawLiquid.java b/core/src/mindustry/world/draw/DrawLiquid.java new file mode 100644 index 0000000000..2ea18ae1b1 --- /dev/null +++ b/core/src/mindustry/world/draw/DrawLiquid.java @@ -0,0 +1,34 @@ +package mindustry.world.draw; + +import arc.*; +import arc.graphics.g2d.*; +import mindustry.graphics.*; +import mindustry.world.*; +import mindustry.world.blocks.production.*; +import mindustry.world.blocks.production.GenericCrafter.*; + +public class DrawLiquid extends DrawBlock{ + public TextureRegion liquid, top; + + public void draw(GenericCrafterBuild entity){ + Draw.rect(entity.block.region, entity.x, entity.y); + + if(entity.liquids.total() > 0.001f){ + Drawf.liquid(liquid, entity.x, entity.y, + entity.liquids.get(((GenericCrafter)entity.block).outputLiquid.liquid) / entity.block.liquidCapacity, + ((GenericCrafter)entity.block).outputLiquid.liquid.color); + } + + if(top.found()) Draw.rect(top, entity.x, entity.y); + } + + @Override + public void load(Block block){ + top = Core.atlas.find(block.name + "-top"); + liquid = Core.atlas.find(block.name + "-liquid"); + } + + public TextureRegion[] icons(Block block){ + return top.found() ? new TextureRegion[]{block.region, top} : new TextureRegion[]{block.region}; + } +} diff --git a/core/src/mindustry/world/draw/DrawRotator.java b/core/src/mindustry/world/draw/DrawRotator.java index 166245fa6c..0b2fbe7151 100644 --- a/core/src/mindustry/world/draw/DrawRotator.java +++ b/core/src/mindustry/world/draw/DrawRotator.java @@ -6,21 +6,23 @@ import mindustry.world.*; import mindustry.world.blocks.production.GenericCrafter.*; public class DrawRotator extends DrawBlock{ - public TextureRegion rotator; + public TextureRegion rotator, top; @Override - public void draw(GenericCrafterBuild build){ - Draw.rect(build.block.region, build.x, build.y); - Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f); + public void draw(GenericCrafterBuild entity){ + Draw.rect(entity.block.region, entity.x, entity.y); + Draw.rect(rotator, entity.x, entity.y, entity.totalProgress * 2f); + if(top.found()) Draw.rect(top, entity.x, entity.y); } @Override public void load(Block block){ rotator = Core.atlas.find(block.name + "-rotator"); + top = Core.atlas.find(block.name + "-top"); } @Override public TextureRegion[] icons(Block block){ - return new TextureRegion[]{block.region, rotator}; + return top.found() ? new TextureRegion[]{block.region, rotator, top} : new TextureRegion[]{block.region, rotator}; } } From c4803d29da76af6bb175e3309ad1cdf51a877c99 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 16:14:53 -0400 Subject: [PATCH 11/16] Pulverizer texture cleanup --- .../blocks/production/pulverizer-rotator.png | Bin 281 -> 216 bytes .../blocks/production/pulverizer-top.png | Bin 296 -> 306 bytes .../sprites/blocks/production/pulverizer.png | Bin 163 -> 114 bytes core/src/mindustry/world/draw/DrawLiquid.java | 18 +++++++++++------- .../src/mindustry/world/draw/DrawRotator.java | 8 ++++---- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core/assets-raw/sprites/blocks/production/pulverizer-rotator.png b/core/assets-raw/sprites/blocks/production/pulverizer-rotator.png index f5522cfd11e5bfa291d4ff43d923bb260af59169..e89e5ed5e74669456c7191abe22445e916da2271 100644 GIT binary patch delta 133 zcmbQqbc1n%;Y3HB>NHOm#}JF&r?i-rym_ z@}lth1nU@O0l`o67)1^+`Y`Z+VB1{6zr~Wh=(psCuPGm<9NOPl6mZ`yR-ZdV`Sh-r qjU|rkD;l&D*q&~`|BPV=_~34 z_i;W>7KRTl341;`J^1L%srdK**5rwG6P+{Et~^s==-ME1{YhFqqu|A$n63oI@3(Ko z#5A2?suEkTD0HCXk!efz4A<$ee_egQw*1@_m+tKfS2$w|wVPtwHb3J3vA2DKb5Bl! zv+|jLs$UMwvT4~`dT(=um;u*8*{e5GZwLog`D=V@lP t%7RDtxz!$cvzko2`hHV=6*~hAbn|xqX4IIu#@YuY;_2$=vd$@?2>_>b9mW6v delta 146 zcmXR~%s4@!o`so#fuS)Z{Wt>y17mTJyA#8@b22X(7#LX69eo`c7&i8E|4C$JU|`@3 z@Ck99F>6U)L4%ifu&eBcS0KRxkH}&M2EIce%qXhi)xf~OpzP`57@~1L`2Yjc3#KLs vCMPcshs2PC7aR*17)ux(OBfv)8E*YG&dKT&D&b*ZU|{fc^>bP0l+XkKh@mLO diff --git a/core/src/mindustry/world/draw/DrawLiquid.java b/core/src/mindustry/world/draw/DrawLiquid.java index 2ea18ae1b1..16cfd14934 100644 --- a/core/src/mindustry/world/draw/DrawLiquid.java +++ b/core/src/mindustry/world/draw/DrawLiquid.java @@ -10,16 +10,19 @@ import mindustry.world.blocks.production.GenericCrafter.*; public class DrawLiquid extends DrawBlock{ public TextureRegion liquid, top; - public void draw(GenericCrafterBuild entity){ - Draw.rect(entity.block.region, entity.x, entity.y); + @Override + public void draw(GenericCrafterBuild build){ + Draw.rect(build.block.region, build.x, build.y); + GenericCrafter type = (GenericCrafter)build.block; - if(entity.liquids.total() > 0.001f){ - Drawf.liquid(liquid, entity.x, entity.y, - entity.liquids.get(((GenericCrafter)entity.block).outputLiquid.liquid) / entity.block.liquidCapacity, - ((GenericCrafter)entity.block).outputLiquid.liquid.color); + if(type.outputLiquid != null && build.liquids.get(type.outputLiquid.liquid) > 0){ + Drawf.liquid(liquid, build.x, build.y, + build.liquids.get(type.outputLiquid.liquid) / type.liquidCapacity, + type.outputLiquid.liquid.color + ); } - if(top.found()) Draw.rect(top, entity.x, entity.y); + if(top.found()) Draw.rect(top, build.x, build.y); } @Override @@ -28,6 +31,7 @@ public class DrawLiquid extends DrawBlock{ liquid = Core.atlas.find(block.name + "-liquid"); } + @Override public TextureRegion[] icons(Block block){ return top.found() ? new TextureRegion[]{block.region, top} : new TextureRegion[]{block.region}; } diff --git a/core/src/mindustry/world/draw/DrawRotator.java b/core/src/mindustry/world/draw/DrawRotator.java index 0b2fbe7151..5d75b77825 100644 --- a/core/src/mindustry/world/draw/DrawRotator.java +++ b/core/src/mindustry/world/draw/DrawRotator.java @@ -9,10 +9,10 @@ public class DrawRotator extends DrawBlock{ public TextureRegion rotator, top; @Override - public void draw(GenericCrafterBuild entity){ - Draw.rect(entity.block.region, entity.x, entity.y); - Draw.rect(rotator, entity.x, entity.y, entity.totalProgress * 2f); - if(top.found()) Draw.rect(top, entity.x, entity.y); + public void draw(GenericCrafterBuild build){ + Draw.rect(build.block.region, build.x, build.y); + Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f); + if(top.found()) Draw.rect(top, build.x, build.y); } @Override From dfd2b22917a0009beacc80c81e3b60e7dea15811 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 10 Jun 2021 18:51:29 -0400 Subject: [PATCH 12/16] Planet method renaming --- core/src/mindustry/graphics/g3d/PlanetRenderer.java | 2 +- core/src/mindustry/type/Planet.java | 3 ++- core/src/mindustry/ui/dialogs/PlanetDialog.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index 3401ba8b3d..37c38e3833 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -149,7 +149,7 @@ public class PlanetRenderer implements Disposable{ public void renderTransparent(Planet planet){ if(!planet.visible()) return; - if(planet.isLandable() && planet == this.planet){ + if(planet.hasGrid() && planet == this.planet){ renderSectors(planet); } diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 60ef7f0d9b..0c52d3a701 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -125,7 +125,8 @@ public class Planet extends UnlockableContent{ sectors.get(index).preset = preset; } - public boolean isLandable(){ + /** @return whether this planet has a sector grid to select. */ + public boolean hasGrid(){ return grid != null && generator != null && sectors.size > 0; } diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 1e671c43b1..f9a838b9e1 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -593,7 +593,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ } } - if(planets.planet.isLandable()){ + if(planets.planet.hasGrid()){ hovered = planets.planet.getSector(planets.cam.getMouseRay(), PlanetRenderer.outlineRad); }else{ hovered = selected = null; From 83854169b7bb4e3e47252dc0db174f85db310f40 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 11 Jun 2021 08:51:34 -0400 Subject: [PATCH 13/16] Fixed #5412 --- android/src/mindustry/android/AndroidRhinoContext.java | 4 ---- core/src/mindustry/core/Platform.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/android/src/mindustry/android/AndroidRhinoContext.java b/android/src/mindustry/android/AndroidRhinoContext.java index 7a45b1b11d..1b845d61cf 100644 --- a/android/src/mindustry/android/AndroidRhinoContext.java +++ b/android/src/mindustry/android/AndroidRhinoContext.java @@ -13,7 +13,6 @@ import com.android.dx.dex.cf.*; import com.android.dx.dex.file.DexFile; import com.android.dx.merge.*; import dalvik.system.*; -import mindustry.*; import mindustry.mod.*; import rhino.*; @@ -67,9 +66,6 @@ public class AndroidRhinoContext{ protected Context makeContext(){ Context ctx = super.makeContext(); ctx.setClassShutter(Scripts::allowClass); - if(Vars.mods != null){ - ctx.setApplicationClassLoader(Vars.mods.mainLoader()); - } return ctx; } diff --git a/core/src/mindustry/core/Platform.java b/core/src/mindustry/core/Platform.java index e953497420..ff139fa14a 100644 --- a/core/src/mindustry/core/Platform.java +++ b/core/src/mindustry/core/Platform.java @@ -7,7 +7,6 @@ import arc.math.*; import arc.struct.*; import arc.util.*; import arc.util.serialization.*; -import mindustry.*; import mindustry.mod.*; import mindustry.net.*; import mindustry.net.Net.*; @@ -85,9 +84,6 @@ public interface Platform{ protected Context makeContext(){ Context ctx = super.makeContext(); ctx.setClassShutter(Scripts::allowClass); - if(Vars.mods != null){ - ctx.setApplicationClassLoader(Vars.mods.mainLoader()); - } return ctx; } }); From 3527acd33e89f48b4e17ceffd6e75209ceb85633 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 11 Jun 2021 09:18:59 -0400 Subject: [PATCH 14/16] Mod class loading bugfix --- core/src/mindustry/mod/ModClassLoader.java | 5 ++++- gradle.properties | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/mod/ModClassLoader.java b/core/src/mindustry/mod/ModClassLoader.java index 89a76e5714..3c7c5b9eba 100644 --- a/core/src/mindustry/mod/ModClassLoader.java +++ b/core/src/mindustry/mod/ModClassLoader.java @@ -13,7 +13,10 @@ public class ModClassLoader extends ClassLoader{ @Override protected Class findClass(String name) throws ClassNotFoundException{ //a child may try to delegate class loading to its parent, which is *this class loader* - do not let that happen - if(inChild) throw new ClassNotFoundException(name); + if(inChild){ + inChild = false; + throw new ClassNotFoundException(name); + } ClassNotFoundException last = null; int size = children.size; diff --git a/gradle.properties b/gradle.properties index daf6453a0a..5e1622bd4c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ kapt.use.worker.api=true kapt.include.compile.classpath=false # I don't need to use the kotlin stdlib yet, so remove it to prevent extra bloat & method count issues kotlin.stdlib.default.dependency=false -archash=dabe9d3e89a9ed1b1c4cb8496a4525dedf29f613 +archash=ea70a34cc621c2c75d0aef5511c7f5aa4ced0d46 From cb0382a15b79b1e4c36e441117499476880824fc Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 11 Jun 2021 10:15:19 -0400 Subject: [PATCH 15/16] Clipping bugfixes --- core/src/mindustry/mod/ModClassLoader.java | 9 +++++---- core/src/mindustry/world/blocks/power/ImpactReactor.java | 2 ++ core/src/mindustry/world/draw/DrawSmelter.java | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/mod/ModClassLoader.java b/core/src/mindustry/mod/ModClassLoader.java index 3c7c5b9eba..bf42f6cc00 100644 --- a/core/src/mindustry/mod/ModClassLoader.java +++ b/core/src/mindustry/mod/ModClassLoader.java @@ -20,17 +20,18 @@ public class ModClassLoader extends ClassLoader{ ClassNotFoundException last = null; int size = children.size; + + inChild = true; //if it doesn't exist in the main class loader, try all the children for(int i = 0; i < size; i++){ try{ - inChild = true; - var out = children.get(i).loadClass(name); - inChild = false; - return out; + return children.get(i).loadClass(name); }catch(ClassNotFoundException e){ last = e; } } + inChild = false; + throw (last == null ? new ClassNotFoundException(name) : last); } } diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index adf46ace7d..d692699100 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -40,6 +40,8 @@ public class ImpactReactor extends PowerGenerator{ hasItems = true; outputsPower = consumesPower = true; flags = EnumSet.of(BlockFlag.reactor, BlockFlag.generator); + lightRadius = 115f; + emitLight = true; } @Override diff --git a/core/src/mindustry/world/draw/DrawSmelter.java b/core/src/mindustry/world/draw/DrawSmelter.java index 5b4880eba9..9402ecbd75 100644 --- a/core/src/mindustry/world/draw/DrawSmelter.java +++ b/core/src/mindustry/world/draw/DrawSmelter.java @@ -25,6 +25,7 @@ public class DrawSmelter extends DrawBlock{ @Override public void load(Block block){ top = Core.atlas.find(block.name + "-top"); + block.clipSize = Math.max(block.clipSize, (lightRadius + lightSinMag) * 2f * block.size); } @Override From c5261cf2e5114a95bc9127f766afd1096dced23d Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 12 Jun 2021 08:44:16 -0400 Subject: [PATCH 16/16] Fixed #5414 --- core/src/mindustry/mod/ModClassLoader.java | 15 ++++++++++----- gradle.properties | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/mod/ModClassLoader.java b/core/src/mindustry/mod/ModClassLoader.java index bf42f6cc00..40d6fd07ef 100644 --- a/core/src/mindustry/mod/ModClassLoader.java +++ b/core/src/mindustry/mod/ModClassLoader.java @@ -4,7 +4,12 @@ import arc.struct.*; public class ModClassLoader extends ClassLoader{ private Seq children = new Seq<>(); - private volatile boolean inChild = false; + private ThreadLocal inChild = new ThreadLocal<>(){ + @Override + protected Boolean initialValue(){ + return Boolean.FALSE; + } + }; public void addChild(ClassLoader child){ children.add(child); @@ -13,15 +18,15 @@ public class ModClassLoader extends ClassLoader{ @Override protected Class findClass(String name) throws ClassNotFoundException{ //a child may try to delegate class loading to its parent, which is *this class loader* - do not let that happen - if(inChild){ - inChild = false; + if(inChild.get()){ + inChild.set(false); throw new ClassNotFoundException(name); } ClassNotFoundException last = null; int size = children.size; - inChild = true; + inChild.set(true); //if it doesn't exist in the main class loader, try all the children for(int i = 0; i < size; i++){ try{ @@ -30,7 +35,7 @@ public class ModClassLoader extends ClassLoader{ last = e; } } - inChild = false; + inChild.set(false); throw (last == null ? new ClassNotFoundException(name) : last); } diff --git a/gradle.properties b/gradle.properties index 5e1622bd4c..34b13c8f1d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ kapt.use.worker.api=true kapt.include.compile.classpath=false # I don't need to use the kotlin stdlib yet, so remove it to prevent extra bloat & method count issues kotlin.stdlib.default.dependency=false -archash=ea70a34cc621c2c75d0aef5511c7f5aa4ced0d46 +archash=3926b785320fea0cd9ca597f6bfa9071263a5464