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;
}
@SuppressWarnings("unchecked")
public <T extends GuiBase> T cast()
{
return (T)this;
}
@SuppressWarnings("unchecked")
public <T extends GuiBase> T cast(Class<? extends T> clz)
{
return (T)this;

View File

@ -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

View File

@ -215,6 +215,7 @@ public class TreeComponent<T extends ITreeEntry> extends GuiComponent implements
return node;
}
@SuppressWarnings("unchecked")
public void onTreeChanged()
{
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);
}
@SuppressWarnings("unchecked")
protected void getNodes(T entry, Collection<T> collection, boolean openOnly, int layers)
{
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)
{
if(entry != null)

View File

@ -28,9 +28,9 @@ public class RenderBuffer implements Consumer<GuiComponent>, Iterable<DrawCall>
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)

View File

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

View File

@ -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())))

View File

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

View File

@ -24,10 +24,11 @@ public class UniformArrayBase<T extends Object> 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;

View File

@ -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);