aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/minecraft')
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java2
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java2
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java22
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java26
4 files changed, 26 insertions, 26 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java
index a1c2bf6104..9f5d4f36ca 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FoodUtils.java
@@ -13,7 +13,7 @@ public class FoodUtils {
public static final Class IEdibleClass;
static {
- IEdibleClass = ReflectionUtils.getClassByName("squeek.applecore.api.food.IEdible");
+ IEdibleClass = ReflectionUtils.getClass("squeek.applecore.api.food.IEdible");
}
public static boolean isFood(ItemStack food) {
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 45d21a3016..842b8eecb2 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -322,7 +322,7 @@ public class MaterialUtils {
mName = (String) ReflectionUtils.getField(Materials.class, "mName").get(mat);
}
}
- catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
+ catch (IllegalArgumentException | IllegalAccessException e) {
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java
index e7ced98f5a..080b5665a3 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java
@@ -152,7 +152,7 @@ public class MiningUtils {
try {
aTextWorldGen = (String) ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "aTextWorldgen").get(h);
- } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
+ } catch (IllegalArgumentException | IllegalAccessException e) {
aTextWorldGen = h.mWorldGenName;
}
@@ -180,27 +180,27 @@ public class MiningUtils {
boolean aEndAsteroids;
try {
- if (Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null && mMoonID == -99) {
- mMoonID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"), "idDimensionMoon").getInt(null);
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null && mMoonID == -99) {
+ mMoonID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"), "idDimensionMoon").getInt(null);
}
}
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {}
+ catch (IllegalArgumentException | IllegalAccessException e) {}
//Gets Mars ID
try {
- if (Class.forName("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars") != null && mMarsID == -99) {
- mMarsID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars"), "dimensionIDMars").getInt(null);
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars") != null && mMarsID == -99) {
+ mMarsID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars"), "dimensionIDMars").getInt(null);
}
}
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {}
+ catch (IllegalArgumentException | IllegalAccessException e) {}
//Get Comets ID
try {
- if (Class.forName("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids") != null && mCometsID == -99) {
- mCometsID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids"), "dimensionIDAsteroids").getInt(null);
+ if (ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids") != null && mCometsID == -99) {
+ mCometsID = ReflectionUtils.getField(ReflectionUtils.getClass("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids"), "dimensionIDAsteroids").getInt(null);
}
}
- catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {}
+ catch (IllegalArgumentException | IllegalAccessException e) {}
//Clear Cache
Ores_Overworld.clear();
@@ -215,7 +215,7 @@ public class MiningUtils {
try {
aEndAsteroids = ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "mEndAsteroid").getBoolean(x);
}
- catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
+ catch (IllegalArgumentException | IllegalAccessException e) {
aEndAsteroids = false;
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
index dde785cee6..aeeb4ae5be 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
@@ -39,7 +39,7 @@ public class PollutionUtils {
return mPollution.getBoolean(GT_Pollution);
}
}
- } catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {
+ } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
}
return false;
}
@@ -53,16 +53,16 @@ public class PollutionUtils {
if (mAddPollution != null) {
mAddPollution.invoke(null, te, pollutionValue);
}
- Class<?> GT_Pollution = Class.forName("gregtech.common.GT_Pollution");
+ Class<?> GT_Pollution = ReflectionUtils.getClass("gregtech.common.GT_Pollution");
if (GT_Pollution != null) {
- Method addPollution = GT_Pollution.getMethod("addPollution", IGregTechTileEntity.class, int.class);
+ Method addPollution = ReflectionUtils.getMethod(GT_Pollution, "addPollution", IGregTechTileEntity.class, int.class);
if (addPollution != null) {
mAddPollution = addPollution;
addPollution.invoke(null, te, pollutionValue);
return true;
}
}
- } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException
+ } catch (SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
}
return false;
@@ -92,16 +92,16 @@ public class PollutionUtils {
mAddPollution2.invoke(null, aChunk, pollutionValue);
return true;
}
- Class<?> GT_Pollution = Class.forName("gregtech.common.GT_Pollution");
+ Class<?> GT_Pollution = ReflectionUtils.getClass("gregtech.common.GT_Pollution");
if (GT_Pollution != null) {
- Method addPollution = GT_Pollution.getMethod("addPollution", Chunk.class, int.class);
+ Method addPollution = ReflectionUtils.getMethod(GT_Pollution, "addPollution", Chunk.class, int.class);
if (addPollution != null) {
mAddPollution2 = addPollution;
mAddPollution2.invoke(null, aChunk, pollutionValue);
return true;
}
}
- } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException
+ } catch (SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
}
return false;
@@ -128,15 +128,15 @@ public class PollutionUtils {
if (mGetPollution != null) {
mGetPollution.invoke(null, te);
}
- Class<?> GT_Pollution = Class.forName("gregtech.common.GT_Pollution");
+ Class<?> GT_Pollution = ReflectionUtils.getClass("gregtech.common.GT_Pollution");
if (GT_Pollution != null) {
- Method addPollution = GT_Pollution.getMethod("getPollution", IGregTechTileEntity.class);
+ Method addPollution = ReflectionUtils.getMethod(GT_Pollution, "getPollution", IGregTechTileEntity.class);
if (addPollution != null) {
mGetPollution = addPollution;
return (int) addPollution.invoke(null, te);
}
}
- } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException
+ } catch (SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
}
return 0;
@@ -151,15 +151,15 @@ public class PollutionUtils {
if (mGetPollution2 != null) {
mGetPollution2.invoke(null, te);
}
- Class<?> GT_Pollution = Class.forName("gregtech.common.GT_Pollution");
+ Class<?> GT_Pollution = ReflectionUtils.getClass("gregtech.common.GT_Pollution");
if (GT_Pollution != null) {
- Method addPollution = GT_Pollution.getMethod("getPollution", Chunk.class);
+ Method addPollution = ReflectionUtils.getMethod(GT_Pollution, "getPollution", Chunk.class);
if (addPollution != null) {
mGetPollution2 = addPollution;
return (int) addPollution.invoke(null, te);
}
}
- } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException
+ } catch (SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
}
return 0;