From 8e179552eced009269f0b78bbcdd586646831833 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 17 Aug 2021 21:45:13 -0400 Subject: [PATCH] pointless casts begone --- core/src/mindustry/content/StatusEffects.java | 3 ++- core/src/mindustry/core/Renderer.java | 4 ++-- core/src/mindustry/graphics/Shaders.java | 6 +++--- core/src/mindustry/maps/Maps.java | 2 +- core/src/mindustry/ui/Fonts.java | 6 +++--- core/src/mindustry/ui/dialogs/SchematicsDialog.java | 2 +- gradle.properties | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/core/src/mindustry/content/StatusEffects.java b/core/src/mindustry/content/StatusEffects.java index 8a43965754..710995d4a1 100644 --- a/core/src/mindustry/content/StatusEffects.java +++ b/core/src/mindustry/content/StatusEffects.java @@ -4,6 +4,7 @@ import arc.*; import arc.graphics.*; import arc.math.*; import mindustry.ctype.*; +import mindustry.game.*; import mindustry.game.EventType.*; import mindustry.type.*; import mindustry.graphics.*; @@ -163,7 +164,7 @@ public class StatusEffects implements ContentList{ }}; boss = new StatusEffect("boss"){{ - color = Pal.health; + color = Team.sharded.color; permanent = true; damageMultiplier = 1.3f; healthMultiplier = 1.5f; diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index e7fe48677e..c348bc2fda 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -105,8 +105,8 @@ public class Renderer implements ApplicationListener{ for(int i = 0; i < splashes.length; i++) splashes[i] = atlas.find("splash-" + i); assets.load("sprites/clouds.png", Texture.class).loaded = t -> { - ((Texture)t).setWrap(TextureWrap.repeat); - ((Texture)t).setFilter(TextureFilter.linear); + t.setWrap(TextureWrap.repeat); + t.setFilter(TextureFilter.linear); }; } diff --git a/core/src/mindustry/graphics/Shaders.java b/core/src/mindustry/graphics/Shaders.java index 089e2e5ddb..7ea78a2549 100644 --- a/core/src/mindustry/graphics/Shaders.java +++ b/core/src/mindustry/graphics/Shaders.java @@ -234,7 +234,7 @@ public class Shaders{ super(frag); Core.assets.load("sprites/space.png", Texture.class).loaded = t -> { - texture = (Texture)t; + texture = t; texture.setFilter(TextureFilter.linear); texture.setWrap(TextureWrap.mirroredRepeat); }; @@ -273,8 +273,8 @@ public class Shaders{ public void loadNoise(){ Core.assets.load("sprites/" + textureName() + ".png", Texture.class).loaded = t -> { - ((Texture)t).setFilter(TextureFilter.linear); - ((Texture)t).setWrap(TextureWrap.repeat); + t.setFilter(TextureFilter.linear); + t.setWrap(TextureWrap.repeat); }; } diff --git a/core/src/mindustry/maps/Maps.java b/core/src/mindustry/maps/Maps.java index b6a2f1fc1e..0e0fd5aa01 100644 --- a/core/src/mindustry/maps/Maps.java +++ b/core/src/mindustry/maps/Maps.java @@ -381,7 +381,7 @@ public class Maps{ //try to load preview if(map.previewFile().exists()){ //this may fail, but calls queueNewPreview - Core.assets.load(new AssetDescriptor<>(map.previewFile().path() + "." + mapExtension, Texture.class, new MapPreviewParameter(map))).loaded = t -> map.texture = (Texture)t; + Core.assets.load(new AssetDescriptor<>(map.previewFile().path() + "." + mapExtension, Texture.class, new MapPreviewParameter(map))).loaded = t -> map.texture = t; try{ readCache(map); diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java index 9785619cba..2d5b3c4a4d 100644 --- a/core/src/mindustry/ui/Fonts.java +++ b/core/src/mindustry/ui/Fonts.java @@ -74,19 +74,19 @@ public class Fonts{ largeIcons.clear(); FreeTypeFontParameter param = fontParameter(); - Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.def = (Font)f; + Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.def = f; Core.assets.load("icon", Font.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{ size = 30; incremental = true; characters = "\0"; - }})).loaded = f -> Fonts.icon = (Font)f; + }})).loaded = f -> Fonts.icon = f; Core.assets.load("iconLarge", Font.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{ size = 48; incremental = false; characters = "\0" + Iconc.all; borderWidth = 5f; borderColor = Color.darkGray; - }})).loaded = f -> Fonts.iconLarge = (Font)f; + }})).loaded = f -> Fonts.iconLarge = f; } public static TextureRegion getLargeIcon(String name){ diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index 6662aaae41..3dce3ebf0a 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -41,7 +41,7 @@ public class SchematicsDialog extends BaseDialog{ public SchematicsDialog(){ super("@schematics"); - Core.assets.load("sprites/schematic-background.png", Texture.class).loaded = t -> ((Texture)t).setWrap(TextureWrap.repeat); + Core.assets.load("sprites/schematic-background.png", Texture.class).loaded = t -> t.setWrap(TextureWrap.repeat); tags = Core.settings.getJson("schematic-tags", Seq.class, String.class, Seq::new); diff --git a/gradle.properties b/gradle.properties index 2689175f1f..1b5e22e670 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=f4e8a35c46e28dc68bb2cab17e42ef6db15ae72f +archash=f50ceb463ce4cc7e0b09a7817b12d98c43f00068