Removing Warnings since it's deprecated code anyways

This commit is contained in:
Speiger 2024-07-20 18:39:08 +02:00
parent 30e63d79a2
commit 91c4d15313
9 changed files with 15 additions and 4 deletions

View File

@ -330,11 +330,13 @@ public abstract class GuiBase
return baseLayer; return baseLayer;
} }
@SuppressWarnings("unchecked")
public <T extends GuiBase> T cast() public <T extends GuiBase> T cast()
{ {
return (T)this; return (T)this;
} }
@SuppressWarnings("unchecked")
public <T extends GuiBase> T cast(Class<? extends T> clz) public <T extends GuiBase> T cast(Class<? extends T> clz)
{ {
return (T)this; return (T)this;

View File

@ -479,7 +479,7 @@ public class GuiScreenBase extends GuiBase
@Override @Override
public boolean isComponentFocused(GuiComponent comp) 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 @Override

View File

@ -215,6 +215,7 @@ public class TreeComponent<T extends ITreeEntry> extends GuiComponent implements
return node; return node;
} }
@SuppressWarnings("unchecked")
public void onTreeChanged() public void onTreeChanged()
{ {
listChange = true; listChange = true;
@ -664,6 +665,7 @@ public class TreeComponent<T extends ITreeEntry> extends GuiComponent implements
return MathUtils.clamp(0, visibleNodes.size(), MathUtils.ceil((getBox().getBaseHeight() - (horizontalBar.getRequiredSpace() / getBox().getScale())) / entryHeight) + 1); return MathUtils.clamp(0, visibleNodes.size(), MathUtils.ceil((getBox().getBaseHeight() - (horizontalBar.getRequiredSpace() / getBox().getScale())) / entryHeight) + 1);
} }
@SuppressWarnings("unchecked")
protected void getNodes(T entry, Collection<T> collection, boolean openOnly, int layers) protected void getNodes(T entry, Collection<T> collection, boolean openOnly, int layers)
{ {
if(entry != null && layers >= 0) if(entry != null && layers >= 0)
@ -680,6 +682,7 @@ public class TreeComponent<T extends ITreeEntry> extends GuiComponent implements
} }
@SuppressWarnings("unchecked")
protected void getNodes(T entry, Collection<T> collection, boolean openOnly) protected void getNodes(T entry, Collection<T> collection, boolean openOnly)
{ {
if(entry != null) if(entry != null)

View File

@ -28,9 +28,9 @@ public class RenderBuffer implements Consumer<GuiComponent>, Iterable<DrawCall>
clear(); clear();
} }
public <T extends DrawCall> T get(int index, Class<T> clz) public DrawCall get(int index)
{ {
return (T)drawCalls.get(index); return drawCalls.get(index);
} }
public void addDrawCall(DrawCall call) public void addDrawCall(DrawCall call)

View File

@ -130,6 +130,7 @@ public class Line
return 0; return 0;
} }
@SuppressWarnings("unchecked")
public Iterable<CharInstance> letterIterator() public Iterable<CharInstance> letterIterator()
{ {
ObjectIterator<CharInstance>[] arrays = new ObjectIterator[words.size()]; ObjectIterator<CharInstance>[] arrays = new ObjectIterator[words.size()];

View File

@ -89,6 +89,7 @@ public class BitmapFontProvider implements IFontProvider
return space * info.tabs; return space * info.tabs;
} }
@SuppressWarnings("unchecked")
public static IFontProvider load(JsonObject object, float desiredSize, AssetManager manager) public static IFontProvider load(JsonObject object, float desiredSize, AssetManager manager)
{ {
FontInfo info = new FontInfo(object.getAsJsonObject("info")); 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); 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) public static IFontProvider create(JsonObject object, float desiredSize, AssetManager manager)
{ {
try(IAsset asset = TextureManager.INSTANCE.getManager().getAsset(AssetLocation.of(object.get("file").getAsString()))) try(IAsset asset = TextureManager.INSTANCE.getManager().getAsset(AssetLocation.of(object.get("file").getAsString())))

View File

@ -19,6 +19,7 @@ public abstract class Uniform
return position; return position;
} }
@SuppressWarnings("unchecked")
public <T extends Uniform> T setOptional() { public <T extends Uniform> T setOptional() {
optional = true; optional = true;
return (T)this; return (T)this;

View File

@ -24,6 +24,7 @@ public class UniformArrayBase<T extends Object> extends Uniform {
return positions[index]; return positions[index];
} }
@SuppressWarnings("unchecked")
protected boolean hasChanged(int index, T value) { protected boolean hasChanged(int index, T value) {
if (!first[index] || !Objects.equals(lastValues[index], value)) { if (!first[index] || !Objects.equals(lastValues[index], value)) {
first[index] = true; first[index] = true;

View File

@ -198,6 +198,7 @@ public class Tesselator implements IVertexBuilder
return data; return data;
} }
@SuppressWarnings("removal")
public DrawCall getDrawCall(int texture) { public DrawCall getDrawCall(int texture) {
float[] data = new float[currentList.totalOffset() * vertexes]; float[] data = new float[currentList.totalOffset() * vertexes];
buffer.get(data); buffer.get(data);