Fix some @SurpressWarnings

This commit is contained in:
glowredman committed 2023-07-13 18:06:19 +02:00
1 parent 1ac3689166
commit fe8d78b3b9
3 files changed
+2 -6

No files matched your search

@@ -26,7 +26,6 @@ public class GuiMenuList extends GuiScreen {
/**
* Adds the buttons (and other controls) to the screen in question.
*/
@SuppressWarnings("unchecked")
@Override
public void initGui() {
for (DummyData data : MainMenuRegistry.menuInfoLst) {
@@ -52,7 +52,7 @@ public class MainMenuRegistry {
index = menuList.size() - 1;
}
DummyConfig.setMainMenu(index);
currentScreen = menuList.get(DummyConfig.getMainMenu()).newInstance();
currentScreen = menuList.get(DummyConfig.getMainMenu()).getConstructor().newInstance();
Minecraft.getMinecraft().displayGuiScreen(currentScreen);
} catch (Exception e) {
e.printStackTrace();
@@ -67,7 +67,7 @@ public class MainMenuRegistry {
return mc.currentScreen;
if (currentScreen != null) return currentScreen;
try {
return menuList.get(DummyConfig.getMainMenu()).newInstance();
return menuList.get(DummyConfig.getMainMenu()).getConstructor().newInstance();
} catch (Exception e) {
e.printStackTrace();
return null;
@@ -347,7 +347,6 @@ public class MiscUtils {
* @param dimId - the ID of the dimension to look the players.
* @param distance - the distance at which the players will get found.
*/
@SuppressWarnings("unchecked")
public static void sendPacketToAllAround(World w, Packet pkt, int x, int y, int z, int dimId, double distance) {
List<EntityPlayer> playerLst = w.getEntitiesWithinAABB(
EntityPlayer.class,
@@ -381,7 +380,6 @@ public class MiscUtils {
* @param w - the worldObj that we are operating in
* @param distance - the distance at which the players will get found.
*/
@SuppressWarnings("unchecked")
public static void sendPacketToAll(World w, Packet pkt) {
List<EntityPlayer> playerLst = w.playerEntities;
if (!playerLst.isEmpty()) {
@@ -406,7 +404,6 @@ public class MiscUtils {
* @param pkt - the packet to send
* @param dimId - the ID of the dimension to look the players.
*/
@SuppressWarnings("unchecked")
public static void sendPacketToAllInDim(World w, Packet pkt, int dimId) {
List<EntityPlayer> playerLst = w.playerEntities;
if (!playerLst.isEmpty()) {