From 082c17da8542e0d124e63f6d8b2f2c2178012df9 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 28 Jun 2021 09:25:38 -0400 Subject: [PATCH] Fixed #5498 --- android/src/mindustry/android/AndroidLauncher.java | 4 ++-- core/src/mindustry/Vars.java | 2 ++ core/src/mindustry/content/Blocks.java | 6 +++--- core/src/mindustry/content/UnitTypes.java | 8 ++++---- core/src/mindustry/core/Renderer.java | 3 ++- core/src/mindustry/mod/ModClassLoader.java | 4 ++++ core/src/mindustry/mod/Mods.java | 2 +- gradle.properties | 2 +- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/android/src/mindustry/android/AndroidLauncher.java b/android/src/mindustry/android/AndroidLauncher.java index fd0d2cbde7..b3ed4b782d 100644 --- a/android/src/mindustry/android/AndroidLauncher.java +++ b/android/src/mindustry/android/AndroidLauncher.java @@ -84,9 +84,9 @@ public class AndroidLauncher extends AndroidApplication{ try{ //try to load own class first loadedClass = findClass(name); - }catch(ClassNotFoundException e){ + }catch(ClassNotFoundException | NoClassDefFoundError e){ //use parent if not found - loadedClass = super.loadClass(name, resolve); + return parent.loadClass(name); } } diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 65fde466b3..ac5268e59b 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -148,6 +148,8 @@ public class Vars implements Loadable{ public static int maxTextureSize = 2048; /** Whether to show the core landing animation. */ public static boolean showLandAnimation = true; + /** Whether to check for memory use before taking screenshots. */ + public static boolean checkScreenshotMemory = true; /** Whether to prompt the user to confirm exiting. */ public static boolean confirmExit = true; /** if true, UI is not drawn */ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 68287ac837..ac944ebcf4 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -51,7 +51,7 @@ public class Blocks implements ContentList{ melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge, //sandbox - powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadVoid, payloadSource, illuminator, + powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadSource, payloadVoid, illuminator, //defense copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, @@ -2068,12 +2068,12 @@ public class Blocks implements ContentList{ alwaysUnlocked = true; }}; - payloadVoid = new PayloadVoid("payload-void"){{ + payloadSource = new PayloadSource("payload-source"){{ requirements(Category.units, BuildVisibility.sandboxOnly, with()); size = 5; }}; - payloadSource = new PayloadSource("payload-source"){{ + payloadVoid = new PayloadVoid("payload-void"){{ requirements(Category.units, BuildVisibility.sandboxOnly, with()); size = 5; }}; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index b5225e6b85..28fc88d56c 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2113,7 +2113,7 @@ public class UnitTypes implements ContentList{ bullet = new ContinuousLaserBulletType(){{ maxRange = 90f; - damage = 26f; + damage = 27f; length = 95f; hitEffect = Fx.hitMeltHeal; drawSize = 200f; @@ -2144,7 +2144,7 @@ public class UnitTypes implements ContentList{ x = 70f/4f; y = -26f/4f; - reload = 70f; + reload = 65f; shake = 3f; rotateSpeed = 2f; shadow = 30f; @@ -2161,7 +2161,7 @@ public class UnitTypes implements ContentList{ timeIncrease = 3f; timeDuration = 60f * 20f; powerDamageScl = 3f; - damage = 50; + damage = 60; hitColor = lightColor = Pal.heal; lightRadius = 70f; clipSize = 250f; @@ -2177,7 +2177,7 @@ public class UnitTypes implements ContentList{ trailWidth = 6f; trailColor = Pal.heal; trailInterval = 3f; - splashDamage = 60f; + splashDamage = 70f; splashDamageRadius = rad; hitShake = 4f; trailRotation = true; diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 0e7855f3eb..15523f861a 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -11,6 +11,7 @@ import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; import arc.util.async.*; +import mindustry.*; import mindustry.content.*; import mindustry.game.EventType.*; import mindustry.gen.*; @@ -355,7 +356,7 @@ public class Renderer implements ApplicationListener{ int w = world.width() * tilesize, h = world.height() * tilesize; int memory = w * h * 4 / 1024 / 1024; - if(memory >= (mobile ? 65 : 120)){ + if(Vars.checkScreenshotMemory && memory >= (mobile ? 65 : 120)){ ui.showInfo("@screenshot.invalid"); return; } diff --git a/core/src/mindustry/mod/ModClassLoader.java b/core/src/mindustry/mod/ModClassLoader.java index 3124c16fed..d9c05036f9 100644 --- a/core/src/mindustry/mod/ModClassLoader.java +++ b/core/src/mindustry/mod/ModClassLoader.java @@ -11,6 +11,10 @@ public class ModClassLoader extends ClassLoader{ } }; + public ModClassLoader(ClassLoader parent){ + super(parent); + } + public void addChild(ClassLoader child){ children.add(child); } diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 91dabc5482..1380251730 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -39,7 +39,7 @@ public class Mods implements Loadable{ private int totalSprites; private MultiPacker packer; - private ModClassLoader mainLoader = new ModClassLoader(); + private ModClassLoader mainLoader = new ModClassLoader(getClass().getClassLoader()); Seq mods = new Seq<>(); private ObjectMap, ModMeta> metas = new ObjectMap<>(); diff --git a/gradle.properties b/gradle.properties index 2e91ddd907..e07a747c11 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=2767f83cd523aa0f7f71e2c6d34950ad6eba60b0 +archash=1142cfc35b6671c6a2c5566632ff044a46527b82