diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-09-28 13:25:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 11:25:01 +0000 |
commit | 86f1765b171f4cc6f163b8027d1330f4e5094e2d (patch) | |
tree | b6e293bd3c976558fc4e4b7190e4d342c2ddc555 /src/main/java/gtPlusPlus/api | |
parent | 6b1f145f5028f1bc92cf478e5963224e7d94b5cd (diff) | |
download | GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.gz GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.bz2 GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.zip |
Remove more reflection + reorganize mixin accessors packages (#3260)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/api')
3 files changed, 8 insertions, 53 deletions
diff --git a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java deleted file mode 100644 index d70a19925e..0000000000 --- a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java +++ /dev/null @@ -1,41 +0,0 @@ -package gtPlusPlus.api.interfaces; - -import gtPlusPlus.api.objects.Logger; - -public interface IPlugin { - - /** - * @return A {@link String} object which returns the {@link IPlugin}'s name. - */ - public String getPluginName(); - - /** - * @return A {@link String} object which returns the {@link IPlugin}'s short name. This String should only contain 4 - * Characters. - */ - public String getPluginAbbreviation(); - - /** - * @param message - A {@link String} object which holds a message to be logged to console. - */ - default void log(String message) { - Logger.INFO("[" + getPluginAbbreviation() + "] " + message); - } - - /** - * @param message - A {@link String} object which holds a warning/error message to be logged to console. - */ - default void logDebug(String message) { - Logger.WARNING("[" + getPluginAbbreviation() + "] " + message); - } - - public boolean preInit(); - - public boolean init(); - - public boolean postInit(); - - public boolean serverStart(); - - public boolean serverStop(); -} diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java index 2214e50e78..6650668894 100644 --- a/src/main/java/gtPlusPlus/api/objects/Logger.java +++ b/src/main/java/gtPlusPlus/api/objects/Logger.java @@ -23,7 +23,7 @@ public class Logger { private static final boolean enabled = !ASMConfiguration.debug.disableAllLogging; - public static final org.apache.logging.log4j.Logger getLogger() { + public static org.apache.logging.log4j.Logger getLogger() { return modLogger; } @@ -38,8 +38,7 @@ public class Logger { public static void MACHINE_INFO(String s, Object... args) { if (enabled) { if (Configuration.debug.MachineInfo || GTCorePlugin.isDevEnv()) { - final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); - modLogger.info("Machine Info: " + s + " | " + name1, args); + modLogger.info("Machine Info: " + s + " ", args); } } } diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java index 6852c93f05..867f247b6e 100644 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java +++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java @@ -6,7 +6,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; -import gregtech.api.interfaces.IRecipeMutableAccess; +import gregtech.mixin.interfaces.accessors.IRecipeMutableAccess; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -25,14 +25,11 @@ public class ShapedRecipe implements IRecipeMutableAccess { } public ShapedRecipe(Object[] aInputs, ItemStack aOutput) { - String aGridWhole = ""; - String aGrid[] = new String[3]; + StringBuilder aGridWhole = new StringBuilder(); + String[] aGrid = new String[3]; char[] aChar = new char[9]; String[] aLoggingInfo = new String[9]; - - if (mBlackList == null) { - mBlackList = new ItemStack[] {}; - } + mBlackList = new ItemStack[] {}; // Just to be safe try { @@ -68,7 +65,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { Object[] mVarags2 = null; Logger.RECIPE("Generating Shaped Crafting Recipe for " + aOutput.getDisplayName()); - if (aInputs.length < 9 || aInputs.length > 9) { + if (aInputs.length != 9) { Logger.RECIPE( "[Fix] Recipe for " + aOutput.getDisplayName() + " has incorrect number of inputs. Size: " @@ -118,7 +115,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { for (Pair<Character, Object> h : aRecipePairs) { if (h.getKey() != null) { - aGridWhole += String.valueOf(h.getKey()); + aGridWhole.append(String.valueOf(h.getKey())); Logger.RECIPE("Adding '" + String.valueOf(h.getKey()) + "' to aGridWhole."); } } |