From f2232c15b1f1c27d477b10219d77d8df5bb5ae1f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:01:40 -0500 Subject: [PATCH 01/10] Fixed #11404 --- core/src/mindustry/entities/comp/PayloadComp.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index b6812991dd..1db95b9771 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -67,7 +67,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{ } payloads.clear(); } - + public void destroy(){ if(Vars.state.rules.unitPayloadsExplode) payloads.each(Payload::destroyed); } @@ -77,7 +77,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{ } boolean canPickup(Unit unit){ - return type.pickupUnits && payloadUsed() + unit.hitSize * unit.hitSize <= type.payloadCapacity + 0.001f && unit.team == team() && unit.isAI(); + return type.pickupUnits && payloadUsed() + unit.hitSize * unit.hitSize <= type.payloadCapacity + 0.001f && unit.team == team() && unit.isAI() && unit.type.allowedInPayloads; } boolean canPickup(Building build){ From 44428c1f60b7c6b3dd5330de25d4f15e7c9470f0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:03:20 -0500 Subject: [PATCH 02/10] Fixed #11409 --- core/src/mindustry/content/Blocks.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 930675c138..f0f9925f77 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2362,6 +2362,7 @@ public class Blocks{ bridgeConduit = new LiquidBridge("bridge-conduit"){{ requirements(Category.liquid, with(Items.graphite, 4, Items.metaglass, 8)); + floating = true; fadeIn = moveArrows = false; arrowSpacing = 6f; range = 4; @@ -2372,6 +2373,7 @@ public class Blocks{ phaseConduit = new LiquidBridge("phase-conduit"){{ requirements(Category.liquid, with(Items.phaseFabric, 5, Items.silicon, 7, Items.metaglass, 20, Items.titanium, 10)); + floating = true; range = 12; arrowPeriod = 0.9f; arrowTimeScl = 2.75f; From 7130b6155c48fdd4a8af604460bd0b5b8bb81c27 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:04:47 -0500 Subject: [PATCH 03/10] Fixed #11395 --- core/assets/scripts/global.js | 2 ++ core/src/mindustry/mod/ClassMap.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/core/assets/scripts/global.js b/core/assets/scripts/global.js index b5a4c8740f..c1429b664a 100755 --- a/core/assets/scripts/global.js +++ b/core/assets/scripts/global.js @@ -158,6 +158,7 @@ const UnlockEvent = Packages.mindustry.game.EventType.UnlockEvent const StateChangeEvent = Packages.mindustry.game.EventType.StateChangeEvent const CoreChangeEvent = Packages.mindustry.game.EventType.CoreChangeEvent const BuildTeamChangeEvent = Packages.mindustry.game.EventType.BuildTeamChangeEvent +const TileOverlayChangeEvent = Packages.mindustry.game.EventType.TileOverlayChangeEvent const TileFloorChangeEvent = Packages.mindustry.game.EventType.TileFloorChangeEvent const TileChangeEvent = Packages.mindustry.game.EventType.TileChangeEvent const TilePreChangeEvent = Packages.mindustry.game.EventType.TilePreChangeEvent @@ -185,6 +186,7 @@ const LaunchItemEvent = Packages.mindustry.game.EventType.LaunchItemEvent const SectorInvasionEvent = Packages.mindustry.game.EventType.SectorInvasionEvent const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent const SaveLoadEvent = Packages.mindustry.game.EventType.SaveLoadEvent +const ContentPatchLoadEvent = Packages.mindustry.game.EventType.ContentPatchLoadEvent const WorldLoadEndEvent = Packages.mindustry.game.EventType.WorldLoadEndEvent const WorldLoadBeginEvent = Packages.mindustry.game.EventType.WorldLoadBeginEvent const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent diff --git a/core/src/mindustry/mod/ClassMap.java b/core/src/mindustry/mod/ClassMap.java index 648acbf985..11f2694510 100644 --- a/core/src/mindustry/mod/ClassMap.java +++ b/core/src/mindustry/mod/ClassMap.java @@ -20,6 +20,7 @@ public class ClassMap{ classes.put("LogicAI", mindustry.ai.types.LogicAI.class); classes.put("MinerAI", mindustry.ai.types.MinerAI.class); classes.put("MissileAI", mindustry.ai.types.MissileAI.class); + classes.put("PrebuildAI", mindustry.ai.types.PrebuildAI.class); classes.put("RepairAI", mindustry.ai.types.RepairAI.class); classes.put("SuicideAI", mindustry.ai.types.SuicideAI.class); classes.put("Ability", mindustry.entities.abilities.Ability.class); @@ -112,6 +113,7 @@ public class ClassMap{ classes.put("PayloadSeq", mindustry.type.PayloadSeq.class); classes.put("PayloadStack", mindustry.type.PayloadStack.class); classes.put("Planet", mindustry.type.Planet.class); + classes.put("PlanetData", mindustry.type.Planet.PlanetData.class); classes.put("Publishable", mindustry.type.Publishable.class); classes.put("Sector", mindustry.type.Sector.class); classes.put("SectorRect", mindustry.type.Sector.SectorRect.class); @@ -151,6 +153,7 @@ public class ClassMap{ classes.put("ItemSelection", mindustry.world.blocks.ItemSelection.class); classes.put("LaunchAnimator", mindustry.world.blocks.LaunchAnimator.class); classes.put("RotBlock", mindustry.world.blocks.RotBlock.class); + classes.put("TileBitmask", mindustry.world.blocks.TileBitmask.class); classes.put("UnitTetherBlock", mindustry.world.blocks.UnitTetherBlock.class); classes.put("Accelerator", mindustry.world.blocks.campaign.Accelerator.class); classes.put("AcceleratorBuild", mindustry.world.blocks.campaign.Accelerator.AcceleratorBuild.class); @@ -257,7 +260,10 @@ public class ClassMap{ classes.put("StackRouter", mindustry.world.blocks.distribution.StackRouter.class); classes.put("StackRouterBuild", mindustry.world.blocks.distribution.StackRouter.StackRouterBuild.class); classes.put("AirBlock", mindustry.world.blocks.environment.AirBlock.class); + classes.put("CharacterOverlay", mindustry.world.blocks.environment.CharacterOverlay.class); classes.put("Cliff", mindustry.world.blocks.environment.Cliff.class); + classes.put("ColoredFloor", mindustry.world.blocks.environment.ColoredFloor.class); + classes.put("ColoredWall", mindustry.world.blocks.environment.ColoredWall.class); classes.put("EmptyFloor", mindustry.world.blocks.environment.EmptyFloor.class); classes.put("Floor", mindustry.world.blocks.environment.Floor.class); classes.put("UpdateRenderState", mindustry.world.blocks.environment.Floor.UpdateRenderState.class); @@ -266,6 +272,7 @@ public class ClassMap{ classes.put("Prop", mindustry.world.blocks.environment.Prop.class); classes.put("RemoveOre", mindustry.world.blocks.environment.RemoveOre.class); classes.put("RemoveWall", mindustry.world.blocks.environment.RemoveWall.class); + classes.put("RuneOverlay", mindustry.world.blocks.environment.RuneOverlay.class); classes.put("SeaBush", mindustry.world.blocks.environment.SeaBush.class); classes.put("Seaweed", mindustry.world.blocks.environment.Seaweed.class); classes.put("ShallowLiquid", mindustry.world.blocks.environment.ShallowLiquid.class); @@ -315,6 +322,8 @@ public class ClassMap{ classes.put("MessageBuild", mindustry.world.blocks.logic.MessageBlock.MessageBuild.class); classes.put("SwitchBlock", mindustry.world.blocks.logic.SwitchBlock.class); classes.put("SwitchBuild", mindustry.world.blocks.logic.SwitchBlock.SwitchBuild.class); + classes.put("TileableLogicDisplay", mindustry.world.blocks.logic.TileableLogicDisplay.class); + classes.put("TileableLogicDisplayBuild", mindustry.world.blocks.logic.TileableLogicDisplay.TileableLogicDisplayBuild.class); classes.put("BlockProducer", mindustry.world.blocks.payloads.BlockProducer.class); classes.put("BlockProducerBuild", mindustry.world.blocks.payloads.BlockProducer.BlockProducerBuild.class); classes.put("BuildPayload", mindustry.world.blocks.payloads.BuildPayload.class); From 15efb721a07b40d4a2d4b066aefd60f02e92f52c Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:10:13 -0500 Subject: [PATCH 04/10] Fixed #11399 --- core/src/mindustry/entities/Lightning.java | 12 ++++++++---- .../mindustry/world/blocks/defense/ShockMine.java | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/entities/Lightning.java b/core/src/mindustry/entities/Lightning.java index 0bd26d7ceb..48e42b4e5f 100644 --- a/core/src/mindustry/entities/Lightning.java +++ b/core/src/mindustry/entities/Lightning.java @@ -24,21 +24,25 @@ public class Lightning{ private static boolean bhit = false; private static int lastSeed = 0; + /** Create a lighting branch at a location. Use Team.derelict to damage everyone. */ + public static void create(BulletType bulletCreated, Team team, Color color, float damage, float x, float y, float targetAngle, int length){ + createLightningInternal(null, bulletCreated, lastSeed++, team, color, damage, x, y, targetAngle, length); + } + /** Create a lighting branch at a location. Use Team.derelict to damage everyone. */ public static void create(Team team, Color color, float damage, float x, float y, float targetAngle, int length){ - createLightningInternal(null, lastSeed++, team, color, damage, x, y, targetAngle, length); + createLightningInternal(null, Bullets.damageLightning, lastSeed++, team, color, damage, x, y, targetAngle, length); } /** Create a lighting branch at a location. Uses bullet parameters. */ public static void create(Bullet bullet, Color color, float damage, float x, float y, float targetAngle, int length){ - createLightningInternal(bullet, lastSeed++, bullet.team, color, damage, x, y, targetAngle, length); + createLightningInternal(bullet, bullet == null || bullet.type.lightningType == null ? Bullets.damageLightning : bullet.type.lightningType, lastSeed++, bullet.team, color, damage, x, y, targetAngle, length); } - private static void createLightningInternal(@Nullable Bullet hitter, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){ + private static void createLightningInternal(@Nullable Bullet hitter, BulletType hitCreate, int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){ random.setSeed(seed); hit.clear(); - BulletType hitCreate = hitter == null || hitter.type.lightningType == null ? Bullets.damageLightning : hitter.type.lightningType; Seq lines = new Seq<>(); bhit = false; diff --git a/core/src/mindustry/world/blocks/defense/ShockMine.java b/core/src/mindustry/world/blocks/defense/ShockMine.java index 78a2abfd01..3f257acc35 100644 --- a/core/src/mindustry/world/blocks/defense/ShockMine.java +++ b/core/src/mindustry/world/blocks/defense/ShockMine.java @@ -5,6 +5,7 @@ import arc.graphics.g2d.*; import arc.math.*; import arc.util.*; import mindustry.annotations.Annotations.*; +import mindustry.content.*; import mindustry.entities.*; import mindustry.entities.bullet.*; import mindustry.gen.*; @@ -64,7 +65,7 @@ public class ShockMine extends Block{ public void triggered(){ for(int i = 0; i < tendrils; i++){ - Lightning.create(team, lightningColor, damage, x, y, Mathf.random(360f), length); + Lightning.create(Bullets.damageLightningGround, team, lightningColor, damage, x, y, Mathf.random(360f), length); } if(bullet != null){ for(int i = 0; i < shots; i++){ From 3791a7f375c21a7b0418968432290abf49a4be9b Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 11:50:10 -0500 Subject: [PATCH 05/10] Fixed #11403 --- .../mindustry/world/blocks/defense/turrets/Turret.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index d3c0542076..ddbbad72b4 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -581,6 +581,14 @@ public class Turret extends ReloadTurret{ super.handleLiquid(source, liquid, amount); } + @Override + public boolean canConsume(){ + if(heatRequirement > 0 && heatReq <= 0f){ + return false; + } + return super.canConsume(); + } + protected boolean validateTarget(){ return !Units.invalidateTarget(target, canHeal() ? Team.derelict : team, x, y) || isControlled() || logicControlled(); } From da6aecf6955a203a91270bab2b2aa25562cff339 Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:02:15 +0100 Subject: [PATCH 06/10] change pneumatic drill's water usage from 3.6/s to 3.5/s (#11412) --- core/src/mindustry/content/Blocks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index f0f9925f77..5119ba3d6a 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2866,7 +2866,7 @@ public class Blocks{ drillTime = 400; size = 2; - consumeLiquid(Liquids.water, 0.06f).boost(); + consumeLiquid(Liquids.water, 3.5f / 60f).boost(); }}; laserDrill = new Drill("laser-drill"){{ From a0fe9e8415b9d603f21d0b9da8436331f31e2817 Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:04:44 +0100 Subject: [PATCH 07/10] Shootpattern allow replacing per bullet (ammo type support) (#11402) --- core/src/mindustry/entities/bullet/BulletType.java | 3 +++ core/src/mindustry/world/blocks/defense/turrets/Turret.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 22746e9c40..7a834f9385 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -15,6 +15,7 @@ import mindustry.content.*; import mindustry.ctype.*; import mindustry.entities.*; import mindustry.entities.part.*; +import mindustry.entities.pattern.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; @@ -72,6 +73,8 @@ public class BulletType extends Content implements Cloneable{ public Effect despawnEffect = Fx.hitBulletSmall; /** Effect created when shooting. */ public Effect shootEffect = Fx.shootSmall; + /** Pattern used to shoot this bullet. If null, uses turret's default pattern. */ + public @Nullable ShootPattern shootPattern = null; /** Effect created when charging starts; only usable in single-shot weapons with a firstShotDelay / shotDelay. */ public Effect chargeEffect = Fx.none; /** Extra smoke effect created when shooting. */ diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index ddbbad72b4..992f41f2ba 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -705,7 +705,9 @@ public class Turret extends ReloadTurret{ type.chargeEffect.at(bulletX, bulletY, rotation); } - shoot.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> { + ShootPattern pattern = type.shootPattern != null ? type.shootPattern : shoot; + + pattern.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> { queuedBullets++; int barrel = barrelCounter; From 8b9fc34811bf6ef7154860a6addf9efa0a0d3d24 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 12:10:09 -0500 Subject: [PATCH 08/10] Enforce map image import sizes --- core/src/mindustry/editor/MapEditorDialog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index d91ae52da1..49fe8dddaf 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -108,6 +108,10 @@ public class MapEditorDialog extends Dialog implements Disposable{ ui.loadAnd(() -> { try{ Pixmap pixmap = new Pixmap(file); + //if you want to bypass the limit, use mods or the console; larger maps are not supported + if(pixmap.width > MapResizeDialog.maxSize || pixmap.height > MapResizeDialog.maxSize){ + throw new Exception("Image is too large (maximum size is " + MapResizeDialog.maxSize + "x" + MapResizeDialog.maxSize + ")"); + } editor.beginEdit(pixmap); pixmap.dispose(); }catch(Exception e){ From 1dedefd56c29769ee468df73079b7d4d637d1416 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 14:49:16 -0500 Subject: [PATCH 09/10] Log an error and skip shadows instead of crashing when mods set maxSchematicSize too high --- core/src/mindustry/game/Schematics.java | 59 ++++++++++++++----------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/core/src/mindustry/game/Schematics.java b/core/src/mindustry/game/Schematics.java index 2333f83d45..f46c50f00e 100644 --- a/core/src/mindustry/game/Schematics.java +++ b/core/src/mindustry/game/Schematics.java @@ -59,7 +59,7 @@ public class Schematics implements Loadable{ private ObjectSet errored = new ObjectSet<>(); private ObjectMap> loadouts = new ObjectMap<>(); private ObjectMap defaultLoadouts = new ObjectMap<>(); - private FrameBuffer shadowBuffer; + private @Nullable FrameBuffer shadowBuffer; private Texture errorTexture; private long lastClearTime; @@ -99,7 +99,14 @@ public class Schematics implements Loadable{ all.sort(); if(shadowBuffer == null && !headless){ - Core.app.post(() -> shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8)); + Core.app.post(() -> { + try{ + shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8); + }catch(Exception e){ + Log.err(Strings.format("Failed to create shadow buffer (@x@): @. This is likely because a mod is setting maxSchematicSize too high. Don't do that.", + maxSchematicSize + padding + 8, maxSchematicSize + padding + 8, Strings.getSimpleMessage(e))); + } + }); } } @@ -215,35 +222,39 @@ public class Schematics implements Loadable{ Tmp.m2.set(Draw.trans()); FrameBuffer buffer = new FrameBuffer((schematic.width + padding) * resolution, (schematic.height + padding) * resolution); - shadowBuffer.begin(Color.clear); + if(shadowBuffer != null){ + shadowBuffer.begin(Color.clear); - Draw.trans().idt(); - Draw.proj().setOrtho(0, 0, shadowBuffer.getWidth(), shadowBuffer.getHeight()); + Draw.trans().idt(); + Draw.proj().setOrtho(0, 0, shadowBuffer.getWidth(), shadowBuffer.getHeight()); - Draw.color(); - schematic.tiles.each(t -> { - int size = t.block.size; - int offsetx = -(size - 1) / 2; - int offsety = -(size - 1) / 2; - for(int dx = 0; dx < size; dx++){ - for(int dy = 0; dy < size; dy++){ - int wx = t.x + dx + offsetx; - int wy = t.y + dy + offsety; - Fill.square(padding/2f + wx + 0.5f, padding/2f + wy + 0.5f, 0.5f); + Draw.color(); + schematic.tiles.each(t -> { + int size = t.block.size; + int offsetx = -(size - 1) / 2; + int offsety = -(size - 1) / 2; + for(int dx = 0; dx < size; dx++){ + for(int dy = 0; dy < size; dy++){ + int wx = t.x + dx + offsetx; + int wy = t.y + dy + offsety; + Fill.square(padding/2f + wx + 0.5f, padding/2f + wy + 0.5f, 0.5f); + } } - } - }); + }); - shadowBuffer.end(); + shadowBuffer.end(); + } buffer.begin(Color.clear); Draw.proj().setOrtho(0, buffer.getHeight(), buffer.getWidth(), -buffer.getHeight()); - Tmp.tr1.set(shadowBuffer.getTexture(), 0, 0, schematic.width + padding, schematic.height + padding); - Draw.color(0f, 0f, 0f, 1f); - Draw.rect(Tmp.tr1, buffer.getWidth()/2f, buffer.getHeight()/2f, buffer.getWidth(), -buffer.getHeight()); - Draw.color(); + if(shadowBuffer != null){ + Tmp.tr1.set(shadowBuffer.getTexture(), 0, 0, schematic.width + padding, schematic.height + padding); + Draw.color(0f, 0f, 0f, 1f); + Draw.rect(Tmp.tr1, buffer.getWidth()/2f, buffer.getHeight()/2f, buffer.getWidth(), -buffer.getHeight()); + Draw.color(); + } Seq plans = schematic.tiles.map(t -> new BuildPlan(t.x, t.y, t.rotation, t.block, t.config)); @@ -473,10 +484,6 @@ public class Schematics implements Loadable{ if(check && !(st.block instanceof CoreBlock)){ seq.clear(); tile.getLinkedTilesAs(st.block, seq); - //remove env blocks, or not? - //if(seq.contains(t -> !t.block().alwaysReplace && !t.synthetic())){ - // return; - //} for(var t : seq){ if(t.block() != Blocks.air){ t.remove(); From 34be5ffc6c56d47934dafc110b5c5e236e08953f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 30 Nov 2025 15:32:44 -0500 Subject: [PATCH 10/10] Defer shadow buffer init --- core/src/mindustry/game/Schematics.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/mindustry/game/Schematics.java b/core/src/mindustry/game/Schematics.java index f46c50f00e..e851c8229b 100644 --- a/core/src/mindustry/game/Schematics.java +++ b/core/src/mindustry/game/Schematics.java @@ -60,6 +60,7 @@ public class Schematics implements Loadable{ private ObjectMap> loadouts = new ObjectMap<>(); private ObjectMap defaultLoadouts = new ObjectMap<>(); private @Nullable FrameBuffer shadowBuffer; + private boolean triedCreatingShadowBuffer; private Texture errorTexture; private long lastClearTime; @@ -97,17 +98,6 @@ public class Schematics implements Loadable{ }); all.sort(); - - if(shadowBuffer == null && !headless){ - Core.app.post(() -> { - try{ - shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8); - }catch(Exception e){ - Log.err(Strings.format("Failed to create shadow buffer (@x@): @. This is likely because a mod is setting maxSchematicSize too high. Don't do that.", - maxSchematicSize + padding + 8, maxSchematicSize + padding + 8, Strings.getSimpleMessage(e))); - } - }); - } } private void loadLoadouts(){ @@ -222,6 +212,16 @@ public class Schematics implements Loadable{ Tmp.m2.set(Draw.trans()); FrameBuffer buffer = new FrameBuffer((schematic.width + padding) * resolution, (schematic.height + padding) * resolution); + if(shadowBuffer == null && !triedCreatingShadowBuffer){ + triedCreatingShadowBuffer = true; + try{ + shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8); + }catch(Exception e){ + Log.err(Strings.format("Failed to create shadow buffer (@x@): @. This is likely because a mod is setting maxSchematicSize too high. Don't do that.", + maxSchematicSize + padding + 8, maxSchematicSize + padding + 8, Strings.getSimpleMessage(e))); + } + } + if(shadowBuffer != null){ shadowBuffer.begin(Color.clear);