From 91c4d153134933e980cdc83a001bd49ed98df722 Mon Sep 17 00:00:00 2001 From: Speiger Date: Sat, 20 Jul 2024 18:39:08 +0200 Subject: [PATCH] Removing Warnings since it's deprecated code anyways --- .../java/speiger/src/coreengine/rendering/guiOld/GuiBase.java | 2 ++ .../src/coreengine/rendering/guiOld/base/GuiScreenBase.java | 2 +- .../coreengine/rendering/guiOld/components/TreeComponent.java | 3 +++ .../rendering/guiOld/renderer/buffer/RenderBuffer.java | 4 ++-- .../src/coreengine/rendering/guiOld/renderer/lexer/Line.java | 1 + .../guiOld/renderer/provider/BitmapFontProvider.java | 2 ++ .../src/coreengine/rendering/shaderOld/uniforms/Uniform.java | 1 + .../rendering/shaderOld/uniforms/UniformArrayBase.java | 3 ++- .../src/coreengine/rendering/tesselationOld/Tesselator.java | 1 + 9 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/GuiBase.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/GuiBase.java index a2c51eb..5aaffed 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/GuiBase.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/GuiBase.java @@ -330,11 +330,13 @@ public abstract class GuiBase return baseLayer; } + @SuppressWarnings("unchecked") public T cast() { return (T)this; } + @SuppressWarnings("unchecked") public T cast(Class clz) { return (T)this; diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/base/GuiScreenBase.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/base/GuiScreenBase.java index 14e893e..ed999f2 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/base/GuiScreenBase.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/base/GuiScreenBase.java @@ -479,7 +479,7 @@ public class GuiScreenBase extends GuiBase @Override public boolean isComponentFocused(GuiComponent comp) { - return hasFocus() && buttonOrder.size() > 0 && ((buttonOrder.size() == 1 && buttonOrder.containsKey(comp)) || buttonOrder.firstKey() == comp); + return hasFocus() && buttonOrder.size() > 0 && ((buttonOrder.size() == 1 && buttonOrder.containsKey((IButtonComponent)comp)) || buttonOrder.firstKey() == comp); } @Override diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/components/TreeComponent.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/components/TreeComponent.java index 96017b2..7fce0f5 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/components/TreeComponent.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/components/TreeComponent.java @@ -215,6 +215,7 @@ public class TreeComponent extends GuiComponent implements return node; } + @SuppressWarnings("unchecked") public void onTreeChanged() { listChange = true; @@ -664,6 +665,7 @@ public class TreeComponent extends GuiComponent implements return MathUtils.clamp(0, visibleNodes.size(), MathUtils.ceil((getBox().getBaseHeight() - (horizontalBar.getRequiredSpace() / getBox().getScale())) / entryHeight) + 1); } + @SuppressWarnings("unchecked") protected void getNodes(T entry, Collection collection, boolean openOnly, int layers) { if(entry != null && layers >= 0) @@ -680,6 +682,7 @@ public class TreeComponent extends GuiComponent implements } + @SuppressWarnings("unchecked") protected void getNodes(T entry, Collection collection, boolean openOnly) { if(entry != null) diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/buffer/RenderBuffer.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/buffer/RenderBuffer.java index 98c7c66..f2c6312 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/buffer/RenderBuffer.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/buffer/RenderBuffer.java @@ -28,9 +28,9 @@ public class RenderBuffer implements Consumer, Iterable clear(); } - public T get(int index, Class clz) + public DrawCall get(int index) { - return (T)drawCalls.get(index); + return drawCalls.get(index); } public void addDrawCall(DrawCall call) diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/lexer/Line.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/lexer/Line.java index 81deb55..19ad009 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/lexer/Line.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/lexer/Line.java @@ -130,6 +130,7 @@ public class Line return 0; } + @SuppressWarnings("unchecked") public Iterable letterIterator() { ObjectIterator[] arrays = new ObjectIterator[words.size()]; diff --git a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/provider/BitmapFontProvider.java b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/provider/BitmapFontProvider.java index 51d9c0b..2735076 100644 --- a/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/provider/BitmapFontProvider.java +++ b/src/main/java/speiger/src/coreengine/rendering/guiOld/renderer/provider/BitmapFontProvider.java @@ -89,6 +89,7 @@ public class BitmapFontProvider implements IFontProvider return space * info.tabs; } + @SuppressWarnings("unchecked") public static IFontProvider load(JsonObject object, float desiredSize, AssetManager manager) { FontInfo info = new FontInfo(object.getAsJsonObject("info")); @@ -104,6 +105,7 @@ public class BitmapFontProvider implements IFontProvider return new BitmapFontProvider(info, ITexture.simple(AssetLocation.of(object.get("file").getAsString())), maps); } + @SuppressWarnings("unchecked") public static IFontProvider create(JsonObject object, float desiredSize, AssetManager manager) { try(IAsset asset = TextureManager.INSTANCE.getManager().getAsset(AssetLocation.of(object.get("file").getAsString()))) diff --git a/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/Uniform.java b/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/Uniform.java index b27d284..4664b80 100644 --- a/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/Uniform.java +++ b/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/Uniform.java @@ -19,6 +19,7 @@ public abstract class Uniform return position; } + @SuppressWarnings("unchecked") public T setOptional() { optional = true; return (T)this; diff --git a/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/UniformArrayBase.java b/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/UniformArrayBase.java index b8e78f5..f613fa9 100644 --- a/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/UniformArrayBase.java +++ b/src/main/java/speiger/src/coreengine/rendering/shaderOld/uniforms/UniformArrayBase.java @@ -24,10 +24,11 @@ public class UniformArrayBase extends Uniform { return positions[index]; } + @SuppressWarnings("unchecked") protected boolean hasChanged(int index, T value) { if (!first[index] || !Objects.equals(lastValues[index], value)) { first[index] = true; - lastValues[index] = setValue((T) lastValues[index], value); + lastValues[index] = setValue((T)lastValues[index], value); return true; } return false; diff --git a/src/main/java/speiger/src/coreengine/rendering/tesselationOld/Tesselator.java b/src/main/java/speiger/src/coreengine/rendering/tesselationOld/Tesselator.java index 0dd5105..047ddfc 100644 --- a/src/main/java/speiger/src/coreengine/rendering/tesselationOld/Tesselator.java +++ b/src/main/java/speiger/src/coreengine/rendering/tesselationOld/Tesselator.java @@ -198,6 +198,7 @@ public class Tesselator implements IVertexBuilder return data; } + @SuppressWarnings("removal") public DrawCall getDrawCall(int texture) { float[] data = new float[currentList.totalOffset() * vertexes]; buffer.get(data);