diff options
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/AssemblyLineServer.java (renamed from src/main/java/gregtech/api/util/GT_Assemblyline_Server.java) | 14 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/AssemblyLineUtils.java (renamed from src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java) | 122 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/BlastFurnaceGasStat.java | 5 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/CircuitryBehavior.java (renamed from src/main/java/gregtech/api/util/GT_CircuitryBehavior.java) | 8 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/ColorsMetadataSection.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java | 12 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/CoverBehavior.java (renamed from src/main/java/gregtech/api/util/GT_CoverBehavior.java) | 14 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/CoverBehaviorBase.java (renamed from src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java) | 50 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/ExoticEnergyInputHelper.java | 103 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/FishPondFakeRecipe.java | 8 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTApiaryModifier.java (renamed from src/main/java/gregtech/api/util/GT_ApiaryModifier.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTApiaryUpgrade.java (renamed from src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java) | 37 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTBaseCrop.java (renamed from src/main/java/gregtech/api/util/GT_BaseCrop.java) | 44 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTBlockMap.java (renamed from src/main/java/gregtech/api/util/GT_BlockMap.java) | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTBlockSet.java (renamed from src/main/java/gregtech/api/util/GT_BlockSet.java) | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTCLSCompat.java (renamed from src/main/java/gregtech/api/util/GT_CLS_Compat.java) | 40 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTChunkAssociatedData.java (renamed from src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java) | 48 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTClientPreference.java (renamed from src/main/java/gregtech/api/util/GT_ClientPreference.java) | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTConfig.java (renamed from src/main/java/gregtech/api/util/GT_Config.java) | 44 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTCreativeTab.java (renamed from src/main/java/gregtech/api/util/GT_CreativeTab.java) | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTFoodStat.java (renamed from src/main/java/gregtech/api/util/GT_FoodStat.java) | 30 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTForestryCompat.java (renamed from src/main/java/gregtech/api/util/GT_Forestry_Compat.java) | 40 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTGCCompat.java (renamed from src/main/java/gregtech/api/util/GT_GC_Compat.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTIBoxableWrapper.java (renamed from src/main/java/gregtech/api/util/GT_IBoxableWrapper.java) | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTItsNotMyFaultException.java (renamed from src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java) | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTLanguageManager.java (renamed from src/main/java/gregtech/api/util/GT_LanguageManager.java) | 14 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTLog.java (renamed from src/main/java/gregtech/api/util/GT_Log.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTModHandler.java (renamed from src/main/java/gregtech/api/util/GT_ModHandler.java) | 290 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTMusicSystem.java (renamed from src/main/java/gregtech/api/util/GT_MusicSystem.java) | 32 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTOreDictUnificator.java (renamed from src/main/java/gregtech/api/util/GT_OreDictUnificator.java) | 150 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTPlayedSound.java (renamed from src/main/java/gregtech/api/util/GT_PlayedSound.java) | 12 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipe.java (renamed from src/main/java/gregtech/api/util/GT_Recipe.java) | 272 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeBuilder.java (renamed from src/main/java/gregtech/api/util/GT_RecipeBuilder.java) | 184 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeConstants.java (renamed from src/main/java/gregtech/api/util/GT_RecipeConstants.java) | 151 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeMapUtil.java (renamed from src/main/java/gregtech/api/util/GT_RecipeMapUtil.java) | 42 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeRegistrator.java (renamed from src/main/java/gregtech/api/util/GT_RecipeRegistrator.java) | 270 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRenderingWorld.java (renamed from src/main/java/gregtech/api/util/GT_RenderingWorld.java) | 10 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTShapedRecipe.java (renamed from src/main/java/gregtech/api/util/GT_Shaped_Recipe.java) | 20 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTShapelessRecipe.java (renamed from src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java) | 20 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTSpawnEventHandler.java (renamed from src/main/java/gregtech/api/util/GT_SpawnEventHandler.java) | 12 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTStreamUtil.java (renamed from src/main/java/gregtech/api/util/GT_StreamUtil.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTStructureUtility.java (renamed from src/main/java/gregtech/api/util/GT_StructureUtility.java) | 104 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTToolHarvestHelper.java (renamed from src/main/java/gregtech/api/util/GT_ToolHarvestHelper.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTTooltipDataCache.java | 104 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTUtil.java (renamed from src/main/java/gregtech/api/util/GT_Util.java) | 43 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTUtility.java (renamed from src/main/java/gregtech/api/util/GT_Utility.java) | 441 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTUtilityClient.java (renamed from src/main/java/gregtech/api/util/GT_UtilityClient.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTWaila.java (renamed from src/main/java/gregtech/api/util/GT_Waila.java) | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java | 114 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_StructureUtilityMuTE.java | 8 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_TooltipDataCache.java | 9 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/HatchElementBuilder.java (renamed from src/main/java/gregtech/api/util/GT_HatchElementBuilder.java) | 93 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/IGTHatchAdder.java (renamed from src/main/java/gregtech/api/util/IGT_HatchAdder.java) | 10 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/JubilanceMegaApiary.java (renamed from src/main/java/gregtech/api/util/GT_JubilanceMegaApiary.java) | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java (renamed from src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java) | 80 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/OutputHatchWrapper.java | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/OverclockCalculator.java (renamed from src/main/java/gregtech/api/util/GT_OverclockCalculator.java) | 60 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/PCBFactoryManager.java (renamed from src/main/java/gregtech/api/util/GT_PCBFactoryManager.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/ParallelHelper.java (renamed from src/main/java/gregtech/api/util/GT_ParallelHelper.java) | 72 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/ProcessingArrayManager.java (renamed from src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java) | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/SemiFluidFuelHandler.java | 10 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/VoidProtectionHelper.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/item/ItemHolder.java | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/recipe/RecipeInputRequirements.java | 8 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/shutdown/ReasonOutOfFluid.java | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/shutdown/ReasonOutOfItem.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/shutdown/ReasonOutOfStuff.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/shutdown/ShutDownReasonRegistry.java | 2 |
68 files changed, 1705 insertions, 1629 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java b/src/main/java/gregtech/api/util/AssemblyLineServer.java index 4c0348683a..49e3882982 100644 --- a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java +++ b/src/main/java/gregtech/api/util/AssemblyLineServer.java @@ -9,11 +9,11 @@ import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsBotania; -public class GT_Assemblyline_Server { +public class AssemblyLineServer { public static LinkedHashMap<String, String> lServerNames = new LinkedHashMap<>(); private static LinkedHashMap<String, String> internal2 = new LinkedHashMap<>(), internal3 = new LinkedHashMap<>(), @@ -21,7 +21,7 @@ public class GT_Assemblyline_Server { private static HashMap<String, Property> internal = new HashMap<>(); public static void fillMap(FMLPreInitializationEvent aEvent) { - Configuration conf = GT_LanguageManager.sEnglishFile; + Configuration conf = GTLanguageManager.sEnglishFile; ConfigCategory cat = conf.getCategory("languagefile"); internal.putAll(cat.getValues()); @@ -56,10 +56,10 @@ public class GT_Assemblyline_Server { entry.getKey() .length() - ".name".length())); i = i % 1000; - if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( + if (GregTechAPI.sGeneratedMaterials[i] != null) lServerNames.put( entry.getKey(), entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + .replace("material", GregTechAPI.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } } catch (Exception ignored) {} @@ -192,10 +192,10 @@ public class GT_Assemblyline_Server { entry.getKey() .length() - ".name".length())); i = i % 1000; - if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( + if (GregTechAPI.sGeneratedMaterials[i] != null) lServerNames.put( entry.getKey(), entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + .replace("material", GregTechAPI.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } else if (entry.getKey() .contains("blockmetal")) { diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/AssemblyLineUtils.java index dbe0ff2c40..22bed1884b 100644 --- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java +++ b/src/main/java/gregtech/api/util/AssemblyLineUtils.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import java.util.ArrayList; import java.util.Arrays; @@ -18,21 +18,21 @@ import net.minecraftforge.common.util.Constants.NBT; import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.common.FMLCommonHandler; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTRecipe.RecipeAssemblyLine; -public class GT_AssemblyLineUtils { +public class AssemblyLineUtils { /** * A cache of Recipes using the Output as Key. */ - private static final HashMap<GT_ItemStack, GT_Recipe_AssemblyLine> sRecipeCacheByOutput = new HashMap<>(); + private static final HashMap<GTItemStack, GTRecipe.RecipeAssemblyLine> sRecipeCacheByOutput = new HashMap<>(); /** * A cache of Recipes using the Recipe Hash String as Key. */ - private static final HashMap<String, GT_Recipe_AssemblyLine> sRecipeCacheByRecipeHash = new HashMap<>(); + private static final HashMap<String, GTRecipe.RecipeAssemblyLine> sRecipeCacheByRecipeHash = new HashMap<>(); /** * Checks the DataStick for deprecated/invalid recipes, updating them as required. @@ -40,14 +40,14 @@ public class GT_AssemblyLineUtils { * @param aDataStick - The DataStick to process * @return Is this DataStick now valid with a current recipe? */ - public static GT_Recipe_AssemblyLine processDataStick(ItemStack aDataStick) { + public static GTRecipe.RecipeAssemblyLine processDataStick(ItemStack aDataStick) { if (!isItemDataStick(aDataStick)) { return null; } if (doesDataStickNeedUpdate(aDataStick)) { ItemStack aStickOutput = getDataStickOutput(aDataStick); if (aStickOutput != null) { - GT_Recipe_AssemblyLine aIntendedRecipe = findAssemblyLineRecipeByOutput(aStickOutput); + GTRecipe.RecipeAssemblyLine aIntendedRecipe = findAssemblyLineRecipeByOutput(aStickOutput); if (aIntendedRecipe != null && setAssemblyLineRecipeOnDataStick(aDataStick, aIntendedRecipe)) return aIntendedRecipe; } @@ -59,9 +59,9 @@ public class GT_AssemblyLineUtils { * Finds an Assembly Line recipe from a DataStick. * * @param aDataStick - The DataStick to check. - * @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any. + * @return The GTRecipe_AssemblyLine recipe contained on the DataStick, if any. */ - public static GT_Recipe_AssemblyLine findAssemblyLineRecipeFromDataStick(ItemStack aDataStick) { + public static RecipeAssemblyLine findAssemblyLineRecipeFromDataStick(ItemStack aDataStick) { return findAssemblyLineRecipeFromDataStick(aDataStick, false).getRecipe(); } @@ -69,9 +69,9 @@ public class GT_AssemblyLineUtils { * Finds an Assembly Line recipe from a DataStick. * * @param aDataStick - The DataStick to check. - * @param aReturnBuiltRecipe - Do we return a GT_Recipe_AssemblyLine built from the data on the Data Stick instead + * @param aReturnBuiltRecipe - Do we return a GTRecipe_AssemblyLine built from the data on the Data Stick instead * of searching the Recipe Map? - * @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any. + * @return The GTRecipe_AssemblyLine recipe contained on the DataStick, if any. */ @Nonnull public static LookupResult findAssemblyLineRecipeFromDataStick(ItemStack aDataStick, boolean aReturnBuiltRecipe) { @@ -90,8 +90,9 @@ public class GT_AssemblyLineUtils { // Get From Cache if (doesDataStickHaveRecipeHash(aDataStick)) { - GT_Recipe_AssemblyLine aRecipeFromCache = sRecipeCacheByRecipeHash.get(getHashFromDataStack(aDataStick)); - if (aRecipeFromCache != null && GT_Utility.areStacksEqual(aOutput, aRecipeFromCache.mOutput)) { + GTRecipe.RecipeAssemblyLine aRecipeFromCache = sRecipeCacheByRecipeHash + .get(getHashFromDataStack(aDataStick)); + if (aRecipeFromCache != null && GTUtility.areStacksEqual(aOutput, aRecipeFromCache.mOutput)) { return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult(aRecipeFromCache); } // else: no cache, or the old recipe run into a hash collision with a different new recipe } @@ -104,45 +105,45 @@ public class GT_AssemblyLineUtils { List<ItemStack> tAltCurrent = new ArrayList<>(); for (int j = 0; j < count; j++) { - ItemStack tLoaded = GT_Utility.loadItem(aTag, "a" + i + ":" + j); + ItemStack tLoaded = GTUtility.loadItem(aTag, "a" + i + ":" + j); if (tLoaded == null) { continue; } tAltCurrent.add(tLoaded); - if (GT_Values.D1) { + if (GTValues.D1) { GT_FML_LOGGER.info("Item Alt " + i + " : " + tLoaded.getUnlocalizedName()); } } mOreDictAlt.add(tAltCurrent); - ItemStack tLoaded = GT_Utility.loadItem(aTag, "" + i); + ItemStack tLoaded = GTUtility.loadItem(aTag, "" + i); if (tLoaded == null) { continue; } aInputs.add(tLoaded); - if (GT_Values.D1) { + if (GTValues.D1) { GT_FML_LOGGER.info("Item " + i + " : " + tLoaded.getUnlocalizedName()); } } - if (GT_Values.D1) { + if (GTValues.D1) { GT_FML_LOGGER.info("All Items done, start fluid check"); } for (int i = 0; i < 4; i++) { if (!aTag.hasKey("f" + i)) continue; - FluidStack tLoaded = GT_Utility.loadFluid(aTag, "f" + i); + FluidStack tLoaded = GTUtility.loadFluid(aTag, "f" + i); if (tLoaded == null) continue; aFluidInputs.add(tLoaded); - if (GT_Values.D1) { + if (GTValues.D1) { GT_FML_LOGGER.info("Fluid " + i + " " + tLoaded.getUnlocalizedName()); } } if (!aTag.hasKey("output") || !aTag.hasKey("time") || aTag.getInteger("time") <= 0 || !aTag.hasKey("eu") - || !GT_Utility.isStackValid(aOutput)) { + || !GTUtility.isStackValid(aOutput)) { return LookupResultType.INVALID_STICK.getResult(); } - if (GT_Values.D1) { + if (GTValues.D1) { GT_FML_LOGGER.info("Found Data Stick recipe"); } @@ -152,7 +153,7 @@ public class GT_AssemblyLineUtils { // Try build a recipe instance if (aReturnBuiltRecipe) { return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult( - new GT_Recipe_AssemblyLine( + new GTRecipe.RecipeAssemblyLine( null, 0, aInputs.toArray(new ItemStack[0]), @@ -162,17 +163,17 @@ public class GT_AssemblyLineUtils { aEU)); } - for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { + for (GTRecipe.RecipeAssemblyLine aRecipe : RecipeAssemblyLine.sAssemblylineRecipes) { if (aRecipe.mEUt != aEU || aRecipe.mDuration != aTime) continue; - if (!GT_Utility.areStacksEqual(aOutput, aRecipe.mOutput, true)) continue; - if (!GT_Utility.areStackListsEqual(Arrays.asList(aRecipe.mInputs), aInputs, false, true)) continue; + if (!GTUtility.areStacksEqual(aOutput, aRecipe.mOutput, true)) continue; + if (!GTUtility.areStackListsEqual(Arrays.asList(aRecipe.mInputs), aInputs, false, true)) continue; if (!Objects.equals(Arrays.asList(aRecipe.mFluidInputs), aFluidInputs)) continue; if (!areStacksEqual(aRecipe.mOreDictAlt, mOreDictAlt)) continue; // Cache it String aRecipeHash = generateRecipeHash(aRecipe); sRecipeCacheByRecipeHash.put(aRecipeHash, aRecipe); - sRecipeCacheByOutput.put(new GT_ItemStack(aRecipe.mOutput), aRecipe); + sRecipeCacheByOutput.put(new GTItemStack(aRecipe.mOutput), aRecipe); if (doesDataStickHaveRecipeHash(aDataStick)) { String aStickHash = getHashFromDataStack(aDataStick); if (aRecipeHash.equals(aStickHash)) @@ -192,31 +193,31 @@ public class GT_AssemblyLineUtils { private static boolean areStacksEqual(ItemStack[] lhs, List<ItemStack> rhs) { return lhs == null ? rhs.isEmpty() - : !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); + : !rhs.isEmpty() && GTUtility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); } /** - * Finds a GT_Recipe_AssemblyLine based on the expected output ItemStack. + * Finds a GTRecipe_AssemblyLine based on the expected output ItemStack. * - * @param aOutput - The Output of a GT_Recipe_AssemblyLine. - * @return First found GT_Recipe_AssemblyLine with matching output. + * @param aOutput - The Output of a GTRecipe_AssemblyLine. + * @return First found GTRecipe_AssemblyLine with matching output. */ - public static GT_Recipe_AssemblyLine findAssemblyLineRecipeByOutput(ItemStack aOutput) { + public static GTRecipe.RecipeAssemblyLine findAssemblyLineRecipeByOutput(ItemStack aOutput) { if (aOutput == null) { return null; } // Check the cache - GT_ItemStack aCacheStack = new GT_ItemStack(aOutput); - GT_Recipe_AssemblyLine aRecipeFromCache = sRecipeCacheByOutput.get(aCacheStack); + GTItemStack aCacheStack = new GTItemStack(aOutput); + RecipeAssemblyLine aRecipeFromCache = sRecipeCacheByOutput.get(aCacheStack); if (aRecipeFromCache != null) { return aRecipeFromCache; } // Iterate all recipes and return the first matching based on Output. - for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { + for (RecipeAssemblyLine aRecipe : GTRecipe.RecipeAssemblyLine.sAssemblylineRecipes) { ItemStack aRecipeOutput = aRecipe.mOutput; - if (GT_Utility.areStacksEqual(aRecipeOutput, aOutput)) { + if (GTUtility.areStacksEqual(aRecipeOutput, aOutput)) { // Cache it to prevent future iterations of all recipes sRecipeCacheByOutput.put(aCacheStack, aRecipe); sRecipeCacheByRecipeHash.put(generateRecipeHash(aRecipe), aRecipe); @@ -230,7 +231,7 @@ public class GT_AssemblyLineUtils { * @param aRecipe - The recipe to generate a Recipe Hash String from. * @return The Recipe Hash String. */ - public static String generateRecipeHash(GT_Recipe_AssemblyLine aRecipe) { + public static String generateRecipeHash(GTRecipe.RecipeAssemblyLine aRecipe) { String aHash = "Invalid.Recipe.Hash"; if (aRecipe != null) { aHash = "Hash." + aRecipe.getPersistentHash(); @@ -242,10 +243,10 @@ public class GT_AssemblyLineUtils { * @param aRecipe - The recipe to add to internal caches * @throws IllegalArgumentException if given recipe collide with any existing recipe in the cache */ - public static void addRecipeToCache(GT_Recipe_AssemblyLine aRecipe) { + public static void addRecipeToCache(RecipeAssemblyLine aRecipe) { if (aRecipe != null) { String aHash = "Hash." + aRecipe.getPersistentHash(); - GT_Recipe_AssemblyLine existing = sRecipeCacheByOutput.put(new GT_ItemStack(aRecipe.mOutput), aRecipe); + GTRecipe.RecipeAssemblyLine existing = sRecipeCacheByOutput.put(new GTItemStack(aRecipe.mOutput), aRecipe); if (existing != null) throw new IllegalArgumentException("Duplicate assline recipe for " + aRecipe.mOutput); existing = sRecipeCacheByRecipeHash.put(aHash, aRecipe); if (existing != null && !existing.equals(aRecipe)) @@ -270,7 +271,7 @@ public class GT_AssemblyLineUtils { * @return Is this ItemStack a Data Stick? */ public static boolean isItemDataStick(ItemStack aStack) { - return GT_Utility.isStackValid(aStack) && ItemList.Tool_DataStick.isStackEqual(aStack, false, true); + return GTUtility.isStackValid(aStack) && ItemList.Tool_DataStick.isStackEqual(aStack, false, true); } /** @@ -292,7 +293,7 @@ public class GT_AssemblyLineUtils { String aStickHash = getHashFromDataStack(aDataStick); if (isValidHash(aStickHash) && doesDataStickHaveOutput(aDataStick)) { ItemStack aStickOutput = getDataStickOutput(aDataStick); - GT_Recipe_AssemblyLine aIntendedRecipe = findAssemblyLineRecipeByOutput(aStickOutput); + GTRecipe.RecipeAssemblyLine aIntendedRecipe = findAssemblyLineRecipeByOutput(aStickOutput); return !aStickHash.equals(generateRecipeHash(aIntendedRecipe)); } } @@ -320,7 +321,7 @@ public class GT_AssemblyLineUtils { */ public static ItemStack getDataStickOutput(ItemStack aDataStick) { if (doesDataStickHaveOutput(aDataStick)) { - return GT_Utility.loadItem(aDataStick.getTagCompound(), "output"); + return GTUtility.loadItem(aDataStick.getTagCompound(), "output"); } return null; } @@ -363,29 +364,30 @@ public class GT_AssemblyLineUtils { /** * * @param aDataStick - The Data Stick to update. - * @param aNewRecipe - The New GT_Recipe_AssemblyLine recipe to update it with. + * @param aNewRecipe - The New GTRecipe_AssemblyLine recipe to update it with. * @return Did we set the new recipe data & Recipe Hash String on the Data Stick? */ - public static boolean setAssemblyLineRecipeOnDataStick(ItemStack aDataStick, GT_Recipe_AssemblyLine aNewRecipe) { + public static boolean setAssemblyLineRecipeOnDataStick(ItemStack aDataStick, + GTRecipe.RecipeAssemblyLine aNewRecipe) { return setAssemblyLineRecipeOnDataStick(aDataStick, aNewRecipe, true); } - public static boolean setAssemblyLineRecipeOnDataStick(ItemStack aDataStick, GT_Recipe_AssemblyLine aNewRecipe, + public static boolean setAssemblyLineRecipeOnDataStick(ItemStack aDataStick, GTRecipe.RecipeAssemblyLine aNewRecipe, boolean setUpdateTime) { if (isItemDataStick(aDataStick) && aNewRecipe.mOutput != null) { String s = aNewRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance() .getEffectiveSide() .isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); + s = AssemblyLineServer.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); if (s == null) { s = aNewRecipe.mOutput.getDisplayName(); } } String aHash = generateRecipeHash(aNewRecipe); - if (GT_Values.D1) { - GT_Recipe_AssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true).recipe; + if (GTValues.D1) { + GTRecipe.RecipeAssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true).recipe; GT_FML_LOGGER.info( "Updating data stick: " + aDataStick.getDisplayName() + " | Old Recipe Hash: " @@ -410,10 +412,10 @@ public class GT_AssemblyLineUtils { // remove possible old NBTTagCompound aDataStick.setTagCompound(new NBTTagCompound()); if (displayName != null) aDataStick.setStackDisplayName(displayName); - if (GT_Values.D1) { - GT_Utility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data (" + aHash + ")"); + if (GTValues.D1) { + GTUtility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data (" + aHash + ")"); } else { - GT_Utility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data"); + GTUtility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data"); } NBTTagCompound tNBT = aDataStick.getTagCompound(); @@ -451,7 +453,7 @@ public class GT_AssemblyLineUtils { if (FMLCommonHandler.instance() .getEffectiveSide() .isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName()); + s = AssemblyLineServer.lServerNames.get(tStack.getDisplayName()); if (s == null) s = tStack.getDisplayName(); } @@ -476,7 +478,7 @@ public class GT_AssemblyLineUtils { if (FMLCommonHandler.instance() .getEffectiveSide() .isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mInputs[i].getDisplayName()); + s = AssemblyLineServer.lServerNames.get(aNewRecipe.mInputs[i].getDisplayName()); if (s == null) s = aNewRecipe.mInputs[i].getDisplayName(); } tNBTList.appendTag( @@ -493,7 +495,7 @@ public class GT_AssemblyLineUtils { if (FMLCommonHandler.instance() .getEffectiveSide() .isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mFluidInputs[i].getLocalizedName()); + s = AssemblyLineServer.lServerNames.get(aNewRecipe.mFluidInputs[i].getLocalizedName()); if (s == null) s = aNewRecipe.mFluidInputs[i].getLocalizedName(); } tNBTList.appendTag( @@ -531,7 +533,7 @@ public class GT_AssemblyLineUtils { return singletonResult; } - public LookupResult getResult(GT_Recipe_AssemblyLine recipe) { + public LookupResult getResult(GTRecipe.RecipeAssemblyLine recipe) { if ((recipe == null) != recipeNull) throw new IllegalArgumentException("This result type does not allow given input"); return new LookupResult(recipe, this); @@ -540,15 +542,15 @@ public class GT_AssemblyLineUtils { public static class LookupResult { - private final GT_Recipe_AssemblyLine recipe; + private final GTRecipe.RecipeAssemblyLine recipe; private final LookupResultType type; - LookupResult(GT_Recipe_AssemblyLine recipe, LookupResultType type) { + LookupResult(GTRecipe.RecipeAssemblyLine recipe, LookupResultType type) { this.recipe = recipe; this.type = type; } - public GT_Recipe_AssemblyLine getRecipe() { + public GTRecipe.RecipeAssemblyLine getRecipe() { return recipe; } diff --git a/src/main/java/gregtech/api/util/BlastFurnaceGasStat.java b/src/main/java/gregtech/api/util/BlastFurnaceGasStat.java index ac1601e846..822e2f036e 100644 --- a/src/main/java/gregtech/api/util/BlastFurnaceGasStat.java +++ b/src/main/java/gregtech/api/util/BlastFurnaceGasStat.java @@ -6,9 +6,8 @@ import java.util.List; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; - +import bartworks.system.material.Werkstoff; +import bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.Materials; public class BlastFurnaceGasStat { diff --git a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java b/src/main/java/gregtech/api/util/CircuitryBehavior.java index 63fb7d1e70..3859be590a 100644 --- a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java +++ b/src/main/java/gregtech/api/util/CircuitryBehavior.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.IRedstoneCircuitBlock; /** @@ -22,13 +22,13 @@ import gregtech.api.interfaces.IRedstoneCircuitBlock; * <p/> * All Functions run usually in a seperate try/catch Block, so that failed Logic won't crash the TileEntity. */ -public abstract class GT_CircuitryBehavior { +public abstract class CircuitryBehavior { /** * @param aIndex 0 - 1023 are my own Indices, so use other Numbers! */ - public GT_CircuitryBehavior(int aIndex) { - GregTech_API.sCircuitryBehaviors.put(aIndex, this); + public CircuitryBehavior(int aIndex) { + GregTechAPI.sCircuitryBehaviors.put(aIndex, this); } /** diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSection.java b/src/main/java/gregtech/api/util/ColorsMetadataSection.java index fb9cc6dd56..7e420f3451 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSection.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSection.java @@ -37,7 +37,7 @@ public class ColorsMetadataSection implements IMetadataSection { try { if (!hex.isEmpty()) colorValue = Integer.parseUnsignedInt(hex, 16); } catch (final NumberFormatException e) { - GT_Log.err.println("Couldn't format color correctly of " + key + " -> " + hex); + GTLog.err.println("Couldn't format color correctly of " + key + " -> " + hex); } intMap.put(key, colorValue); } diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java index 389662d041..8eb91802cb 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java @@ -14,8 +14,8 @@ import com.google.gson.JsonSerializationContext; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; @SideOnly(Side.CLIENT) @@ -24,7 +24,7 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ public ColorsMetadataSection deserialize(JsonElement metadataColors, Type type, JsonDeserializationContext context) { // Default values - boolean enableGuiTint = GregTech_API.sColoredGUI; + boolean enableGuiTint = GregTechAPI.sColoredGUI; Map<String, String> hexGuiTintMap = new HashMap<>(); Map<String, String> hexTextColorMap = new HashMap<>(); @@ -39,7 +39,7 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ entry.getValue() .getAsString()); } else { - GT_Mod.GT_FML_LOGGER.warn("ColorOverride expects primitive value for key `textColor`"); + GTMod.GT_FML_LOGGER.warn("ColorOverride expects primitive value for key `textColor`"); } } } @@ -50,7 +50,7 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ .getJsonObjectBooleanFieldValueOrDefault(guiTints, "enableGuiTintWhenPainted", true); for (Dyes dye : Dyes.values()) { - hexGuiTintMap.put(dye.mName, GT_Util.toHexString(dye.getRGBA())); + hexGuiTintMap.put(dye.mName, GTUtil.toHexString(dye.getRGBA())); } for (String key : hexGuiTintMap.keySet()) { @@ -59,7 +59,7 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ key, JsonUtils.getJsonObjectStringFieldValueOrDefault(guiTints, key, hexGuiTintMap.get(key))); } else { - hexGuiTintMap.replace(key, GT_Util.toHexString(Dyes.dyeWhite.getRGBA())); + hexGuiTintMap.replace(key, GTUtil.toHexString(Dyes.dyeWhite.getRGBA())); } } } diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/CoverBehavior.java index 9394b3957f..7e6f1049e9 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java +++ b/src/main/java/gregtech/api/util/CoverBehavior.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import java.lang.ref.WeakReference; @@ -10,22 +10,22 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; /** * For Covers with a special behavior. Has fixed storage format of 4 byte. Not very convenient... */ -public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializableObject.LegacyCoverData> { +public abstract class CoverBehavior extends CoverBehaviorBase<ISerializableObject.LegacyCoverData> { public boolean mPlayerNotified = false; - public GT_CoverBehavior() { + public CoverBehavior() { this(null); } - public GT_CoverBehavior(ITexture coverTexture) { + public CoverBehavior(ITexture coverTexture) { super(ISerializableObject.LegacyCoverData.class, coverTexture); } @@ -245,7 +245,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { lastPlayer = new WeakReference<>(aPlayer); mPlayerNotified = false; - GT_UIInfos.openCoverUI(aTileEntity, aPlayer, side); + GTUIInfos.openCoverUI(aTileEntity, aPlayer, side); return true; } return false; @@ -397,6 +397,6 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl * @return the ItemStack dropped by this Cover */ public ItemStack getDrop(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return GT_OreDictUnificator.get(true, aTileEntity.getCoverItemAtSide(side)); + return GTOreDictUnificator.get(true, aTileEntity.getCoverItemAtSide(side)); } } diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/CoverBehaviorBase.java index f5bd7a92f4..0c8ef81533 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java +++ b/src/main/java/gregtech/api/util/CoverBehaviorBase.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import java.lang.ref.WeakReference; import java.util.List; @@ -26,12 +26,12 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; -import gregtech.api.GregTech_API; -import gregtech.api.gui.GT_GUIColorOverride; -import gregtech.api.gui.modularui.GT_CoverUIBuildContext; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.GregTechAPI; +import gregtech.api.gui.GUIColorOverride; +import gregtech.api.gui.modularui.CoverUIBuildContext; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.gui.modularui.GUITextureSet; -import gregtech.api.gui.widgets.GT_CoverTickRateButton; +import gregtech.api.gui.widgets.CoverTickRateButton; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.common.covers.CoverInfo; @@ -41,24 +41,24 @@ import gregtech.common.covers.CoverInfo; * * @author glease */ -public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { +public abstract class CoverBehaviorBase<T extends ISerializableObject> { public WeakReference<EntityPlayer> lastPlayer = null; private final Class<T> typeToken; private final ITexture coverFGTexture; - protected GT_CoverBehaviorBase(Class<T> typeToken) { + protected CoverBehaviorBase(Class<T> typeToken) { this(typeToken, null); } - protected GT_CoverBehaviorBase(Class<T> typeToken, ITexture coverTexture) { + protected CoverBehaviorBase(Class<T> typeToken, ITexture coverTexture) { this.typeToken = typeToken; this.coverFGTexture = coverTexture; reloadColorOverride(); } public void reloadColorOverride() { - this.colorOverride = GT_GUIColorOverride.get(guiTexturePath); + this.colorOverride = GUIColorOverride.get(guiTexturePath); } public abstract T createDataObject(int aLegacyData); @@ -122,7 +122,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { /** * Get the special foreground cover texture associated with this cover. Return null if one should use the texture - * passed to {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its + * passed to {@link GregTechAPI#registerCover(ItemStack, ITexture, CoverBehaviorBase)} or its * overloads. */ public final ITexture getSpecialCoverFGTexture(ForgeDirection side, int aCoverID, @@ -132,7 +132,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { /** * Get the special cover texture associated with this cover. Return null if one should use the texture passed to - * {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its overloads. + * {@link GregTechAPI#registerCover(ItemStack, ITexture, CoverBehaviorBase)} or its overloads. */ public final ITexture getSpecialCoverTexture(ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { @@ -409,10 +409,10 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { // region UI stuff protected GT_TooltipDataCache mTooltipCache = new GT_TooltipDataCache(); - protected GT_GUIColorOverride colorOverride; + protected GUIColorOverride colorOverride; private static final String guiTexturePath = "gregtech:textures/gui/GuiCover.png"; - public ModularWindow createWindow(GT_CoverUIBuildContext buildContext) { + public ModularWindow createWindow(CoverUIBuildContext buildContext) { return new UIFactory(buildContext).createWindow(); } @@ -422,9 +422,9 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { */ protected class UIFactory { - private final GT_CoverUIBuildContext uiBuildContext; + private final CoverUIBuildContext uiBuildContext; - public UIFactory(GT_CoverUIBuildContext buildContext) { + public UIFactory(CoverUIBuildContext buildContext) { this.uiBuildContext = buildContext; } @@ -443,10 +443,10 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { final CoverInfo coverInfo = uiBuildContext.getTile() .getCoverInfoAtSide(uiBuildContext.getCoverSide()); - final GT_CoverBehaviorBase<?> behavior = coverInfo.getCoverBehavior(); + final CoverBehaviorBase<?> behavior = coverInfo.getCoverBehavior(); if (coverInfo.getMinimumTickRate() > 0 && behavior.allowsTickRateAddition()) { builder.widget( - new GT_CoverTickRateButton(coverInfo, builder).setPos(getGUIWidth() - 24, getGUIHeight() - 24)); + new CoverTickRateButton(coverInfo, builder).setPos(getGUIWidth() - 24, getGUIHeight() - 24)); } return builder.build(); @@ -463,7 +463,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { */ protected void addUIWidgets(ModularWindow.Builder builder) {} - public GT_CoverUIBuildContext getUIBuildContext() { + public CoverUIBuildContext getUIBuildContext() { return uiBuildContext; } @@ -501,11 +501,11 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { return !getUIBuildContext().getTile() .isDead() && getUIBuildContext().getTile() - .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) != GregTech_API.sNoBehavior; + .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) != GregTechAPI.sNoBehavior; } protected void addTitleToUI(ModularWindow.Builder builder) { - ItemStack coverItem = GT_Utility.intToStack(getUIBuildContext().getCoverID()); + ItemStack coverItem = GTUtility.intToStack(getUIBuildContext().getCoverID()); if (coverItem != null) { builder.widget( new ItemDrawable(coverItem).asWidget() @@ -551,7 +551,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { } protected ItemStack getDisplayStackImpl(int aCoverID, T aCoverVariable) { - return GT_Utility.intToStack(aCoverID); + return GTUtility.intToStack(aCoverID); } protected ITexture getSpecialCoverFGTextureImpl(ForgeDirection side, int aCoverID, T aCoverVariable, @@ -621,7 +621,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { ICoverable aTileEntity, EntityPlayer aPlayer) { if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { lastPlayer = new WeakReference<>(aPlayer); - GT_UIInfos.openCoverUI(aTileEntity, aPlayer, side); + GTUIInfos.openCoverUI(aTileEntity, aPlayer, side); return true; } return false; @@ -771,7 +771,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * @return the ItemStack dropped by this Cover */ protected ItemStack getDropImpl(ForgeDirection side, int aCoverID, T aCoverVariable, ICoverable aTileEntity) { - return GT_OreDictUnificator.get(true, aTileEntity.getCoverItemAtSide(side)); + return GTOreDictUnificator.get(true, aTileEntity.getCoverItemAtSide(side)); } // endregion @@ -810,7 +810,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> { * sets the Cover upon placement. */ public void placeCover(ForgeDirection side, ItemStack aCover, ICoverable aTileEntity) { - aTileEntity.setCoverIDAtSide(side, GT_Utility.stackToInt(aCover)); + aTileEntity.setCoverIDAtSide(side, GTUtility.stackToInt(aCover)); } public boolean allowsCopyPasteTool() { diff --git a/src/main/java/gregtech/api/util/ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/ExoticEnergyInputHelper.java new file mode 100644 index 0000000000..6640f03835 --- /dev/null +++ b/src/main/java/gregtech/api/util/ExoticEnergyInputHelper.java @@ -0,0 +1,103 @@ +package gregtech.api.util; + +import static gregtech.api.util.GTUtility.filterValidMTEs; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatch; +import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti; +import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyTunnel; + +public class ExoticEnergyInputHelper { + + /** + * The Valid Types of TecTech Hatch List. + */ + private static final List<Class<? extends MTEHatch>> sExoticEnergyHatchType = new ArrayList<>(); + + static { + register(MTEHatchEnergyMulti.class); + register(MTEHatchEnergyTunnel.class); + } + + public static void register(Class<? extends MTEHatch> clazz) { + if (!MTEHatch.class.isAssignableFrom(clazz)) + throw new IllegalArgumentException(clazz.getName() + " is not a subclass of " + MTEHatch.class.getName()); + sExoticEnergyHatchType.add(clazz); + } + + public static boolean drainEnergy(long aEU, Collection<? extends MTEHatch> hatches) { + for (MTEHatch tHatch : hatches) { + long tDrain = Math.min( + tHatch.getBaseMetaTileEntity() + .getStoredEU(), + aEU); + tHatch.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(tDrain, false); + aEU -= tDrain; + } + return aEU <= 0; + } + + public static boolean isExoticEnergyInput(IMetaTileEntity aHatch) { + for (Class<?> clazz : sExoticEnergyHatchType) { + if (clazz.isInstance(aHatch)) return true; + } + return false; + } + + public static long getTotalEuMulti(Collection<? extends MTEHatch> hatches) { + long rEU = 0L; + for (MTEHatch tHatch : filterValidMTEs(hatches)) { + rEU += tHatch.getBaseMetaTileEntity() + .getInputVoltage() * tHatch.maxWorkingAmperesIn(); + } + return rEU; + } + + public static long getMaxInputVoltageMulti(Collection<? extends MTEHatch> hatches) { + long rVoltage = 0; + for (MTEHatch tHatch : filterValidMTEs(hatches)) { + rVoltage += tHatch.getBaseMetaTileEntity() + .getInputVoltage(); + } + return rVoltage; + } + + public static long getAverageInputVoltageMulti(Collection<? extends MTEHatch> hatches) { + long rVoltage = 0; + for (MTEHatch tHatch : filterValidMTEs(hatches)) { + rVoltage += tHatch.getBaseMetaTileEntity() + .getInputVoltage(); + } + if (hatches.isEmpty()) { + return 0; + } + return rVoltage / hatches.size(); + } + + public static long getMaxInputAmpsMulti(Collection<? extends MTEHatch> hatches) { + long rAmp = 0; + for (MTEHatch tHatch : filterValidMTEs(hatches)) { + rAmp += tHatch.getBaseMetaTileEntity() + .getInputAmperage(); + } + return rAmp; + } + + public static long getMaxWorkingInputAmpsMulti(Collection<? extends MTEHatch> hatches) { + long rAmp = 0; + for (MTEHatch tHatch : filterValidMTEs(hatches)) { + rAmp += tHatch.maxWorkingAmperesIn(); + } + return rAmp; + } + + public static List<Class<? extends MTEHatch>> getAllClasses() { + return Collections.unmodifiableList(sExoticEnergyHatchType); + } +} diff --git a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java index b5bfff9e29..8f36600e2a 100644 --- a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java +++ b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.fishPondRecipes; import java.util.ArrayList; @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandomFishable; import net.minecraftforge.common.FishingHooks; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -50,8 +50,8 @@ public class FishPondFakeRecipe { ItemStack t = (ItemStack) ReflectionUtils .getField(WeightedRandomFishable.class, "field_150711_b") .get(u); - GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.getIntegratedCircuit(mType)) + GTValues.RA.stdBuilder() + .itemInputs(GTUtility.getIntegratedCircuit(mType)) .itemOutputs(t) .duration(5 * SECONDS) .eut(0) diff --git a/src/main/java/gregtech/api/util/GT_ApiaryModifier.java b/src/main/java/gregtech/api/util/GTApiaryModifier.java index 4a89345670..955b2e60f9 100644 --- a/src/main/java/gregtech/api/util/GT_ApiaryModifier.java +++ b/src/main/java/gregtech/api/util/GTApiaryModifier.java @@ -2,7 +2,7 @@ package gregtech.api.util; import net.minecraft.world.biome.BiomeGenBase; -public class GT_ApiaryModifier { +public class GTApiaryModifier { public float territory = 1f; public float mutation = 1f; diff --git a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java b/src/main/java/gregtech/api/util/GTApiaryUpgrade.java index 9ed7a56e1e..5de373a57e 100644 --- a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java +++ b/src/main/java/gregtech/api/util/GTApiaryUpgrade.java @@ -12,12 +12,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; import gregtech.api.enums.OrePrefixes; -import gregtech.common.items.GT_MetaGenerated_Item_03; +import gregtech.common.items.MetaGeneratedItem03; /** - * Actual items are defined in {@link GT_MetaGenerated_Item_03} + * Actual items are defined in {@link MetaGeneratedItem03} */ -public enum GT_ApiaryUpgrade { +public enum GTApiaryUpgrade { speed1(UNIQUE_INDEX.SPEED_UPGRADE, 32200, 1, (mods, n) -> mods.maxSpeed = 1), speed2(UNIQUE_INDEX.SPEED_UPGRADE, 32201, 1, (mods, n) -> mods.maxSpeed = 2), @@ -146,36 +146,35 @@ public enum GT_ApiaryUpgrade { HEATER_UPGRADE, SIEVE_UPGRADE,; - void apply(Consumer<GT_ApiaryUpgrade> fn) { + void apply(Consumer<GTApiaryUpgrade> fn) { UNIQUE_UPGRADE_LIST.get(this) .forEach(fn); } } - private static final EnumMap<UNIQUE_INDEX, ArrayList<GT_ApiaryUpgrade>> UNIQUE_UPGRADE_LIST = new EnumMap<>( + private static final EnumMap<UNIQUE_INDEX, ArrayList<GTApiaryUpgrade>> UNIQUE_UPGRADE_LIST = new EnumMap<>( UNIQUE_INDEX.class); private int meta = 0; private int maxnumber = 1; - private final GT_Utility.ItemId id; + private final GTUtility.ItemId id; private final UNIQUE_INDEX unique_index; - private final BiConsumer<GT_ApiaryModifier, Integer> applier; + private final BiConsumer<GTApiaryModifier, Integer> applier; - private final HashSet<GT_Utility.ItemId> blacklistedUpgrades = new HashSet<>(); + private final HashSet<GTUtility.ItemId> blacklistedUpgrades = new HashSet<>(); - GT_ApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber, - BiConsumer<GT_ApiaryModifier, Integer> applier) { + GTApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber, BiConsumer<GTApiaryModifier, Integer> applier) { this.unique_index = unique_index; this.meta = meta; this.maxnumber = maxnumber; this.applier = applier; - this.id = GT_Utility.ItemId.createNoCopy(get(1)); + this.id = GTUtility.ItemId.createNoCopy(get(1)); } private void setup_static_variables() { quickLookup.put(this.meta, this); - ArrayList<GT_ApiaryUpgrade> un = UNIQUE_UPGRADE_LIST.get(this.unique_index); + ArrayList<GTApiaryUpgrade> un = UNIQUE_UPGRADE_LIST.get(this.unique_index); if (un != null) un.forEach((u) -> { u.blacklistedUpgrades.add(this.id); this.blacklistedUpgrades.add(u.id); @@ -187,14 +186,14 @@ public enum GT_ApiaryUpgrade { un.add(this); } - public static GT_ApiaryUpgrade getUpgrade(ItemStack s) { + public static GTApiaryUpgrade getUpgrade(ItemStack s) { if (s == null) return null; if (!isUpgrade(s)) return null; return quickLookup.get(s.getItemDamage()); } public boolean isAllowedToWorkWith(ItemStack s) { - GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s); + GTUtility.ItemId id = GTUtility.ItemId.createNoCopy(s); return !blacklistedUpgrades.contains(id); } @@ -202,23 +201,23 @@ public enum GT_ApiaryUpgrade { return maxnumber; } - public void applyModifiers(GT_ApiaryModifier mods, ItemStack stack) { + public void applyModifiers(GTApiaryModifier mods, ItemStack stack) { if (applier != null) applier.accept(mods, stack.stackSize); } public ItemStack get(int count) { - return new ItemStack(GT_MetaGenerated_Item_03.INSTANCE, count, meta); + return new ItemStack(MetaGeneratedItem03.INSTANCE, count, meta); } public static boolean isUpgrade(ItemStack s) { return OrePrefixes.apiaryUpgrade.contains(s); } - private static final HashMap<Integer, GT_ApiaryUpgrade> quickLookup = new HashMap<>(); + private static final HashMap<Integer, GTApiaryUpgrade> quickLookup = new HashMap<>(); static { - EnumSet.allOf(GT_ApiaryUpgrade.class) - .forEach(GT_ApiaryUpgrade::setup_static_variables); + EnumSet.allOf(GTApiaryUpgrade.class) + .forEach(GTApiaryUpgrade::setup_static_variables); speed8upgraded.blacklistedUpgrades.add(production.id); production.blacklistedUpgrades.add(speed8upgraded.id); } diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GTBaseCrop.java index d8608c85a0..2ddf37bbeb 100644 --- a/src/main/java/gregtech/api/util/GT_BaseCrop.java +++ b/src/main/java/gregtech/api/util/GTBaseCrop.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import static gregtech.api.enums.Mods.IC2CropPlugin; import java.lang.reflect.InvocationTargetException; @@ -13,22 +13,22 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; +import gregtech.common.blocks.BlockOresAbstract; +import gregtech.common.blocks.TileEntityOres; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.api.crops.ICropTile; import speiger.src.crops.api.ICropCardInfo; -public class GT_BaseCrop extends CropCard implements ICropCardInfo { +public class GTBaseCrop extends CropCard implements ICropCardInfo { - public static ArrayList<GT_BaseCrop> sCropList = new ArrayList<>(); + public static ArrayList<GTBaseCrop> sCropList = new ArrayList<>(); private String mName = E; private String mDiscoveredBy = "Gregorius Techneticies"; private String[] mAttributes; @@ -56,10 +56,10 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aGrowthSpeed how fast the Crop grows. if < 0 then its set to Tier*300 * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size */ - public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, + public GTBaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, ItemStack[] aSpecialDrops) { - new GT_BaseCrop( + new GTBaseCrop( aID, aCropName, aDiscoveredBy, @@ -94,15 +94,15 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size * @param aBlock the block below needed for crop to grow. If null no block needed */ - public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, + public GTBaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, ItemStack[] aSpecialDrops) { mName = aCropName; - aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); + aID = GTConfig.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); if (aDiscoveredBy != null && !aDiscoveredBy.equals(E)) mDiscoveredBy = aDiscoveredBy; if (aDrop != null && aID > 0 && aID < 256) { - mDrop = GT_Utility.copyOrNull(aDrop); + mDrop = GTUtility.copyOrNull(aDrop); mSpecialDrops = aSpecialDrops; mTier = Math.max(1, aTier); mMaxSize = Math.max(3, aMaxSize); @@ -116,7 +116,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { mAttributes = aAttributes; mBlock = aBlock; if (!Crops.instance.registerCrop(this, aID)) - throw new GT_ItsNotMyFaultException("Make sure the Crop ID is valid!"); + throw new GTItsNotMyFaultException("Make sure the Crop ID is valid!"); if (aBaseSeed != null) Crops.instance.registerBaseSeed(aBaseSeed, this, 1, 1, 1, 1); sCropList.add(this); } @@ -206,9 +206,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { int tDrop = 0; if (mSpecialDrops != null && (tDrop = java.util.concurrent.ThreadLocalRandom.current() .nextInt(0, (mSpecialDrops.length * 2) + 2)) < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { - return GT_Utility.copyOrNull(mSpecialDrops[tDrop]); + return GTUtility.copyOrNull(mSpecialDrops[tDrop]); } - return GT_Utility.copyOrNull(mDrop); + return GTUtility.copyOrNull(mDrop); } @Override @@ -228,7 +228,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @return True if the crop needs a block below it to grow to its max size */ public boolean needsBlockBelow() { - return GT_Mod.gregtechproxy.mCropNeedBlock && this.mBlock != null; + return GTMod.gregtechproxy.mCropNeedBlock && this.mBlock != null; } public boolean isBlockBelow(ICropTile aCrop) { @@ -238,11 +238,11 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { for (int i = 1; i < this.getrootslength(aCrop); i++) { Block tBlock = aCrop.getWorld() .getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); - if ((tBlock instanceof GT_Block_Ores_Abstract)) { + if ((tBlock instanceof BlockOresAbstract)) { TileEntity tTileEntity = aCrop.getWorld() .getTileEntity(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData + if ((tTileEntity instanceof TileEntityOres)) { + Materials tMaterial = GregTechAPI.sGeneratedMaterials[(((TileEntityOres) tTileEntity).mMetaData % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { return tMaterial == mBlock; @@ -270,7 +270,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (!this.needsBlockBelow()) return true; // get material from stack - ItemData tAssociation = GT_OreDictUnificator.getAssociation(aItem); + ItemData tAssociation = GTOreDictUnificator.getAssociation(aItem); if (tAssociation == null) return false; // return true if it's an ore of the material @@ -304,8 +304,8 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { @Override public ItemStack getDisplayItem() { if (mSpecialDrops != null && mSpecialDrops[mSpecialDrops.length - 1] != null) { - return GT_Utility.copyOrNull(mSpecialDrops[mSpecialDrops.length - 1]); + return GTUtility.copyOrNull(mSpecialDrops[mSpecialDrops.length - 1]); } - return GT_Utility.copyOrNull(mDrop); + return GTUtility.copyOrNull(mDrop); } } diff --git a/src/main/java/gregtech/api/util/GT_BlockMap.java b/src/main/java/gregtech/api/util/GTBlockMap.java index 9ffe273cac..a5ac98d427 100644 --- a/src/main/java/gregtech/api/util/GT_BlockMap.java +++ b/src/main/java/gregtech/api/util/GTBlockMap.java @@ -8,7 +8,7 @@ import net.minecraft.block.Block; import gnu.trove.map.TByteObjectMap; import gnu.trove.map.hash.TByteObjectHashMap; -public class GT_BlockMap<V> { +public class GTBlockMap<V> { public static final byte WILDCARD = -1; private final ConcurrentHashMap<Block, TByteObjectMap<V>> backing = new ConcurrentHashMap<>(); @@ -122,7 +122,7 @@ public class GT_BlockMap<V> { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - GT_BlockMap<?> that = (GT_BlockMap<?>) o; + GTBlockMap<?> that = (GTBlockMap<?>) o; return backing.equals(that.backing); } diff --git a/src/main/java/gregtech/api/util/GT_BlockSet.java b/src/main/java/gregtech/api/util/GTBlockSet.java index 1d13afd056..6c91193832 100644 --- a/src/main/java/gregtech/api/util/GT_BlockSet.java +++ b/src/main/java/gregtech/api/util/GTBlockSet.java @@ -2,9 +2,9 @@ package gregtech.api.util; import net.minecraft.block.Block; -public class GT_BlockSet { +public class GTBlockSet { - private final GT_BlockMap<Object> backing = new GT_BlockMap<>(); + private final GTBlockMap<Object> backing = new GTBlockMap<>(); public boolean add(Block block, byte meta) { return backing.put(block, meta, this) != this; @@ -27,7 +27,7 @@ public class GT_BlockSet { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - GT_BlockSet that = (GT_BlockSet) o; + GTBlockSet that = (GTBlockSet) o; return backing.equals(that.backing); } diff --git a/src/main/java/gregtech/api/util/GT_CLS_Compat.java b/src/main/java/gregtech/api/util/GTCLSCompat.java index c560435e30..823a7b850e 100644 --- a/src/main/java/gregtech/api/util/GT_CLS_Compat.java +++ b/src/main/java/gregtech/api/util/GTCLSCompat.java @@ -10,13 +10,13 @@ import java.util.function.Consumer; import java.util.function.Function; import cpw.mods.fml.common.ProgressManager; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.Materials; -import gregtech.common.GT_Proxy; -import gregtech.loaders.postload.GT_PostLoad; +import gregtech.common.GTProxy; +import gregtech.loaders.postload.GTPostLoad; @SuppressWarnings("rawtypes, unchecked, deprecation") -public class GT_CLS_Compat { +public class GTCLSCompat { private static Class alexiilMinecraftDisplayer; private static Class alexiilProgressDisplayer; @@ -35,13 +35,13 @@ public class GT_CLS_Compat { alexiilMinecraftDisplayer = Class.forName("alexiil.mods.load.MinecraftDisplayer"); alexiilProgressDisplayer = Class.forName("alexiil.mods.load.ProgressDisplayer"); } catch (ClassNotFoundException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); + GTMod.GT_FML_LOGGER.catching(ex); } try { cpwProgressBar = Class.forName("cpw.mods.fml.common.ProgressManager$ProgressBar"); } catch (ClassNotFoundException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); + GTMod.GT_FML_LOGGER.catching(ex); } Optional.ofNullable(alexiilMinecraftDisplayer) @@ -51,7 +51,7 @@ public class GT_CLS_Compat { isReplacingVanillaMaterials = e.getField("isReplacingVanillaMaterials"); isRegisteringGTmaterials = e.getField("isRegisteringGTmaterials"); } catch (NoSuchMethodException | NoSuchFieldException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); + GTMod.GT_FML_LOGGER.catching(ex); } }); @@ -60,7 +60,7 @@ public class GT_CLS_Compat { try { displayProgress = e.getMethod("displayProgress", String.class, float.class); } catch (NoSuchMethodException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); + GTMod.GT_FML_LOGGER.catching(ex); } }); @@ -68,11 +68,11 @@ public class GT_CLS_Compat { progressBarStep = cpwProgressBar.getDeclaredField("step"); progressBarStep.setAccessible(true); } catch (NoSuchFieldException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); + GTMod.GT_FML_LOGGER.catching(ex); } } - private GT_CLS_Compat() {} + private GTCLSCompat() {} private static <T> void registerAndReportProgression(String materialsType, Collection<T> materials, ProgressManager.ProgressBar progressBar, Function<T, Object> getName, Consumer<T> action) { @@ -93,44 +93,44 @@ public class GT_CLS_Compat { try { displayProgress.invoke(null, materialName, (float) currentStep / sizeStep); } catch (IllegalAccessException | InvocationTargetException iae) { - GT_Mod.GT_FML_LOGGER.error("While updating progression", iae); + GTMod.GT_FML_LOGGER.error("While updating progression", iae); } try { progressBarStep.set(progressBar, currentStep); } catch (IllegalAccessException iae) { - GT_Mod.GT_FML_LOGGER.error("While updating intermediate progression steps number", iae); + GTMod.GT_FML_LOGGER.error("While updating intermediate progression steps number", iae); } progressBar.step(materialName); } if (nextBakingMsgAt < now) { nextBakingMsgAt = now + bakingMsgEvery; - GT_Mod.GT_FML_LOGGER + GTMod.GT_FML_LOGGER .info(String.format("%s - Baking: %d%%", materialsType, currentStep * 100 / sizeStep)); } action.accept(m); currentStep += 1; } - GT_Mod.GT_FML_LOGGER.info(String.format("%s - Baking: Done", materialsType)); + GTMod.GT_FML_LOGGER.info(String.format("%s - Baking: Done", materialsType)); try { progressBarStep.set(progressBar, currentStep); } catch (IllegalAccessException iae) { - GT_Mod.GT_FML_LOGGER.error("While updating final progression steps number", iae); + GTMod.GT_FML_LOGGER.error("While updating final progression steps number", iae); } } - public static void stepMaterialsCLS(Collection<GT_Proxy.OreDictEventContainer> mEvents, + public static void stepMaterialsCLS(Collection<GTProxy.OreDictEventContainer> mEvents, ProgressManager.ProgressBar progressBar) throws IllegalAccessException { try { isRegisteringGTmaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { - GT_Mod.GT_FML_LOGGER.catching(e); + GTMod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( "GregTech materials", mEvents, progressBar, m -> m.mMaterial, - GT_Proxy::registerRecipes); + GTProxy::registerRecipes); ProgressManager.pop(progressBar); isRegisteringGTmaterials.set(null, false); } @@ -140,14 +140,14 @@ public class GT_CLS_Compat { try { isReplacingVanillaMaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { - GT_Mod.GT_FML_LOGGER.catching(e); + GTMod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( "Vanilla materials", replacedVanillaItemsSet, progressBar, m -> m.mDefaultLocalName, - GT_PostLoad::doActualRegistration); + GTPostLoad::doActualRegistration); } public static void pushToDisplayProgress() throws InvocationTargetException, IllegalAccessException { diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GTChunkAssociatedData.java index bb73cf77ed..7a81c715cb 100644 --- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java +++ b/src/main/java/gregtech/api/util/GTChunkAssociatedData.java @@ -41,7 +41,7 @@ import net.minecraftforge.event.world.WorldEvent; import org.apache.commons.io.FileUtils; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; /** @@ -63,9 +63,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; * @author glease */ @ParametersAreNonnullByDefault -public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.IData> { +public abstract class GTChunkAssociatedData<T extends GTChunkAssociatedData.IData> { - private static final Map<String, GT_ChunkAssociatedData<?>> instances = new ConcurrentHashMap<>(); + private static final Map<String, GTChunkAssociatedData<?>> instances = new ConcurrentHashMap<>(); private static final int IO_PARALLELISM = Math.min( 8, Math.max( @@ -102,7 +102,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID * @param version An integer marking the version of this data. Useful later when the data's serialized form * changed. */ - protected GT_ChunkAssociatedData(String aId, Class<T> elementType, int regionLength, byte version, + protected GTChunkAssociatedData(String aId, Class<T> elementType, int regionLength, byte version, boolean saveDefaults) { if (regionLength * regionLength > Short.MAX_VALUE || regionLength <= 0) throw new IllegalArgumentException("Region invalid: " + regionLength); @@ -159,7 +159,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID } public void clear() { - if (GT_Values.debugWorldData) { + if (GTValues.debugWorldData) { long dirtyRegionCount = masterMap.values() .stream() .flatMap( @@ -167,7 +167,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID .stream()) .filter(SuperRegion::isDirty) .count(); - if (dirtyRegionCount > 0) GT_Log.out.println( + if (dirtyRegionCount > 0) GTLog.out.println( "Clearing ChunkAssociatedData with " + dirtyRegionCount + " regions dirty. Data might have been lost!"); } masterMap.clear(); @@ -198,8 +198,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID try { f.get(); } catch (Exception e) { - GT_Log.err.println("Data save error: " + mId); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Data save error: " + mId); + e.printStackTrace(GTLog.err); } }); } @@ -216,14 +216,14 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID * Clear all mappings, regardless of whether they are dirty */ public static void clearAll() { - for (GT_ChunkAssociatedData<?> d : instances.values()) d.clear(); + for (GTChunkAssociatedData<?> d : instances.values()) d.clear(); } /** * Save all mappings */ public static void saveAll() { - for (GT_ChunkAssociatedData<?> d : instances.values()) d.save(); + for (GTChunkAssociatedData<?> d : instances.values()) d.save(); } /** @@ -233,7 +233,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID * Be aware of the memory consumption though. */ protected void loadAll(World w) { - if (GT_Values.debugWorldData && masterMap.containsKey(w.provider.dimensionId)) GT_Log.err.println( + if (GTValues.debugWorldData && masterMap.containsKey(w.provider.dimensionId)) GTLog.err.println( "Reloading ChunkAssociatedData " + mId + " for world " + w.provider.dimensionId + " discards old data!"); if (!getSaveDirectory(w).isDirectory()) // nothing to load... @@ -255,8 +255,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID try { return f.get(); } catch (Exception e) { - GT_Log.err.println("Error loading region"); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Error loading region"); + e.printStackTrace(GTLog.err); return null; } }) @@ -264,8 +264,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID .collect(Collectors.toMap(SuperRegion::getCoord, Function.identity())); masterMap.put(w.provider.dimensionId, worldData); } catch (IOException | UncheckedIOException e) { - GT_Log.err.println("Error loading all region"); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Error loading all region"); + e.printStackTrace(GTLog.err); } } @@ -369,8 +369,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID try { save0(); } catch (IOException e) { - GT_Log.err.println("Error saving data " + backingStorage.getPath()); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Error saving data " + backingStorage.getPath()); + e.printStackTrace(GTLog.err); } } @@ -422,14 +422,14 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID try { loadFromFile(backingStorage); } catch (IOException | RuntimeException e) { - GT_Log.err.println("Primary storage file broken in " + backingStorage.getPath()); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Primary storage file broken in " + backingStorage.getPath()); + e.printStackTrace(GTLog.err); // in case the primary storage is broken try { loadFromFile(getTmpFile()); } catch (IOException | RuntimeException e2) { - GT_Log.err.println("Backup storage file broken in " + backingStorage.getPath()); - e2.printStackTrace(GT_Log.err); + GTLog.err.println("Backup storage file broken in " + backingStorage.getPath()); + e2.printStackTrace(GTLog.err); } } } @@ -441,7 +441,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID if (b == 0) { loadV0(input, world); } else { - GT_Log.err.printf("Unknown ChunkAssociatedData version %d\n", b); + GTLog.err.printf("Unknown ChunkAssociatedData version %d\n", b); } } } @@ -477,14 +477,14 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID @SubscribeEvent public void onWorldSave(WorldEvent.Save e) { - for (GT_ChunkAssociatedData<?> d : instances.values()) { + for (GTChunkAssociatedData<?> d : instances.values()) { d.save(e.world); } } @SubscribeEvent public void onWorldUnload(WorldEvent.Unload e) { - for (GT_ChunkAssociatedData<?> d : instances.values()) { + for (GTChunkAssociatedData<?> d : instances.values()) { // there is no need to explicitly do a save here // forge will send a WorldEvent.Save on server thread before this event is distributed d.masterMap.remove(e.world.provider.dimensionId); diff --git a/src/main/java/gregtech/api/util/GT_ClientPreference.java b/src/main/java/gregtech/api/util/GTClientPreference.java index 3ea2730a0c..f265094ca3 100644 --- a/src/main/java/gregtech/api/util/GT_ClientPreference.java +++ b/src/main/java/gregtech/api/util/GTClientPreference.java @@ -3,14 +3,14 @@ package gregtech.api.util; import gregtech.common.config.client.ConfigPreference; import gregtech.common.config.client.ConfigWaila; -public class GT_ClientPreference { +public class GTClientPreference { private final boolean mSingleBlockInitialFilter; private final boolean mSingleBlockInitialMultiStack; private final boolean mInputBusInitialFilter; private final boolean wailaAverageNS; - public GT_ClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack, + public GTClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack, boolean mInputBusInitialFilter, boolean wailaAverageNS) { this.mSingleBlockInitialFilter = mSingleBlockInitialFilter; this.mSingleBlockInitialMultiStack = mSingleBlockInitialMultiStack; @@ -18,7 +18,7 @@ public class GT_ClientPreference { this.wailaAverageNS = wailaAverageNS; } - public GT_ClientPreference() { + public GTClientPreference() { this.mSingleBlockInitialFilter = ConfigPreference.singleBlockInitialFilter; this.mSingleBlockInitialMultiStack = ConfigPreference.singleBlockInitialAllowMultiStack; this.mInputBusInitialFilter = ConfigPreference.inputBusInitialFilter; diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GTConfig.java index e1157febb4..68ff810414 100644 --- a/src/main/java/gregtech/api/util/GT_Config.java +++ b/src/main/java/gregtech/api/util/GTConfig.java @@ -1,15 +1,15 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; -public class GT_Config implements Runnable { +public class GTConfig implements Runnable { public static boolean troll = false; @@ -18,22 +18,22 @@ public class GT_Config implements Runnable { public static Configuration undergroundFluidsFile; public final Configuration mConfig; - public GT_Config(Configuration aConfig) { + public GTConfig(Configuration aConfig) { mConfig = aConfig; mConfig.load(); mConfig.save(); - GregTech_API.sAfterGTPreload.add(this); // in case of crash on startup - GregTech_API.sAfterGTLoad.add(this); // in case of crash on startup - GregTech_API.sAfterGTPostload.add(this); - if (GT_Values.lateConfigSave) GregTech_API.sFirstWorldTick.add(this); + GregTechAPI.sAfterGTPreload.add(this); // in case of crash on startup + GregTechAPI.sAfterGTLoad.add(this); // in case of crash on startup + GregTechAPI.sAfterGTPostload.add(this); + if (GTValues.lateConfigSave) GregTechAPI.sFirstWorldTick.add(this); } private static boolean shouldSave() { - return GT_Values.lateConfigSave ? GT_Values.worldTickHappened : GregTech_API.sPostloadFinished; + return GTValues.lateConfigSave ? GTValues.worldTickHappened : GregTechAPI.sPostloadFinished; } public static int addIDConfig(Object aCategory, String aName, int aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = sConfigFileIDs.get( aCategory.toString() .replaceAll("\\|", "."), @@ -45,11 +45,11 @@ public class GT_Config implements Runnable { } public static String getStackConfigName(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return E; - Object rName = GT_OreDictUnificator.getAssociation(aStack); + if (GTUtility.isStackInvalid(aStack)) return E; + Object rName = GTOreDictUnificator.getAssociation(aStack); if (rName != null) return rName.toString(); try { - if (GT_Utility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString(); + if (GTUtility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString(); } catch (Throwable e) { /* Do nothing */ } @@ -66,7 +66,7 @@ public class GT_Config implements Runnable { } public boolean get(Object aCategory, String aName, boolean aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), @@ -82,7 +82,7 @@ public class GT_Config implements Runnable { } public int get(Object aCategory, String aName, int aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), @@ -98,7 +98,7 @@ public class GT_Config implements Runnable { } public double get(Object aCategory, String aName, double aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), @@ -114,7 +114,7 @@ public class GT_Config implements Runnable { } public String get(Object aCategory, String aName, String aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), @@ -130,19 +130,19 @@ public class GT_Config implements Runnable { } public String[] get(Object aCategory, String aName, String... aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), aName.replaceAll("\\|", "_"), aDefault); String[] rResult = tProperty.getStringList(); - if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); + if (!tProperty.wasRead() && GregTechAPI.sPostloadFinished) mConfig.save(); return rResult; } public String getWithValidValues(Object aCategory, String aName, String[] validValues, String aDefault) { - if (GT_Utility.isStringInvalid(aName)) return aDefault; + if (GTUtility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( aCategory.toString() .replaceAll("\\|", "_"), @@ -151,7 +151,7 @@ public class GT_Config implements Runnable { null, validValues); String rResult = tProperty.getString(); - if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); + if (!tProperty.wasRead() && GregTechAPI.sPostloadFinished) mConfig.save(); return rResult; } diff --git a/src/main/java/gregtech/api/util/GT_CreativeTab.java b/src/main/java/gregtech/api/util/GTCreativeTab.java index 1049f40278..54d8877a83 100644 --- a/src/main/java/gregtech/api/util/GT_CreativeTab.java +++ b/src/main/java/gregtech/api/util/GTCreativeTab.java @@ -7,11 +7,11 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.ItemList; -public class GT_CreativeTab extends CreativeTabs { +public class GTCreativeTab extends CreativeTabs { - public GT_CreativeTab(String aName, String aLocalName) { + public GTCreativeTab(String aName, String aLocalName) { super("GregTech." + aName); - GT_LanguageManager.addStringLocalization("itemGroup.GregTech." + aName, aLocalName); + GTLanguageManager.addStringLocalization("itemGroup.GregTech." + aName, aLocalName); } @Override diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GTFoodStat.java index 5eda76f9d0..51e8818f62 100644 --- a/src/main/java/gregtech/api/util/GT_FoodStat.java +++ b/src/main/java/gregtech/api/util/GTFoodStat.java @@ -6,12 +6,12 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; -import gregtech.api.damagesources.GT_DamageSources; +import gregtech.api.damagesources.GTDamageSources; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.IFoodStat; -import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.MetaBaseItem; -public class GT_FoodStat implements IFoodStat { +public class GTFoodStat implements IFoodStat { private final int mFoodLevel; private final int[] mPotionEffects; @@ -32,42 +32,42 @@ public class GT_FoodStat implements IFoodStat { * none Duration of the Potion in Ticks Level of the Effect. [0, 1, 2] are for [I, II, * III] The likelihood that this Potion Effect takes place upon being eaten [1 - 100] */ - public GT_FoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer, + public GTFoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer, boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { mFoodLevel = aFoodLevel; mSaturation = aSaturation; mAction = aAction == null ? EnumAction.eat : aAction; mPotionEffects = aPotionEffects; - mEmptyContainer = GT_Utility.copyOrNull(aEmptyContainer); + mEmptyContainer = GTUtility.copyOrNull(aEmptyContainer); mInvisibleParticles = aInvisibleParticles; mAlwaysEdible = aAlwaysEdible; mIsRotten = aIsRotten; } - public GT_FoodStat setExplosive() { + public GTFoodStat setExplosive() { mExplosive = true; return this; } - public GT_FoodStat setMilk() { + public GTFoodStat setMilk() { mMilk = true; return this; } @Override - public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + public int getFoodLevel(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer) { return mFoodLevel; } @Override - public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + public float getSaturation(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer) { return mSaturation; } @Override - public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + public void onEaten(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer) { aStack.stackSize--; - ItemStack tStack = GT_OreDictUnificator.get(GT_Utility.copyOrNull(mEmptyContainer)); + ItemStack tStack = GTOreDictUnificator.get(GTUtility.copyOrNull(mEmptyContainer)); if (tStack != null && !aPlayer.inventory.addItemStackToInventory(tStack)) aPlayer.dropPlayerItemWithRandomChoice(tStack, true); @@ -100,23 +100,23 @@ public class GT_FoodStat implements IFoodStat { .setEntity(aPlayer) .setWorld(aPlayer.worldObj) .run(); - aPlayer.attackEntityFrom(GT_DamageSources.getExplodingDamage(), Float.MAX_VALUE); + aPlayer.attackEntityFrom(GTDamageSources.getExplodingDamage(), Float.MAX_VALUE); } } } @Override - public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack) { + public EnumAction getFoodAction(MetaBaseItem aItem, ItemStack aStack) { return mAction; } @Override - public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + public boolean alwaysEdible(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer) { return mAlwaysEdible; } @Override - public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + public boolean isRotten(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer) { return mIsRotten; } } diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GTForestryCompat.java index 554964a4ed..379604205a 100644 --- a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java +++ b/src/main/java/gregtech/api/util/GTForestryCompat.java @@ -3,8 +3,8 @@ package gregtech.api.util; import static gregtech.api.recipe.RecipeMaps.centrifugeNonCellRecipes; import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.recipe.RecipeMaps.scannerFakeRecipes; -import static gregtech.api.util.GT_RecipeBuilder.SECONDS; -import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GTRecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.TICKS; import java.util.Map; @@ -13,16 +13,16 @@ import net.minecraft.item.ItemStack; import forestry.api.recipes.ICentrifugeRecipe; import forestry.api.recipes.ISqueezerRecipe; import forestry.api.recipes.RecipeManagers; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.recipe.RecipeMaps; -public class GT_Forestry_Compat { +public class GTForestryCompat { public static void populateFakeNeiRecipes() { if (ItemList.FR_Bee_Drone.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Bee_Drone.getWildcard(1L)) .itemOutputs(ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -34,7 +34,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Bee_Princess.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Bee_Princess.getWildcard(1L)) .itemOutputs(ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -46,7 +46,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Bee_Queen.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Bee_Queen.getWildcard(1L)) .itemOutputs(ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -58,7 +58,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Tree_Sapling.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Tree_Sapling.getWildcard(1L)) .itemOutputs(ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -70,7 +70,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Butterfly.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Butterfly.getWildcard(1L)) .itemOutputs(ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -82,7 +82,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Larvae.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Larvae.getWildcard(1L)) .itemOutputs(ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -94,7 +94,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Serum.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Serum.getWildcard(1L)) .itemOutputs(ItemList.FR_Serum.getWithName(1L, "Scanned Serum")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -106,7 +106,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_Caterpillar.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_Caterpillar.getWildcard(1L)) .itemOutputs(ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -118,7 +118,7 @@ public class GT_Forestry_Compat { .addTo(scannerFakeRecipes); } if (ItemList.FR_PollenFertile.get(1L) != null) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(ItemList.FR_PollenFertile.getWildcard(1L)) .itemOutputs(ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen")) .fluidInputs(Materials.Honey.getFluid(100L)) @@ -144,7 +144,7 @@ public class GT_Forestry_Compat { .copy(); i++; } - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(tRecipe.getInput()) .itemOutputs(tOutputs) .outputChances(tChances) @@ -152,7 +152,7 @@ public class GT_Forestry_Compat { .eut(5) .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(tRecipe.getInput()) .itemOutputs(tOutputs) .outputChances(tChances) @@ -161,8 +161,8 @@ public class GT_Forestry_Compat { .addTo(centrifugeNonCellRecipes); } } catch (Throwable e) { - if (GT_Values.D1) { - e.printStackTrace(GT_Log.err); + if (GTValues.D1) { + e.printStackTrace(GTLog.err); } } } @@ -172,7 +172,7 @@ public class GT_Forestry_Compat { for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null) && (tRecipe.getResources()[0] != null)) { - GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder(); recipeBuilder.itemInputs(tRecipe.getResources()[0]); if (tRecipe.getRemnants() != null) { recipeBuilder.itemOutputs(tRecipe.getRemnants()) @@ -185,8 +185,8 @@ public class GT_Forestry_Compat { } } } catch (Throwable e) { - if (GT_Values.D1) { - e.printStackTrace(GT_Log.err); + if (GTValues.D1) { + e.printStackTrace(GTLog.err); } } } diff --git a/src/main/java/gregtech/api/util/GT_GC_Compat.java b/src/main/java/gregtech/api/util/GTGCCompat.java index 24710ab0ac..0491d0f9f4 100644 --- a/src/main/java/gregtech/api/util/GT_GC_Compat.java +++ b/src/main/java/gregtech/api/util/GTGCCompat.java @@ -12,7 +12,7 @@ import micdoodle8.mods.galacticraft.api.transmission.NetworkType; import micdoodle8.mods.galacticraft.api.transmission.tile.IConnector; import micdoodle8.mods.galacticraft.core.energy.EnergyConfigHandler; -public class GT_GC_Compat { +public class GTGCCompat { public static long insertEnergyInto(TileEntity tTileEntity, long aVoltage, ForgeDirection tDirection) { // GC Compat diff --git a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java b/src/main/java/gregtech/api/util/GTIBoxableWrapper.java index 796699c261..fcb7846a20 100644 --- a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java +++ b/src/main/java/gregtech/api/util/GTIBoxableWrapper.java @@ -4,10 +4,10 @@ import net.minecraft.item.ItemStack; import ic2.api.item.IBoxable; -public class GT_IBoxableWrapper implements IBoxable { +public class GTIBoxableWrapper implements IBoxable { @Override public boolean canBeStoredInToolbox(ItemStack itemstack) { - return GT_Utility.isStackInList(itemstack, GT_ModHandler.sBoxableItems); + return GTUtility.isStackInList(itemstack, GTModHandler.sBoxableItems); } } diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GTItsNotMyFaultException.java index f47a356d7b..5d21fd2420 100644 --- a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java +++ b/src/main/java/gregtech/api/util/GTItsNotMyFaultException.java @@ -1,12 +1,12 @@ package gregtech.api.util; -public class GT_ItsNotMyFaultException extends RuntimeException { +public class GTItsNotMyFaultException extends RuntimeException { private static final long serialVersionUID = -8752778866486460495L; private final String mError; - public GT_ItsNotMyFaultException(String aError) { + public GTItsNotMyFaultException(String aError) { mError = aError; } diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GTLanguageManager.java index 4a9dc878ed..d68b438027 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GTLanguageManager.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import java.lang.reflect.Field; import java.util.HashMap; @@ -15,9 +15,9 @@ import net.minecraftforge.common.config.Property; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.ReflectionHelper; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; -public class GT_LanguageManager { +public class GTLanguageManager { /** * Buffer to reduce memory allocation when injecting data to LanguageRegistry. @@ -126,7 +126,7 @@ public class GT_LanguageManager { private static synchronized String writeToLangFile(String trimmedKey, String aEnglish) { Property tProperty = sEnglishFile.get("LanguageFile", trimmedKey, aEnglish); - if (hasUnsavedEntry && GregTech_API.sPostloadFinished) { + if (hasUnsavedEntry && GregTechAPI.sPostloadFinished) { sEnglishFile.save(); hasUnsavedEntry = false; } @@ -144,7 +144,7 @@ public class GT_LanguageManager { } private static synchronized void markFileDirty() { - if (GregTech_API.sPostloadFinished) { + if (GregTechAPI.sPostloadFinished) { sEnglishFile.save(); } else { hasUnsavedEntry = true; @@ -183,12 +183,12 @@ public class GT_LanguageManager { @SuppressWarnings("unused") public static String getTranslateableItemStackName(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return "null"; + if (GTUtility.isStackInvalid(aStack)) return "null"; NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("display")) { String tName = tNBT.getCompoundTag("display") .getString("Name"); - if (GT_Utility.isStringValid(tName)) { + if (GTUtility.isStringValid(tName)) { return tName; } } diff --git a/src/main/java/gregtech/api/util/GT_Log.java b/src/main/java/gregtech/api/util/GTLog.java index 2d00c2e061..eba6b0fe50 100644 --- a/src/main/java/gregtech/api/util/GT_Log.java +++ b/src/main/java/gregtech/api/util/GTLog.java @@ -11,7 +11,7 @@ import java.util.List; * <p/> * Just a simple Logging Function. If on Server, then this will point to System.out and System.err */ -public class GT_Log { +public class GTLog { public static PrintStream out = System.out; public static PrintStream err = System.err; diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GTModHandler.java index b5c7c6fb6e..8c06f2ad47 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GTModHandler.java @@ -1,19 +1,19 @@ package gregtech.api.util; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.B; -import static gregtech.api.enums.GT_Values.D1; -import static gregtech.api.enums.GT_Values.DW; -import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.GT_Values.RA; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.enums.GT_Values.W; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.B; +import static gregtech.api.enums.GTValues.D1; +import static gregtech.api.enums.GTValues.DW; +import static gregtech.api.enums.GTValues.E; +import static gregtech.api.enums.GTValues.M; +import static gregtech.api.enums.GTValues.RA; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.enums.GTValues.VN; +import static gregtech.api.enums.GTValues.W; import static gregtech.api.recipe.RecipeMaps.alloySmelterRecipes; import static gregtech.api.recipe.RecipeMaps.oreWasherRecipes; -import static gregtech.api.util.GT_RecipeBuilder.SECONDS; -import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GTRecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.TICKS; import java.util.ArrayList; import java.util.Arrays; @@ -57,8 +57,8 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; @@ -67,11 +67,11 @@ import gregtech.api.enums.Tier; import gregtech.api.enums.ToolDictNames; import gregtech.api.interfaces.IDamagableItem; import gregtech.api.interfaces.IItemContainer; -import gregtech.api.interfaces.internal.IGT_CraftingRecipe; -import gregtech.api.items.GT_MetaBase_Item; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; -import gregtech.api.objects.GT_HashSet; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.interfaces.internal.IGTCraftingRecipe; +import gregtech.api.items.MetaBaseItem; +import gregtech.api.metatileentity.implementations.MTEBasicMachineWithRecipe; +import gregtech.api.objects.GTHashSet; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeCategories; import gregtech.api.recipe.RecipeMap; @@ -91,7 +91,7 @@ import ic2.core.item.ItemToolbox; * <p/> * Due to the many imports, this File can cause compile Problems if not all the APIs are installed */ -public class GT_ModHandler { +public class GTModHandler { public static final List<IRecipe> sSingleNonBlockDamagableRecipeList = new ArrayList<>(1000); private static final Map<String, ItemStack> sIC2ItemMap = new HashMap<>(); @@ -102,12 +102,12 @@ public class GT_ModHandler { private static final List<InventoryCrafting> delayedRemovalByRecipe = new ArrayList<>(); public static Collection<String> sNativeRecipeClasses = new HashSet<>(), sSpecialRecipeClasses = new HashSet<>(); - public static GT_HashSet<GT_ItemStack> sNonReplaceableItems = new GT_HashSet<>(); - public static Object sBoxableWrapper = new GT_IBoxableWrapper(); - public static Collection<GT_ItemStack> sBoxableItems = new ArrayList<>(); + public static GTHashSet<GTItemStack> sNonReplaceableItems = new GTHashSet<>(); + public static Object sBoxableWrapper = new GTIBoxableWrapper(); + public static Collection<GTItemStack> sBoxableItems = new ArrayList<>(); private static final Map<IRecipeInput, RecipeOutput> emptyRecipeMap = new HashMap<>(); - private static Set<GT_Utility.ItemId> recyclerWhitelist; - private static Set<GT_Utility.ItemId> recyclerBlacklist; + private static Set<GTUtility.ItemId> recyclerWhitelist; + private static Set<GTUtility.ItemId> recyclerBlacklist; private static boolean sBufferCraftingRecipes = true; public static List<Integer> sSingleNonBlockDamagableRecipeList_list = new ArrayList<>(100); @@ -170,10 +170,10 @@ public class GT_ModHandler { static { sNativeRecipeClasses.add(ShapedRecipes.class.getName()); sNativeRecipeClasses.add(ShapedOreRecipe.class.getName()); - sNativeRecipeClasses.add(GT_Shaped_Recipe.class.getName()); + sNativeRecipeClasses.add(GTShapedRecipe.class.getName()); sNativeRecipeClasses.add(ShapelessRecipes.class.getName()); sNativeRecipeClasses.add(ShapelessOreRecipe.class.getName()); - sNativeRecipeClasses.add(GT_Shapeless_Recipe.class.getName()); + sNativeRecipeClasses.add(GTShapelessRecipe.class.getName()); sNativeRecipeClasses.add(ic2.core.AdvRecipe.class.getName()); sNativeRecipeClasses.add(ic2.core.AdvShapelessRecipe.class.getName()); sNativeRecipeClasses.add("appeng.recipes.game.ShapedRecipe"); @@ -315,7 +315,7 @@ public class GT_ModHandler { * properly, stupid Mojang... */ public static ItemStack setFuelValue(ItemStack aStack, short aValue) { - aStack.setTagCompound(GT_Utility.getNBTContainingShort(aStack.getTagCompound(), "GT.ItemFuelValue", aValue)); + aStack.setTagCompound(GTUtility.getNBTContainingShort(aStack.getTagCompound(), "GT.ItemFuelValue", aValue)); return aStack; } @@ -332,16 +332,16 @@ public class GT_ModHandler { * Gets an Item from IndustrialCraft, and returns a Replacement Item if not possible */ public static ItemStack getIC2Item(String aItem, long aAmount, ItemStack aReplacement) { - if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) return null; - // if (D1) GT_Log.out.println("Requested the Item '" + aItem + "' from the IC2-API"); + if (GTUtility.isStringInvalid(aItem) || !GregTechAPI.sPreloadStarted) return null; + // if (D1) GTLog.out.println("Requested the Item '" + aItem + "' from the IC2-API"); if (!sIC2ItemMap.containsKey(aItem)) try { ItemStack tStack = IC2Items.getItem(aItem); sIC2ItemMap.put(aItem, tStack); - if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!"); + if (tStack == null && D1) GTLog.err.println(aItem + " is not found in the IC2 Items!"); } catch (Throwable e) { /* Do nothing */ } - return GT_Utility.copyAmount(aAmount, sIC2ItemMap.get(aItem), aReplacement); + return GTUtility.copyAmount(aAmount, sIC2ItemMap.get(aItem), aReplacement); } /** @@ -381,18 +381,18 @@ public class GT_ModHandler { */ public static ItemStack getModItem(String aModID, String aItem, long aAmount, ItemStack aReplacement) { ItemStack result; - if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) { + if (GTUtility.isStringInvalid(aItem) || !GregTechAPI.sPreloadStarted) { result = null; } else { - result = GT_Utility + result = GTUtility .copyAmount(aAmount, GameRegistry.findItemStack(aModID, aItem, (int) aAmount), aReplacement); } if (result == null) { String reason; - if (GT_Utility.isStringInvalid(aItem)) { + if (GTUtility.isStringInvalid(aItem)) { reason = "the name of the item is an invalid string"; - } else if (!GregTech_API.sPreloadStarted) { + } else if (!GregTechAPI.sPreloadStarted) { reason = "the GT5U preloading phase has not yet started"; } else { reason = "the item was not found in the game registry"; @@ -402,8 +402,8 @@ public class GT_ModHandler { + aModID + "\" has returned null because " + reason; - GT_Log.out.println(log_message); - new Exception().printStackTrace(GT_Log.out); + GTLog.out.println(log_message); + new Exception().printStackTrace(GTLog.out); } return result; } @@ -472,26 +472,26 @@ public class GT_ModHandler { * Adds a Scrapbox Drop. Fails at April first for the "suddenly Hoes"-Feature of IC2 */ public static boolean addScrapboxDrop(float aChance, ItemStack aOutput) { - aOutput = GT_OreDictUnificator.get(true, aOutput); + aOutput = GTOreDictUnificator.get(true, aOutput); if (aOutput == null || aChance <= 0) return false; aOutput.stackSize = 1; - if (GT_Config.troll && !GT_Utility.areStacksEqual(aOutput, new ItemStack(Items.wooden_hoe, 1, 0))) return false; + if (GTConfig.troll && !GTUtility.areStacksEqual(aOutput, new ItemStack(Items.wooden_hoe, 1, 0))) return false; try { - GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + GTUtility.callMethod( + GTUtility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), "addDrop", true, false, true, - GT_Utility.copyOrNull(aOutput), + GTUtility.copyOrNull(aOutput), aChance); - GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + GTUtility.callMethod( + GTUtility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), "addRecipe", true, true, false, - GT_Utility.copyOrNull(aOutput), + GTUtility.copyOrNull(aOutput), aChance); } catch (Throwable e) { /* Do nothing */ @@ -516,10 +516,10 @@ public class GT_ModHandler { * Just simple Furnace smelting. Unbelievable how Minecraft fails at making a simple ItemStack->ItemStack mapping... */ public static boolean addSmeltingRecipe(ItemStack aInput, ItemStack aOutput) { - aOutput = GT_OreDictUnificator.get(true, aOutput); + aOutput = GTOreDictUnificator.get(true, aOutput); if (aInput == null || aOutput == null) return false; FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); + .func_151394_a(aInput, GTUtility.copyOrNull(aOutput), 0.0F); return true; } @@ -541,7 +541,7 @@ public class GT_ModHandler { || (OrePrefixes.gem.contains(aInput)))) { return false; } - GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder(); if (input2 == null) { recipeBuilder.itemInputs(aInput); } else { @@ -588,7 +588,7 @@ public class GT_ModHandler { } for (ItemStack tStack : (iRecipeInputRecipeOutputEntry.getKey()).getInputs()) { - if (!GT_Utility.isStackValid(tStack)) { + if (!GTUtility.isStackValid(tStack)) { continue; } @@ -604,10 +604,10 @@ public class GT_ModHandler { .contains("ic2.itemPurifiedCrushed")))) continue; switch (aGTRecipeMap.unlocalizedName) { - case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> GT_Values.RA + case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> GTValues.RA .stdBuilder() .itemInputs( - GT_Utility.copyAmount( + GTUtility.copyAmount( iRecipeInputRecipeOutputEntry.getKey() .getAmount(), tStack)) @@ -615,9 +615,9 @@ public class GT_ModHandler { .duration(15 * SECONDS) .eut(2) .addTo(aGTRecipeMap); - case "gt.recipe.thermalcentrifuge" -> GT_Values.RA.stdBuilder() + case "gt.recipe.thermalcentrifuge" -> GTValues.RA.stdBuilder() .itemInputs( - GT_Utility.copyAmount( + GTUtility.copyAmount( iRecipeInputRecipeOutputEntry.getKey() .getAmount(), tStack)) @@ -627,7 +627,7 @@ public class GT_ModHandler { .addTo(aGTRecipeMap); } } catch (Exception e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } } if (aRemoveIC2Recipe) { @@ -637,7 +637,7 @@ public class GT_ModHandler { } } - GT_Utility.bulkRemoveSimpleIC2MachineRecipe(aRecipesToRemove, aIC2RecipeList); + GTUtility.bulkRemoveSimpleIC2MachineRecipe(aRecipesToRemove, aIC2RecipeList); } public static Map<IRecipeInput, RecipeOutput> getExtractorRecipeList() { @@ -695,7 +695,7 @@ public class GT_ModHandler { .itemInputs(aInput) .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2]) .outputChances(aChances) - .fluidInputs(GT_ModHandler.getWater(aWaterAmount)) + .fluidInputs(GTModHandler.getWater(aWaterAmount)) .duration(25 * SECONDS) .eut(16) .addTo(oreWasherRecipes); @@ -704,7 +704,7 @@ public class GT_ModHandler { .itemInputs(aInput) .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2]) .outputChances(aChances) - .fluidInputs(GT_ModHandler.getDistilledWater(aWaterAmount / 5)) + .fluidInputs(GTModHandler.getDistilledWater(aWaterAmount / 5)) .duration(15 * SECONDS) .eut(16) .addTo(oreWasherRecipes); @@ -813,10 +813,10 @@ public class GT_ModHandler { int machineTier) { if (aRecipe != null) { for (int i = 3; i < aRecipe.length; i++) { - if (!(aRecipe[i] instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe.X)) continue; + if (!(aRecipe[i] instanceof MTEBasicMachineWithRecipe.X)) continue; // spotless:off - aRecipe[i] = switch ((GT_MetaTileEntity_BasicMachine_GT_Recipe.X) aRecipe[i]) { + aRecipe[i] = switch ((MTEBasicMachineWithRecipe.X) aRecipe[i]) { case CIRCUIT -> Tier.ELECTRIC[machineTier].mManagingObject; case BETTER_CIRCUIT -> Tier.ELECTRIC[machineTier].mBetterManagingObject; case HULL -> Tier.ELECTRIC[machineTier].mHullObject; @@ -1058,11 +1058,11 @@ public class GT_ModHandler { // spotless:on } - if (!GT_ModHandler.addCraftingRecipe( + if (!GTModHandler.addCraftingRecipe( aResult, - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED - | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE, + GTModHandler.RecipeBits.DISMANTLEABLE | GTModHandler.RecipeBits.BUFFERED + | GTModHandler.RecipeBits.NOT_REMOVABLE + | GTModHandler.RecipeBits.REVERSIBLE, aRecipe)) { throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + aResult.getDisplayName()); } @@ -1080,7 +1080,7 @@ public class GT_ModHandler { boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { - aResult = GT_OreDictUnificator.get(true, aResult); + aResult = GTOreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return false; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); if (aRecipe == null || aRecipe.length == 0) return false; @@ -1191,18 +1191,18 @@ public class GT_ModHandler { for (; idx < aRecipe.length; idx += 2) { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { - GT_Log.err.println( + GTLog.err.println( "WARNING: Missing Item for shaped Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); - for (Object tContent : aRecipe) GT_Log.err.println(tContent); + for (Object tContent : aRecipe) GTLog.err.println(tContent); } return false; } Character chr = (Character) aRecipe[idx]; Object in = aRecipe[idx + 1]; if (in instanceof ItemStack is) { - tItemStackMap.put(chr, GT_Utility.copyOrNull(is)); - tItemDataMap.put(chr, GT_OreDictUnificator.getItemData(is)); + tItemStackMap.put(chr, GTUtility.copyOrNull(is)); + tItemDataMap.put(chr, GTOreDictUnificator.getItemData(is)); } else if (in instanceof ItemData) { String tString = in.toString(); switch (tString) { @@ -1212,7 +1212,7 @@ public class GT_ModHandler { case "stoneEndstone" -> tItemDataMap.put(chr, new ItemData(Materials.Endstone, M)); default -> tItemDataMap.put(chr, (ItemData) in); } - ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + ItemStack tStack = GTOreDictUnificator.getFirstOre(in, 1); if (tStack == null) tRemoveRecipe = false; else tItemStackMap.put(chr, tStack); in = aRecipe[idx + 1] = in.toString(); @@ -1229,7 +1229,7 @@ public class GT_ModHandler { tItemDataMap.put(chr, new ItemData(Materials.Diamond, M)); else if (in.equals(OreDictNames.craftingAnvil.toString())) tItemDataMap.put(chr, new ItemData(Materials.Iron, M * 10)); - ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + ItemStack tStack = GTOreDictUnificator.getFirstOre(in, 1); if (tStack == null) tRemoveRecipe = false; else tItemStackMap.put(chr, tStack); } else { @@ -1242,8 +1242,8 @@ public class GT_ModHandler { int x = -1; for (char chr : shape.toString() .toCharArray()) tData[++x] = tItemDataMap.get(chr); - if (GT_Utility.arrayContainsNonNull(tData)) - GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); + if (GTUtility.arrayContainsNonNull(tData)) + GTOreDictUnificator.addItemData(aResult, new ItemData(tData)); } if (aCheckForCollisions && tRemoveRecipe) { @@ -1259,7 +1259,7 @@ public class GT_ModHandler { else removeRecipeDelayed(tRecipe); } } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } if (aResult == null || aResult.stackSize <= 0) return false; @@ -1285,7 +1285,7 @@ public class GT_ModHandler { tRecipe.getClass() .getName())) continue; - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { + if (GTUtility.areStacksEqual(GTOreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { tList.remove(i--); tList_sS = tList.size(); tThereWasARecipe = true; @@ -1296,12 +1296,12 @@ public class GT_ModHandler { if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) Items.feather.setDamage(aResult, 0); - GT_Utility.updateItemStack(aResult); + GTUtility.updateItemStack(aResult); if (tThereWasARecipe || !aOnlyAddIfThereIsAnyRecipeOutputtingThis) { if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), + new GTShapedRecipe( + GTUtility.copyOrNull(aResult), aDismantleable, aRemovable, aKeepNBT, @@ -1309,8 +1309,8 @@ public class GT_ModHandler { aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored)); else GameRegistry.addRecipe( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), + new GTShapedRecipe( + GTUtility.copyOrNull(aResult), aDismantleable, aRemovable, aKeepNBT, @@ -1368,7 +1368,7 @@ public class GT_ModHandler { private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, Object[] aRecipe) { - aResult = GT_OreDictUnificator.get(true, aResult); + aResult = GTOreDictUnificator.get(true, aResult); if (aRecipe == null || aRecipe.length == 0) return false; for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); @@ -1382,16 +1382,16 @@ public class GT_ModHandler { int i = 0; for (Object tObject : aRecipe) { if (tObject == null) { - if (D1) GT_Log.err.println( + if (D1) GTLog.err.println( "WARNING: Missing Item for shapeless Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); - for (Object tContent : aRecipe) GT_Log.err.println(tContent); + for (Object tContent : aRecipe) GTLog.err.println(tContent); return false; } if (tObject instanceof ItemStack) { tRecipe[i] = (ItemStack) tObject; } else if (tObject instanceof String) { - tRecipe[i] = GT_OreDictUnificator.getFirstOre(tObject, 1); + tRecipe[i] = GTOreDictUnificator.getFirstOre(tObject, 1); if (tRecipe[i] == null) break; } i++; @@ -1399,7 +1399,7 @@ public class GT_ModHandler { if (sBufferCraftingRecipes && aBuffered) removeRecipeDelayed(tRecipe); else removeRecipe(tRecipe); } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } if (aResult == null || aResult.stackSize <= 0) return false; @@ -1407,11 +1407,11 @@ public class GT_ModHandler { if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) Items.feather.setDamage(aResult, 0); - GT_Utility.updateItemStack(aResult); + GTUtility.updateItemStack(aResult); if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), + new GTShapelessRecipe( + GTUtility.copyOrNull(aResult), aDismantleable, aRemovable, aKeepNBT, @@ -1419,8 +1419,8 @@ public class GT_ModHandler { aEnchantmentLevelsAdded, aRecipe)); else GameRegistry.addRecipe( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), + new GTShapelessRecipe( + GTUtility.copyOrNull(aResult), aDismantleable, aRemovable, aKeepNBT, @@ -1438,7 +1438,7 @@ public class GT_ModHandler { for (ItemStack tInput : FurnaceRecipes.smelting() .getSmeltingList() .keySet()) { - if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, tInput, true)) { + if (GTUtility.isStackValid(tInput) && GTUtility.areStacksEqual(aInput, tInput, true)) { FurnaceRecipes.smelting() .getSmeltingList() .remove(tInput); @@ -1458,7 +1458,7 @@ public class GT_ModHandler { .getSmeltingList() .values() .removeIf( - tOutput -> GT_Utility.isStackValid(tOutput) && GT_Utility.areStacksEqual(aOutput, tOutput, true)); + tOutput -> GTUtility.isStackValid(tOutput) && GTUtility.areStacksEqual(aOutput, tOutput, true)); } return false; } @@ -1489,8 +1489,8 @@ public class GT_ModHandler { try { for (int i = 0; i < tList_sS; i++) { for (; i < tList_sS; i++) { - if ((!(tList.get(i) instanceof IGT_CraftingRecipe) - || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) + if ((!(tList.get(i) instanceof IGTCraftingRecipe) + || ((IGTCraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) .matches(aCrafting, DW)) { rReturn = tList.get(i) .getCraftingResult(aCrafting); @@ -1500,7 +1500,7 @@ public class GT_ModHandler { } } } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } return rReturn; } @@ -1533,7 +1533,7 @@ public class GT_ModHandler { Set<IRecipe> tListToRemove = tList.parallelStream() .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + if ((tRecipe instanceof IGTCraftingRecipe) && !((IGTCraftingRecipe) tRecipe).isRemovable()) return false; return toRemove.stream() .anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW)); @@ -1572,7 +1572,7 @@ public class GT_ModHandler { boolean rReturn = false; final ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance() .getRecipeList(); - aOutput = GT_OreDictUnificator.get(aOutput); + aOutput = GTOreDictUnificator.get(aOutput); int tList_sS = tList.size(); for (int i = 0; i < tList_sS; i++) { final IRecipe tRecipe = tList.get(i); @@ -1590,8 +1590,8 @@ public class GT_ModHandler { continue; } ItemStack tStack = tRecipe.getRecipeOutput(); - if ((!(tRecipe instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe) tRecipe).isRemovable()) - && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { + if ((!(tRecipe instanceof IGTCraftingRecipe) || ((IGTCraftingRecipe) tRecipe).isRemovable()) + && GTUtility.areStacksEqual(GTOreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { tList.remove(i--); tList_sS = tList.size(); rReturn = true; @@ -1605,22 +1605,22 @@ public class GT_ModHandler { .getRecipeList(); Set<ItemStack> setToRemove = toRemove.parallelStream() - .map(GT_OreDictUnificator::get_nocopy) + .map(GTOreDictUnificator::get_nocopy) .collect(Collectors.toSet()); GT_FML_LOGGER.info("BulkRemoveRecipeByOutput: tList: " + tList.size() + " setToRemove: " + setToRemove.size()); Set<IRecipe> tListToRemove = tList.parallelStream() .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + if ((tRecipe instanceof IGTCraftingRecipe) && !((IGTCraftingRecipe) tRecipe).isRemovable()) return false; if (sSpecialRecipeClasses.contains( tRecipe.getClass() .getName())) return false; - final ItemStack tStack = GT_OreDictUnificator.get_nocopy(tRecipe.getRecipeOutput()); + final ItemStack tStack = GTOreDictUnificator.get_nocopy(tRecipe.getRecipeOutput()); return setToRemove.stream() - .anyMatch(aOutput -> GT_Utility.areStacksEqual(tStack, aOutput, true)); + .anyMatch(aOutput -> GTUtility.areStacksEqual(tStack, aOutput, true)); }) .collect(Collectors.toSet()); @@ -1738,17 +1738,17 @@ public class GT_ModHandler { try { found = iRecipe.matches(aCrafting, DW); } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } if (found) { ItemStack tOutput = aUncopiedStack ? iRecipe.getRecipeOutput() : iRecipe.getCraftingResult(aCrafting); if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? - if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( + if (!GregTechAPI.sPostloadFinished) throw new GTItsNotMyFaultException( "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); } else { if (aUncopiedStack) return tOutput; - return GT_Utility.copyOrNull(tOutput); + return GTUtility.copyOrNull(tOutput); } } } @@ -1760,18 +1760,17 @@ public class GT_ModHandler { * example This also removes old Recipes from the List. */ public static List<ItemStack> getVanillyToolRecipeOutputs(ItemStack... aRecipe) { - if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) - sSingleNonBlockDamagableRecipeList.clear(); + if (!GregTechAPI.sPostloadStarted || GregTechAPI.sPostloadFinished) sSingleNonBlockDamagableRecipeList.clear(); if (sSingleNonBlockDamagableRecipeList.isEmpty()) { for (IRecipe tRecipe : CraftingManager.getInstance() .getRecipeList()) { ItemStack tStack = tRecipe.getRecipeOutput(); - if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 + if (GTUtility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { + && !GTUtility.isStackInList(tStack, sNonReplaceableItems)) { if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) { if (tRecipe instanceof ShapedOreRecipe) { boolean temp = true; @@ -1806,16 +1805,15 @@ public class GT_ModHandler { } } } - GT_Log.out.println( - "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + GTLog.out.println( + "GTMod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling." + (sSingleNonBlockDamagableRecipeList.size() > 1024 ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." : E)); } List<ItemStack> rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe); - if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) - sSingleNonBlockDamagableRecipeList.clear(); + if (!GregTechAPI.sPostloadStarted || GregTechAPI.sPostloadFinished) sSingleNonBlockDamagableRecipeList.clear(); return rList; } @@ -1844,7 +1842,7 @@ public class GT_ModHandler { .stream() .filter( tRecipe -> !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe) - && !(tRecipe instanceof IGT_CraftingRecipe)) + && !(tRecipe instanceof IGTCraftingRecipe)) .filter(tRecipe -> { try { ItemStack tOutput = tRecipe.getRecipeOutput(); @@ -1879,11 +1877,11 @@ public class GT_ModHandler { aList.stream() .filter(tRecipe -> { if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe - || tRecipe instanceof IGT_CraftingRecipe) return false; + || tRecipe instanceof IGTCraftingRecipe) return false; try { return tRecipe.matches(aCrafting, DW); } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); return false; } }) @@ -1899,14 +1897,14 @@ public class GT_ModHandler { try { matched = tRecipe.matches(aCrafting, DW); } catch (Throwable e) { - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } if (matched) { ItemStack tOutput = tRecipe.getCraftingResult(aCrafting); if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? - if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( + if (!GregTechAPI.sPostloadFinished) throw new GTItsNotMyFaultException( "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); continue; } @@ -1915,8 +1913,8 @@ public class GT_ModHandler { if (tOutput.getMaxStackSize() != 1) continue; if (tRecipe instanceof ShapelessRecipes) continue; if (tRecipe instanceof ShapelessOreRecipe) continue; - if (tRecipe instanceof IGT_CraftingRecipe) continue; - rList.add(GT_Utility.copyOrNull(tOutput)); + if (tRecipe instanceof IGTCraftingRecipe) continue; + rList.add(GTUtility.copyOrNull(tOutput)); iterator.remove(); } } @@ -1928,11 +1926,11 @@ public class GT_ModHandler { */ public static ItemStack getSmeltingOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { if (aInput == null || aInput.stackSize < 1) return null; - ItemStack rStack = GT_OreDictUnificator.get( + ItemStack rStack = GTOreDictUnificator.get( FurnaceRecipes.smelting() .getSmeltingResult(aInput)); - if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot) + if (rStack != null && (aOutputSlot == null || (GTUtility.areStacksEqual(rStack, aOutputSlot) && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { if (aRemoveInput) aInput.stackSize--; return rStack; @@ -1961,10 +1959,10 @@ public class GT_ModHandler { rRecipeMetaData.setTag("return", tEntry.getValue().metadata); for (byte i = 0; i < aOutputSlots.length && i < tList.length; i++) { if (tList[i] != null) { - if (aOutputSlots[i] == null || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i]) + if (aOutputSlots[i] == null || (GTUtility.areStacksEqual(tList[i], aOutputSlots[i]) && tList[i].stackSize + aOutputSlots[i].stackSize <= aOutputSlots[i].getMaxStackSize())) { - rList[i] = GT_Utility.copyOrNull(tList[i]); + rList[i] = GTUtility.copyOrNull(tList[i]); } else { return new ItemStack[aOutputSlots.length]; } @@ -1979,7 +1977,7 @@ public class GT_ModHandler { } } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return new ItemStack[aOutputSlots.length]; } @@ -2016,23 +2014,23 @@ public class GT_ModHandler { recyclerWhitelist = new HashSet<>(); for (IRecipeInput input : ic2.api.recipe.Recipes.recyclerWhitelist) { for (ItemStack stack : input.getInputs()) { - recyclerWhitelist.add(GT_Utility.ItemId.create(stack.getItem(), stack.getItemDamage(), null)); + recyclerWhitelist.add(GTUtility.ItemId.create(stack.getItem(), stack.getItemDamage(), null)); } } recyclerBlacklist = new HashSet<>(); for (IRecipeInput input : ic2.api.recipe.Recipes.recyclerBlacklist) { for (ItemStack stack : input.getInputs()) { - recyclerBlacklist.add(GT_Utility.ItemId.create(stack.getItem(), stack.getItemDamage(), null)); + recyclerBlacklist.add(GTUtility.ItemId.create(stack.getItem(), stack.getItemDamage(), null)); } } } - private static boolean searchRecyclerCache(ItemStack stack, Set<GT_Utility.ItemId> set) { - if (set.contains(GT_Utility.ItemId.createWithoutNBT(stack))) { + private static boolean searchRecyclerCache(ItemStack stack, Set<GTUtility.ItemId> set) { + if (set.contains(GTUtility.ItemId.createWithoutNBT(stack))) { return true; } // ic2.api.recipe.RecipeInputItemStack#matches expects item with wildcard meta to accept arbitrary meta - return set.contains(GT_Utility.ItemId.createAsWildcard(stack)); + return set.contains(GTUtility.ItemId.createAsWildcard(stack)); } /** @@ -2148,16 +2146,16 @@ public class GT_ModHandler { * Uses an Item. Tries to discharge in case of Electric Items */ public static boolean damageOrDechargeItem(ItemStack aStack, int aDamage, int aDecharge, EntityLivingBase aPlayer) { - if (GT_Utility.isStackInvalid(aStack) || (aStack.getMaxStackSize() <= 1 && aStack.stackSize > 1)) return false; + if (GTUtility.isStackInvalid(aStack) || (aStack.getMaxStackSize() <= 1 && aStack.stackSize > 1)) return false; if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true; if (aStack.getItem() instanceof IDamagableItem) { return ((IDamagableItem) aStack.getItem()).doDamageToItem(aStack, aDamage); - } else if (GT_ModHandler.isElectricItem(aStack)) { + } else if (GTModHandler.isElectricItem(aStack)) { if (canUseElectricItem(aStack, aDecharge)) { if (aPlayer instanceof EntityPlayer) { - return GT_ModHandler.useElectricItem(aStack, aDecharge, (EntityPlayer) aPlayer); + return GTModHandler.useElectricItem(aStack, aDecharge, (EntityPlayer) aPlayer); } - return GT_ModHandler.dischargeElectricItem(aStack, aDecharge, Integer.MAX_VALUE, true, false, true) + return GTModHandler.dischargeElectricItem(aStack, aDecharge, Integer.MAX_VALUE, true, false, true) >= aDecharge; } } else if (aStack.getItem() @@ -2169,7 +2167,7 @@ public class GT_ModHandler { } if (aStack.getItemDamage() >= aStack.getMaxDamage()) { aStack.setItemDamage(aStack.getMaxDamage() + 1); - ItemStack tStack = GT_Utility.getContainerItem(aStack, true); + ItemStack tStack = GTUtility.getContainerItem(aStack, true); if (tStack != null) { aStack.func_150996_a(tStack.getItem()); aStack.setItemDamage(tStack.getItemDamage()); @@ -2189,24 +2187,24 @@ public class GT_ModHandler { */ public static boolean useSolderingIron(ItemStack aStack, EntityLivingBase aPlayer, IInventory aExternalInventory) { if (aPlayer == null || aStack == null) return false; - if (GT_Utility.isStackInList(aStack, GregTech_API.sSolderingToolList)) { + if (GTUtility.isStackInList(aStack, GregTechAPI.sSolderingToolList)) { if (aPlayer instanceof EntityPlayer tPlayer) { if (tPlayer.capabilities.isCreativeMode) return true; if (isElectricItem(aStack) && ic2.api.item.ElectricItem.manager.getCharge(aStack) > 1000.0d) { if (consumeSolderingMaterial(tPlayer) || (aExternalInventory != null && consumeSolderingMaterial(aExternalInventory))) { if (canUseElectricItem(aStack, 10000)) { - return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer); + return GTModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer); } - GT_ModHandler.useElectricItem( + GTModHandler.useElectricItem( aStack, (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), (EntityPlayer) aPlayer); return false; } else { - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( (EntityPlayer) aPlayer, - GT_Utility.trans("094.1", "Not enough soldering material!")); + GTUtility.trans("094.1", "Not enough soldering material!")); } } } else { @@ -2252,7 +2250,7 @@ public class GT_ModHandler { public static boolean consumeSolderingMaterial(IInventory aInventory) { for (int i = 0; i < aInventory.getSizeInventory(); i++) { ItemStack tStack = aInventory.getStackInSlot(i); - if (GT_Utility.isStackInList(tStack, GregTech_API.sSolderingMetalList)) { + if (GTUtility.isStackInList(tStack, GregTechAPI.sSolderingMetalList)) { if (tStack.stackSize < 1) return false; if (tStack.stackSize == 1) { tStack = null; @@ -2318,7 +2316,7 @@ public class GT_ModHandler { final Item item = aStack.getItem(); - if (item instanceof final GT_MetaBase_Item metaBaseItem) { + if (item instanceof final MetaBaseItem metaBaseItem) { final Long[] stats = metaBaseItem.getElectricStats(aStack); if (stats != null && stats.length > 0) { return Optional.of(new Long[] { metaBaseItem.getRealCharge(aStack), stats[0] }); @@ -2343,7 +2341,7 @@ public class GT_ModHandler { } catch (Throwable ignored) { /* Do nothing */ } - sBoxableItems.add(new GT_ItemStack(aStack)); + sBoxableItems.add(new GTItemStack(aStack)); } } @@ -2357,11 +2355,11 @@ public class GT_ModHandler { public static int getCapsuleCellContainerCount(ItemStack aStack) { if (aStack == null) return 0; - if (GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(aStack, true), ItemList.Cell_Empty.get(1))) { + if (GTUtility.areStacksEqual(GTUtility.getContainerForFilledItem(aStack, true), ItemList.Cell_Empty.get(1))) { return 1; } - if (GT_Utility.areStacksEqual(aStack, getIC2Item("waterCell", 1, W))) { + if (GTUtility.areStacksEqual(aStack, getIC2Item("waterCell", 1, W))) { return 1; } diff --git a/src/main/java/gregtech/api/util/GT_MusicSystem.java b/src/main/java/gregtech/api/util/GTMusicSystem.java index 7c0ec929e9..362c397e67 100644 --- a/src/main/java/gregtech/api/util/GT_MusicSystem.java +++ b/src/main/java/gregtech/api/util/GTMusicSystem.java @@ -34,12 +34,12 @@ import com.jcraft.jorbis.VorbisFile; import baubles.api.BaublesApi; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.network.ByteBufUtils; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; -import gregtech.api.net.GT_Packet_MusicSystemData; +import gregtech.GTMod; +import gregtech.api.enums.GTValues; +import gregtech.api.net.GTPacketMusicSystemData; import gregtech.client.ElectricJukeboxSound; -import gregtech.common.items.GT_WirelessHeadphones; -import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_BetterJukebox; +import gregtech.common.items.ItemWirelessHeadphones; +import gregtech.common.tileentities.machines.basic.MTEBetterJukebox; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; @@ -56,9 +56,9 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; * * @author eigenraven */ -public final class GT_MusicSystem { +public final class GTMusicSystem { - private GT_MusicSystem() {} + private GTMusicSystem() {} public static final class MusicSource { @@ -68,7 +68,7 @@ public final class GT_MusicSystem { /** Currently playing track */ public ResourceLocation currentRecord; /** Headphone range */ - public GT_MetaTileEntity_BetterJukebox.HeadphoneLimit headphoneLimit; + public MTEBetterJukebox.HeadphoneLimit headphoneLimit; /** * {@link System#currentTimeMillis()} at the time this record started playing, in server time */ @@ -219,7 +219,7 @@ public final class GT_MusicSystem { final String path = ByteBufUtils.readUTF8String(bytes); source.currentRecord = new ResourceLocation(domain, path); } - source.headphoneLimit = GT_MetaTileEntity_BetterJukebox.HeadphoneLimit.ENTRIES.get(bytes.readByte()); + source.headphoneLimit = MTEBetterJukebox.HeadphoneLimit.ENTRIES.get(bytes.readByte()); source.headphoneBlockRange = ByteBufUtils.readVarInt(bytes, 5); source.startedPlayingAtMs = bytes.readLong(); source.playingForMs = bytes.readLong(); @@ -293,7 +293,7 @@ public final class GT_MusicSystem { }); if (tickAnyDirty || musicSourcesDirty) { musicSourcesDirty = false; - GT_Values.NW.sendToAll(new GT_Packet_MusicSystemData(serialize())); + GTValues.NW.sendToAll(new GTPacketMusicSystemData(serialize())); } } @@ -462,10 +462,10 @@ public final class GT_MusicSystem { json.soundDurationsMs.put(res.toString(), (int) Math.ceil(totalSeconds * 1000.0f)); } } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.warn("Skipping {}", record.recordName, e); + GTMod.GT_FML_LOGGER.warn("Skipping {}", record.recordName, e); } } - GT_Mod.GT_FML_LOGGER.info( + GTMod.GT_FML_LOGGER.info( "Sound durations json: \n{}", new GsonBuilder().setPrettyPrinting() .create() @@ -502,7 +502,7 @@ public final class GT_MusicSystem { final int baublesSize = baubles.getSizeInventory(); for (int i = 0; i < baublesSize; i++) { final ItemStack item = baubles.getStackInSlot(i); - if (item != null && item.getItem() instanceof GT_WirelessHeadphones headphones) { + if (item != null && item.getItem() instanceof ItemWirelessHeadphones headphones) { final UUID id = headphones.getBoundJukeboxUUID(item); if (id != null) { wornHeadphones.add(id); @@ -593,7 +593,7 @@ public final class GT_MusicSystem { final long pauseDurationMs = now - pauseTimeMs; // We manipulate server state here, because we've checked this is singleplayer pausing. - GT_MusicSystem.ServerSystem.onPauseMs(pauseDurationMs); + GTMusicSystem.ServerSystem.onPauseMs(pauseDurationMs); musicSources.forEach((uuid, source) -> { source.startedPlayingAtMs += pauseDurationMs; }); activelyPlayingMusic.forEach((uuid, data) -> { data.originalStartTime += pauseDurationMs; @@ -626,7 +626,7 @@ public final class GT_MusicSystem { try { final ArrayList<URL> candidates = Collections.list( - GT_MusicSystem.class.getClassLoader() + GTMusicSystem.class.getClassLoader() .getResources("soundmeta/durations.json")); final Path configPath = Loader.instance() .getConfigDir() @@ -652,7 +652,7 @@ public final class GT_MusicSystem { .intValue()); } } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.error("Could not parse sound durations from {}", url, e); + GTMod.GT_FML_LOGGER.error("Could not parse sound durations from {}", url, e); } } } catch (IOException e) { diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GTOreDictUnificator.java index 82c14f2aeb..6168b03211 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GTOreDictUnificator.java @@ -1,8 +1,8 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.GTValues.E; +import static gregtech.api.enums.GTValues.M; +import static gregtech.api.enums.GTValues.W; import java.util.ArrayList; import java.util.Collections; @@ -18,12 +18,12 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; @@ -34,25 +34,25 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; * <p/> * This is the Core of my OreDict Unification Code * <p/> - * If you just want to use this to unificate your Items, then use the Function in the GregTech_API File + * If you just want to use this to unificate your Items, then use the Function in the GregTechAPI File * <p/> * P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome. */ -public class GT_OreDictUnificator { +public class GTOreDictUnificator { private static final Map<String, ItemStack> sName2StackMap = new HashMap<>(); private static final Map<ItemStack, ItemData> sItemStack2DataMap = new Object2ObjectOpenCustomHashMap<>( - GT_ItemStack.ITEMSTACK_HASH_STRATEGY2); + GTItemStack.ITEMSTACK_HASH_STRATEGY2); private static final Map<ItemStack, List<ItemStack>> sUnificationTable = new Object2ObjectOpenCustomHashMap<>( - GT_ItemStack.ITEMSTACK_HASH_STRATEGY2); + GTItemStack.ITEMSTACK_HASH_STRATEGY2); private static final Set<ItemStack> sNoUnificationList = new ObjectOpenCustomHashSet<>( - GT_ItemStack.ITEMSTACK_HASH_STRATEGY2); + GTItemStack.ITEMSTACK_HASH_STRATEGY2); private static int isRegisteringOre = 0, isAddingOre = 0; private static boolean mRunThroughTheList = true; static { - GregTech_API.sItemStackMappings.add(sItemStack2DataMap); - GregTech_API.sItemStackMappings.add(sUnificationTable); + GregTechAPI.sItemStackMappings.add(sItemStack2DataMap); + GregTechAPI.sItemStackMappings.add(sUnificationTable); } /** @@ -60,12 +60,12 @@ public class GT_OreDictUnificator { * the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes. */ public static void addToBlacklist(ItemStack aStack) { - if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInStackSet(aStack, sNoUnificationList)) + if (GTUtility.isStackValid(aStack) && !GTUtility.isStackInStackSet(aStack, sNoUnificationList)) sNoUnificationList.add(aStack); } public static boolean isBlacklisted(ItemStack aStack) { - return GT_Utility.isStackInStackSet(aStack, sNoUnificationList); + return GTUtility.isStackInStackSet(aStack, sNoUnificationList); } public static void add(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack) { @@ -79,13 +79,13 @@ public class GT_OreDictUnificator { public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite, boolean aAlreadyRegistered) { if (aMaterial == null || aPrefix == null - || GT_Utility.isStackInvalid(aStack) + || GTUtility.isStackInvalid(aStack) || Items.feather.getDamage(aStack) == W) return; isAddingOre++; - aStack = GT_Utility.copyAmount(1, aStack); + aStack = GTUtility.copyAmount(1, aStack); if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); - if (aOverwrite || GT_Utility.isStackInvalid( + if (aOverwrite || GTUtility.isStackInvalid( sName2StackMap.get( aPrefix.get(aMaterial) .toString()))) @@ -97,10 +97,10 @@ public class GT_OreDictUnificator { } public static ItemStack getFirstOre(Object aName, long aAmount) { - if (GT_Utility.isStringInvalid(aName)) return null; + if (GTUtility.isStringInvalid(aName)) return null; ItemStack tStack = sName2StackMap.get(aName.toString()); - if (GT_Utility.isStackValid(tStack)) return GT_Utility.copyAmount(aAmount, tStack); - return GT_Utility.copyAmount(aAmount, getOresImmutable(aName).toArray()); + if (GTUtility.isStackValid(tStack)) return GTUtility.copyAmount(aAmount, tStack); + return GTUtility.copyAmount(aAmount, getOresImmutable(aName).toArray()); } public static ItemStack get(Object aName, long aAmount) { @@ -131,24 +131,24 @@ public class GT_OreDictUnificator { boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && aAmount < 1) return null; final ItemStack stackFromName = sName2StackMap.get(aName.toString()); - if (stackFromName != null) return GT_Utility.copyAmount(aAmount, stackFromName); + if (stackFromName != null) return GTUtility.copyAmount(aAmount, stackFromName); if (aMentionPossibleTypos) { - GT_Log.err.println("Unknown Key for Unification, Typo? " + aName); + GTLog.err.println("Unknown Key for Unification, Typo? " + aName); } final ItemStack stackFirstOre = getFirstOre(aName, aAmount); - if (stackFirstOre != null) return GT_Utility.copyAmount(aAmount, stackFirstOre); - return GT_Utility.copyAmount(aAmount, aReplacement); + if (stackFirstOre != null) return GTUtility.copyAmount(aAmount, stackFirstOre); + return GTUtility.copyAmount(aAmount, aReplacement); } public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) { - for (int i = 0; i < aStacks.length; i++) aStacks[i] = get(aUseBlackList, GT_Utility.copyOrNull(aStacks[i])); + for (int i = 0; i < aStacks.length; i++) aStacks[i] = get(aUseBlackList, GTUtility.copyOrNull(aStacks[i])); return aStacks; } public static ItemStack[] getStackArray(boolean aUseBlackList, Object... aStacks) { ItemStack[] rStacks = new ItemStack[aStacks.length]; for (int i = 0; i < aStacks.length; i++) { - rStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i]), true); + rStacks[i] = get(aUseBlackList, GTUtility.copy(aStacks[i]), true); } return rStacks; } @@ -158,9 +158,9 @@ public class GT_OreDictUnificator { } public static ItemStack setStack(boolean aUseBlackList, ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return aStack; + if (GTUtility.isStackInvalid(aStack)) return aStack; ItemStack tStack = get(aUseBlackList, aStack); - if (GT_Utility.areStacksEqual(aStack, tStack)) return aStack; + if (GTUtility.areStacksEqual(aStack, tStack)) return aStack; aStack.func_150996_a(tStack.getItem()); Items.feather.setDamage(aStack, Items.feather.getDamage(tStack)); return aStack; @@ -178,23 +178,23 @@ public class GT_OreDictUnificator { * @param unsafe If true, it does not limit stack size by 64. */ public static ItemStack get(boolean aUseBlackList, ItemStack aStack, boolean unsafe) { - if (GT_Utility.isStackInvalid(aStack)) return null; + if (GTUtility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copyOrNull(aStack); - if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { + || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GTUtility.copyOrNull(aStack); + if (aUseBlackList && !GregTechAPI.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; - return GT_Utility.copyOrNull(aStack); + return GTUtility.copyOrNull(aStack); } if (tPrefixMaterial.mUnificationTarget == null) tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); ItemStack rStack = tPrefixMaterial.mUnificationTarget; - if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copyOrNull(aStack); + if (GTUtility.isStackInvalid(rStack)) return GTUtility.copyOrNull(aStack); ItemStack newStack; if (unsafe) { - newStack = GT_Utility.copyAmountUnsafe(aStack.stackSize, rStack); + newStack = GTUtility.copyAmountUnsafe(aStack.stackSize, rStack); } else { - newStack = GT_Utility.copyAmount(aStack.stackSize, rStack); + newStack = GTUtility.copyAmount(aStack.stackSize, rStack); } // NBT is assigned by reference here, so mutating it may have unexpected side effects. newStack.setTagCompound(aStack.getTagCompound()); @@ -214,18 +214,18 @@ public class GT_OreDictUnificator { * comparisons */ static ItemStack get_nocopy(boolean aUseBlackList, ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return null; + if (GTUtility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed)) return aStack; - if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { + if (aUseBlackList && !GregTechAPI.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return aStack; } if (tPrefixMaterial.mUnificationTarget == null) tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); ItemStack rStack = tPrefixMaterial.mUnificationTarget; - if (GT_Utility.isStackInvalid(rStack)) return aStack; + if (GTUtility.isStackInvalid(rStack)) return aStack; // Yes, == and not .equals(). // This check is primarily intended to optimize for the case where both rStack and aStack @@ -255,7 +255,7 @@ public class GT_OreDictUnificator { * false. */ public static boolean isInputStackEqual(ItemStack aStack, ItemStack unified_tStack) { - if (GT_Utility.isStackInvalid(aStack)) return false; + if (GTUtility.isStackInvalid(aStack)) return false; return isInputStackEqual(aStack, getAssociation(aStack), unified_tStack); } @@ -265,25 +265,25 @@ public class GT_OreDictUnificator { */ public static boolean isInputStackEqual(ItemStack aStack, ItemData aStackPrefixData, ItemStack unified_tStack) { boolean alreadyCompared = false; - if (GT_Utility.isStackInvalid(aStack)) return false; + if (GTUtility.isStackInvalid(aStack)) return false; ItemStack rStack = null; if (aStackPrefixData == null || !aStackPrefixData.hasValidPrefixMaterialData()) - return GT_Utility.areStacksEqual(aStack, unified_tStack, true); + return GTUtility.areStacksEqual(aStack, unified_tStack, true); else if (aStackPrefixData.mBlackListed) { - if (GT_Utility.areStacksEqual(aStack, unified_tStack, true)) return true; + if (GTUtility.areStacksEqual(aStack, unified_tStack, true)) return true; else alreadyCompared = true; } - if (!alreadyCompared && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { + if (!alreadyCompared && !GregTechAPI.sUnificationEntriesRegistered && isBlacklisted(aStack)) { aStackPrefixData.mBlackListed = true; - if (GT_Utility.areStacksEqual(aStack, unified_tStack, true)) return true; + if (GTUtility.areStacksEqual(aStack, unified_tStack, true)) return true; else alreadyCompared = true; } if (aStackPrefixData.mUnificationTarget == null) aStackPrefixData.mUnificationTarget = sName2StackMap.get(aStackPrefixData.toString()); rStack = aStackPrefixData.mUnificationTarget; - if (GT_Utility.isStackInvalid(rStack)) - return !alreadyCompared && GT_Utility.areStacksEqual(aStack, unified_tStack, true); - return GT_Utility.areStacksEqual(rStack, unified_tStack, true); + if (GTUtility.isStackInvalid(rStack)) + return !alreadyCompared && GTUtility.areStacksEqual(aStack, unified_tStack, true); + return GTUtility.areStacksEqual(rStack, unified_tStack, true); } public static List<ItemStack> getNonUnifiedStacks(Object obj) { @@ -293,9 +293,9 @@ public class GT_OreDictUnificator { synchronized (sUnificationTable) { if (sUnificationTable.isEmpty() && !sItemStack2DataMap.isEmpty()) { for (ItemStack tGTStack0 : sItemStack2DataMap.keySet()) { - ItemStack tStack0 = GT_ItemStack.internalCopyStack(tGTStack0); + ItemStack tStack0 = GTItemStack.internalCopyStack(tGTStack0); ItemStack tStack1 = get_nocopy(false, tStack0); - if (!GT_Utility.areStacksEqual(tStack0, tStack1)) { + if (!GTUtility.areStacksEqual(tStack0, tStack1)) { List<ItemStack> list = sUnificationTable.computeIfAbsent(tStack1, k -> new ArrayList<>()); // greg's original code tries to dedupe the list using List#contains, which won't work // on vanilla ItemStack. I removed it since it never worked and can be slow. @@ -316,7 +316,7 @@ public class GT_OreDictUnificator { List<ItemStack> tList = sUnificationTable.get(aStack); if (tList != null) { for (ItemStack tStack : tList) { - ItemStack tStack1 = GT_Utility.copyAmount(aStack.stackSize, tStack); + ItemStack tStack1 = GTUtility.copyAmount(aStack.stackSize, tStack); rList.add(tStack1); } } @@ -325,7 +325,7 @@ public class GT_OreDictUnificator { } public static void addItemData(ItemStack aStack, ItemData aData) { - if (GT_Utility.isStackValid(aStack) && getItemData(aStack) == null && aData != null) setItemData(aStack, aData); + if (GTUtility.isStackValid(aStack) && getItemData(aStack) == null && aData != null) setItemData(aStack, aData); } public static void addItemDataFromInputs(ItemStack output, Object... inputs) { @@ -333,20 +333,20 @@ public class GT_OreDictUnificator { ItemData[] tData = new ItemData[length]; for (int i = 0; i < length; i++) { if (inputs[i] instanceof ItemStack) { - tData[i] = GT_OreDictUnificator.getItemData((ItemStack) inputs[i]); + tData[i] = GTOreDictUnificator.getItemData((ItemStack) inputs[i]); } else if (inputs[i] instanceof ItemData) { tData[i] = (ItemData) inputs[i]; } else { throw new IllegalArgumentException(); } } - if (GT_Utility.arrayContainsNonNull(tData)) { - GT_OreDictUnificator.addItemData(output, new ItemData(tData)); + if (GTUtility.arrayContainsNonNull(tData)) { + GTOreDictUnificator.addItemData(output, new ItemData(tData)); } } public static void setItemData(ItemStack aStack, ItemData aData) { - if (GT_Utility.isStackInvalid(aStack) || aData == null) return; + if (GTUtility.isStackInvalid(aStack) || aData == null) return; ItemData tData = getItemData(aStack); if (tData == null || !tData.hasValidPrefixMaterialData()) { if (tData != null) for (Object tObject : tData.mExtraData) @@ -354,7 +354,7 @@ public class GT_OreDictUnificator { if (aStack.stackSize > 1) { if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize; for (MaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize; - aStack = GT_Utility.copyAmount(1, aStack); + aStack = GTUtility.copyAmount(1, aStack); } sItemStack2DataMap.put(aStack, aData); if (aData.hasValidMaterialData()) { @@ -363,20 +363,20 @@ public class GT_OreDictUnificator { for (MaterialStack tMaterial : aData.mByProducts) tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; - if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack); + if (tValidMaterialAmount < M) GTModHandler.addToRecyclerBlackList(aStack); } if (mRunThroughTheList) { - if (GregTech_API.sLoadStarted) { + if (GregTechAPI.sLoadStarted) { mRunThroughTheList = false; for (Entry<ItemStack, ItemData> tEntry : sItemStack2DataMap.entrySet()) if (!tEntry.getValue() .hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling) - GT_RecipeRegistrator.registerMaterialRecycling( - GT_ItemStack.internalCopyStack(tEntry.getKey()), + GTRecipeRegistrator.registerMaterialRecycling( + GTItemStack.internalCopyStack(tEntry.getKey()), tEntry.getValue()); } } else { if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) - GT_RecipeRegistrator.registerMaterialRecycling(aStack, aData); + GTRecipeRegistrator.registerMaterialRecycling(aStack, aData); } } else { for (Object tObject : aData.mExtraData) @@ -385,7 +385,7 @@ public class GT_OreDictUnificator { } public static void removeItemData(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) { + if (GTUtility.isStackInvalid(aStack)) { return; } sItemStack2DataMap.remove(aStack); @@ -393,18 +393,18 @@ public class GT_OreDictUnificator { public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aBlackListed) { - if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return; + if (aPrefix == null || aMaterial == null || GTUtility.isStackInvalid(aStack)) return; if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++) - setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); + setItemData(GTUtility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); setItemData(aStack, new ItemData(aPrefix, aMaterial, aBlackListed)); } @Nullable public static ItemData getItemData(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return null; + if (GTUtility.isStackInvalid(aStack)) return null; ItemData rData = sItemStack2DataMap.get(aStack); if (rData == null) { // Try the lookup again but with wildcard damage value - rData = sItemStack2DataMap.get(GT_ItemStack.internalCopyStack(aStack, true)); + rData = sItemStack2DataMap.get(GTItemStack.internalCopyStack(aStack, true)); } return rData; } @@ -416,14 +416,14 @@ public class GT_OreDictUnificator { } public static boolean isItemStackInstanceOf(ItemStack aStack, Object aName) { - if (GT_Utility.isStringInvalid(aName) || GT_Utility.isStackInvalid(aStack)) return false; + if (GTUtility.isStringInvalid(aName) || GTUtility.isStackInvalid(aStack)) return false; for (ItemStack tOreStack : getOresImmutable(aName.toString())) - if (GT_Utility.areStacksEqual(tOreStack, aStack, true)) return true; + if (GTUtility.areStacksEqual(tOreStack, aStack, true)) return true; return false; } public static boolean isItemStackDye(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return false; + if (GTUtility.isStackInvalid(aStack)) return false; for (Dyes tDye : Dyes.VALUES) if (isItemStackInstanceOf(aStack, tDye.toString())) return true; @@ -435,17 +435,17 @@ public class GT_OreDictUnificator { } public static boolean registerOre(Object aName, ItemStack aStack) { - if (aName == null || GT_Utility.isStackInvalid(aStack)) return false; + if (aName == null || GTUtility.isStackInvalid(aStack)) return false; String tName = aName.toString(); - if (GT_Utility.isStringInvalid(tName)) return false; + if (GTUtility.isStringInvalid(tName)) return false; for (ItemStack itemStack : getOresImmutable(tName)) - if (GT_Utility.areStacksEqual(itemStack, aStack, true)) return false; + if (GTUtility.areStacksEqual(itemStack, aStack, true)) return false; isRegisteringOre++; - OreDictionary.registerOre(tName, GT_Utility.copyAmount(1, aStack)); + OreDictionary.registerOre(tName, GTUtility.copyAmount(1, aStack)); isRegisteringOre--; return true; } @@ -561,7 +561,7 @@ public class GT_OreDictUnificator { public static ArrayList<ItemStack> getOres(Object aOreName) { String aName = aOreName == null ? E : aOreName.toString(); ArrayList<ItemStack> rList = new ArrayList<>(); - if (GT_Utility.isStringValid(aName)) rList.addAll(OreDictionary.getOres(aName)); + if (GTUtility.isStringValid(aName)) rList.addAll(OreDictionary.getOres(aName)); return rList; } @@ -572,7 +572,7 @@ public class GT_OreDictUnificator { public static List<ItemStack> getOresImmutable(@Nullable Object aOreName) { String aName = aOreName == null ? E : aOreName.toString(); - return GT_Utility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName)) + return GTUtility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName)) : Collections.emptyList(); } } diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GTPlayedSound.java index 8604d9b81f..0b527136b3 100644 --- a/src/main/java/gregtech/api/util/GT_PlayedSound.java +++ b/src/main/java/gregtech/api/util/GTPlayedSound.java @@ -2,12 +2,12 @@ package gregtech.api.util; import net.minecraft.util.ResourceLocation; -public class GT_PlayedSound { +public class GTPlayedSound { public final String mSoundName; public final int mX, mY, mZ; - public GT_PlayedSound(ResourceLocation aSoundResourceLocation, double aX, double aY, double aZ) { + public GTPlayedSound(ResourceLocation aSoundResourceLocation, double aX, double aY, double aZ) { mSoundName = aSoundResourceLocation.toString(); mX = (int) aX; mY = (int) aY; @@ -16,10 +16,10 @@ public class GT_PlayedSound { @Override public boolean equals(Object aObject) { - if (aObject instanceof GT_PlayedSound) { - return ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY - && ((GT_PlayedSound) aObject).mZ == mZ - && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); + if (aObject instanceof GTPlayedSound) { + return ((GTPlayedSound) aObject).mX == mX && ((GTPlayedSound) aObject).mY == mY + && ((GTPlayedSound) aObject).mZ == mZ + && ((GTPlayedSound) aObject).mSoundName.equals(mSoundName); } return false; } diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GTRecipe.java index c0812dcaef..7aa3dfbdfb 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GTRecipe.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.D2; +import static gregtech.api.enums.GTValues.D2; import java.util.ArrayList; import java.util.Arrays; @@ -22,16 +22,16 @@ import org.jetbrains.annotations.NotNull; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.logic.FluidInventoryLogic; import gregtech.api.logic.ItemInventoryLogic; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.metatileentity.implementations.MTEHatchInput; +import gregtech.api.metatileentity.implementations.MTEHatchInputBus; +import gregtech.api.metatileentity.implementations.MTEHatchMultiInput; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeCategory; import gregtech.api.recipe.RecipeMap; @@ -41,8 +41,9 @@ import gregtech.api.recipe.metadata.EmptyRecipeMetadataStorage; import gregtech.api.recipe.metadata.IRecipeMetadataStorage; import gregtech.api.util.extensions.ArrayExt; import gregtech.api.util.item.ItemHolder; -import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_InputBus_ME; -import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Input_ME; +import gregtech.common.tileentities.machines.MTEHatchInputBusME; +import gregtech.common.tileentities.machines.MTEHatchInputME; +import gregtech.nei.GTNEIDefaultHandler; import ic2.core.Ic2Items; import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -50,7 +51,7 @@ import it.unimi.dsi.fastutil.objects.Reference2LongArrayMap; import it.unimi.dsi.fastutil.objects.Reference2LongMap; import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap; -public class GT_Recipe implements Comparable<GT_Recipe> { +public class GTRecipe implements Comparable<GTRecipe> { private static ItemStack dataStick; private static ItemStack dataOrb; @@ -155,12 +156,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public RecipeItemInput(ItemStack stack, boolean recipeIsNBTSensitive) { Objects.requireNonNull(stack); this.inputAmount = stack.stackSize; - final boolean stackNeedsNBT = GT_Recipe.shouldCheckNBT(stack); + final boolean stackNeedsNBT = GTRecipe.shouldCheckNBT(stack); this.usesNbtMatching = recipeIsNBTSensitive | stackNeedsNBT; if (stackNeedsNBT) { this.unifiedStack = stack; } else { - this.unifiedStack = GT_OreDictUnificator.get_nocopy(true, stack); + this.unifiedStack = GTOreDictUnificator.get_nocopy(true, stack); if (!this.usesNbtMatching) { this.unifiedStack.setTagCompound(null); } @@ -172,7 +173,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * {@link RecipeItemInput#usesNbtMatching}). */ public boolean matchesType(final ItemStack other) { - return GT_Utility.areStacksEqual(this.unifiedStack, other, !usesNbtMatching); + return GTUtility.areStacksEqual(this.unifiedStack, other, !usesNbtMatching); } /** @@ -180,20 +181,20 @@ public class GT_Recipe implements Comparable<GT_Recipe> { */ public boolean matchesRecipe(final ItemData oredictOther, final ItemStack other) { if (usesNbtMatching) { - return GT_Utility.areStacksEqual(this.unifiedStack, other, false); + return GTUtility.areStacksEqual(this.unifiedStack, other, false); } else { - return GT_OreDictUnificator.isInputStackEqual(other, oredictOther, unifiedStack); + return GTOreDictUnificator.isInputStackEqual(other, oredictOther, unifiedStack); } } } - private GT_Recipe(GT_Recipe aRecipe, boolean shallow) { - mInputs = shallow ? aRecipe.mInputs : GT_Utility.copyItemArray(aRecipe.mInputs); - mOutputs = shallow ? aRecipe.mOutputs : GT_Utility.copyItemArray(aRecipe.mOutputs); + private GTRecipe(GTRecipe aRecipe, boolean shallow) { + mInputs = shallow ? aRecipe.mInputs : GTUtility.copyItemArray(aRecipe.mInputs); + mOutputs = shallow ? aRecipe.mOutputs : GTUtility.copyItemArray(aRecipe.mOutputs); mSpecialItems = aRecipe.mSpecialItems; mChances = aRecipe.mChances; - mFluidInputs = shallow ? aRecipe.mFluidInputs : GT_Utility.copyFluidArray(aRecipe.mFluidInputs); - mFluidOutputs = shallow ? aRecipe.mFluidOutputs : GT_Utility.copyFluidArray(aRecipe.mFluidOutputs); + mFluidInputs = shallow ? aRecipe.mFluidInputs : GTUtility.copyFluidArray(aRecipe.mFluidInputs); + mFluidOutputs = shallow ? aRecipe.mFluidOutputs : GTUtility.copyFluidArray(aRecipe.mFluidOutputs); mDuration = aRecipe.mDuration; mSpecialValue = aRecipe.mSpecialValue; mEUt = aRecipe.mEUt; @@ -209,9 +210,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } /** - * Only for {@link GT_RecipeBuilder}. + * Only for {@link GTRecipeBuilder}. */ - GT_Recipe(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, FluidStack[] mFluidOutputs, + GTRecipe(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, boolean nbtSensitive, String[] neiDesc, @Nullable IRecipeMetadataStorage metadataStorage, RecipeCategory recipeCategory) { @@ -237,7 +238,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { reloadOwner(); } - public GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, + public GTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { if (aInputs == null) aInputs = new ItemStack[0]; if (aOutputs == null) aOutputs = new ItemStack[0]; @@ -251,10 +252,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> { aFluidInputs = ArrayExt.withoutNulls(aFluidInputs, FluidStack[]::new); aFluidOutputs = ArrayExt.withoutNulls(aFluidOutputs, FluidStack[]::new); - GT_OreDictUnificator.setStackArray(true, aInputs); - GT_OreDictUnificator.setStackArray(true, aOutputs); + GTOreDictUnificator.setStackArray(true, aInputs); + GTOreDictUnificator.setStackArray(true, aOutputs); - for (ItemStack tStack : aOutputs) GT_Utility.updateItemStack(tStack); + for (ItemStack tStack : aOutputs) GTUtility.updateItemStack(tStack); for (int i = 0; i < aChances.length; i++) if (aChances[i] <= 0) aChances[i] = 10000; for (int i = 0; i < aFluidInputs.length; i++) aFluidInputs[i] = aFluidInputs[i].copy(); @@ -304,7 +305,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! - public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, + public GTRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) { this( true, @@ -348,8 +349,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } - // Dummy GT_Recipe maker... - public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, + // Dummy GTRecipe maker... + public GTRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { this( true, @@ -368,7 +369,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * Re-unificates all the items present in recipes. */ public static void reInit() { - GT_Log.out.println("GT_Mod: Re-Unificating Recipes."); + GTLog.out.println("GTMod: Re-Unificating Recipes."); for (RecipeMap<?> map : RecipeMap.ALL_RECIPE_MAPS.values()) { map.getBackend() .reInit(); @@ -377,19 +378,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public ItemStack getRepresentativeInput(int aIndex) { if (aIndex < 0 || aIndex >= mInputs.length) return null; - return GT_Utility.copyOrNull(mInputs[aIndex]); + return GTUtility.copyOrNull(mInputs[aIndex]); } public ItemStack getOutput(int aIndex) { if (aIndex < 0 || aIndex >= mOutputs.length) return null; - return GT_Utility.copyOrNull(mOutputs[aIndex]); + return GTUtility.copyOrNull(mOutputs[aIndex]); } /** * Dictates the ItemStacks displayed in the output slots of any NEI page handled by the default GT NEI handler. - * Override to make shown items differ from a GT_Recipe's item output array + * Override to make shown items differ from a GTRecipe's item output array * - * @see gregtech.nei.GT_NEI_DefaultHandler + * @see GTNEIDefaultHandler * @param i Slot index * @return ItemStack to be displayed in the slot */ @@ -416,28 +417,28 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public void checkCellBalance() { if (!D2 || mInputs.length < 1) return; - int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mInputs); - int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mOutputs); + int tInputAmount = GTModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mInputs); + int tOutputAmount = GTModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mOutputs); if (tInputAmount < tOutputAmount) { if (!Materials.Tin.contains(mInputs)) { - GT_Log.err.println("You get more Cells, than you put in? There must be something wrong."); - new Exception().printStackTrace(GT_Log.err); + GTLog.err.println("You get more Cells, than you put in? There must be something wrong."); + new Exception().printStackTrace(GTLog.err); } } else if (tInputAmount > tOutputAmount) { if (!Materials.Tin.contains(mOutputs)) { - GT_Log.err.println("You get less Cells, than you put in? GT Machines usually don't destroy Cells."); - new Exception().printStackTrace(GT_Log.err); + GTLog.err.println("You get less Cells, than you put in? GT Machines usually don't destroy Cells."); + new Exception().printStackTrace(GTLog.err); } } } - public GT_Recipe copy() { - return new GT_Recipe(this, false); + public GTRecipe copy() { + return new GTRecipe(this, false); } - public GT_Recipe copyShallow() { - return new GT_Recipe(this, true); + public GTRecipe copyShallow() { + return new GTRecipe(this, true); } public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, @@ -511,7 +512,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } final RecipeItemInput[] frozenCache = newCache.toArray(new RecipeItemInput[0]); - if (GregTech_API.sFullLoadFinished) { + if (GregTechAPI.sFullLoadFinished) { mergedInputCache = frozenCache; } return frozenCache; @@ -569,7 +570,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { final ItemData[] unifiedProvidedInputs = new ItemData[aInputs.length]; for (int i = 0; i < aInputs.length; i++) { - unifiedProvidedInputs[i] = GT_OreDictUnificator.getAssociation(aInputs[i]); + unifiedProvidedInputs[i] = GTOreDictUnificator.getAssociation(aInputs[i]); } final @NotNull RecipeItemInput @NotNull [] combinedInputs = getCachedCombinedItemInputs(); @@ -645,7 +646,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } final ItemData[] unifiedProvidedInputs = new ItemData[aInputs.length]; for (int i = 0; i < aInputs.length; i++) { - unifiedProvidedInputs[i] = GT_OreDictUnificator.getAssociation(aInputs[i]); + unifiedProvidedInputs[i] = GTOreDictUnificator.getAssociation(aInputs[i]); } recipeItemLoop: for (final RecipeItemInput combinedInput : combinedInputs) { @@ -679,9 +680,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { */ private static boolean shouldCheckNBT(ItemStack item) { if (GTppRecipeHelper) { - return GT_Utility.areStacksEqual(item, ic2FluidCell, true) - || GT_Utility.areStacksEqual(item, dataStick, true) - || GT_Utility.areStacksEqual(item, dataOrb, true); + return GTUtility.areStacksEqual(item, ic2FluidCell, true) || GTUtility.areStacksEqual(item, dataStick, true) + || GTUtility.areStacksEqual(item, dataOrb, true); } return false; } @@ -741,7 +741,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } @Override - public int compareTo(GT_Recipe recipe) { + public int compareTo(GTRecipe recipe) { // first lowest tier recipes // then fastest // then with lowest special value @@ -809,7 +809,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } /** - * Exists only for recipe copying from external. For ordinal use case, use {@link GT_RecipeBuilder#recipeCategory}. + * Exists only for recipe copying from external. For ordinal use case, use {@link GTRecipeBuilder#recipeCategory}. */ public void setRecipeCategory(RecipeCategory recipeCategory) { this.recipeCategory = recipeCategory; @@ -822,18 +822,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { "gregtech.api.recipe.RecipeMap", "gregtech.api.recipe.RecipeMapBackend", "gregtech.api.recipe.RecipeMapBackendPropertiesBuilder", - "gregtech.api.util.GT_Recipe", - "gregtech.api.util.GT_RecipeBuilder", - "gregtech.api.util.GT_RecipeConstants", - "gregtech.api.util.GT_RecipeMapUtil", - "gregtech.common.GT_RecipeAdder"); + "gregtech.api.util.GTRecipe", + "gregtech.api.util.GTRecipeBuilder", + "gregtech.api.util.GTRecipeConstants", + "gregtech.api.util.GTRecipeMapUtil", + "gregtech.common.GTRecipeAdder"); public void reloadOwner() { setOwner( Loader.instance() .activeModContainer()); - if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace) { + if (GTMod.gregtechproxy.mNEIRecipeOwnerStackTrace) { List<String> toAdd = new ArrayList<>(); for (StackTraceElement stackTrace : Thread.currentThread() .getStackTrace()) { @@ -881,54 +881,54 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } - public GT_Recipe setInputs(ItemStack... aInputs) { + public GTRecipe setInputs(ItemStack... aInputs) { // TODO determine if we need this without trailing nulls call this.mInputs = ArrayExt.withoutTrailingNulls(aInputs, ItemStack[]::new); return this; } - public GT_Recipe setOutputs(ItemStack... aOutputs) { + public GTRecipe setOutputs(ItemStack... aOutputs) { this.mOutputs = ArrayExt.withoutTrailingNulls(aOutputs, ItemStack[]::new); return this; } - public GT_Recipe setFluidInputs(FluidStack... aInputs) { + public GTRecipe setFluidInputs(FluidStack... aInputs) { this.mFluidInputs = ArrayExt.withoutTrailingNulls(aInputs, FluidStack[]::new); return this; } - public GT_Recipe setFluidOutputs(FluidStack... aOutputs) { + public GTRecipe setFluidOutputs(FluidStack... aOutputs) { this.mFluidOutputs = ArrayExt.withoutTrailingNulls(aOutputs, FluidStack[]::new); return this; } - public GT_Recipe setDuration(int aDuration) { + public GTRecipe setDuration(int aDuration) { this.mDuration = aDuration; return this; } - public GT_Recipe setEUt(int aEUt) { + public GTRecipe setEUt(int aEUt) { this.mEUt = aEUt; return this; } - public static class GT_Recipe_AssemblyLine { + public static class RecipeAssemblyLine { - public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<>(); + public static final ArrayList<RecipeAssemblyLine> sAssemblylineRecipes = new ArrayList<>(); static { if (!Boolean.getBoolean("com.gtnh.gt5u.ignore-invalid-assline-recipe")) - GregTech_API.sFirstWorldTick.add(GT_Recipe_AssemblyLine::checkInvalidRecipes); - else GT_Log.out.println("NOT CHECKING INVALID ASSLINE RECIPE."); + GregTechAPI.sFirstWorldTick.add(RecipeAssemblyLine::checkInvalidRecipes); + else GTLog.out.println("NOT CHECKING INVALID ASSLINE RECIPE."); } private static void checkInvalidRecipes() { int invalidCount = 0; - GT_Log.out.println("Started assline validation"); - for (GT_Recipe_AssemblyLine recipe : sAssemblylineRecipes) { + GTLog.out.println("Started assline validation"); + for (RecipeAssemblyLine recipe : sAssemblylineRecipes) { if (recipe.getPersistentHash() == 0) { invalidCount++; - GT_Log.err.printf("Invalid recipe: %s%n", recipe); + GTLog.err.printf("Invalid recipe: %s%n", recipe); } } if (invalidCount > 0) throw new RuntimeException( @@ -950,7 +950,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * <p> * if you set one yourself, it will give you one of the RunetimeExceptions! */ - public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, + public RecipeAssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { this( aResearchItem, @@ -963,11 +963,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> { new ItemStack[aInputs.length][]); int tPersistentHash = 1; for (ItemStack tInput : aInputs) - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tInput, true, false); - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aResearchItem, true, false); - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aOutput, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(tInput, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(aResearchItem, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(aOutput, true, false); for (FluidStack tFluidInput : aFluidInputs) - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tFluidInput, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(tFluidInput, true, false); tPersistentHash = tPersistentHash * 31 + aResearchTime; tPersistentHash = tPersistentHash * 31 + aDuration; tPersistentHash = tPersistentHash * 31 + aEUt; @@ -979,7 +979,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * <p> * if you don't set one yourself, it will break a lot of stuff! */ - public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, + public RecipeAssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) { mResearchItem = aResearchItem; mResearchTime = aResearchTime; @@ -995,16 +995,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public int hashCode() { final int prime = 31; int result = 1; - GT_ItemStack[] thisInputs = new GT_ItemStack[this.mInputs.length]; + GTItemStack[] thisInputs = new GTItemStack[this.mInputs.length]; int totalInputStackSize = 0; for (int i = 0; i < this.mInputs.length; i++) { - thisInputs[i] = new GT_ItemStack(this.mInputs[i]); + thisInputs[i] = new GTItemStack(this.mInputs[i]); totalInputStackSize += thisInputs[i].mStackSize; } int inputHash = Arrays.deepHashCode(thisInputs); int inputFluidHash = Arrays.deepHashCode(this.mFluidInputs); - GT_ItemStack thisOutput = new GT_ItemStack(mOutput); - GT_ItemStack thisResearch = new GT_ItemStack(mResearchItem); + GTItemStack thisOutput = new GTItemStack(mOutput); + GTItemStack thisResearch = new GTItemStack(mResearchItem); int miscRecipeDataHash = Arrays.deepHashCode( new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime }); result = prime * result + inputFluidHash; @@ -1018,7 +1018,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (this == obj) { return true; } - if (!(obj instanceof GT_Recipe_AssemblyLine other)) { + if (!(obj instanceof RecipeAssemblyLine other)) { return false; } if (this.mInputs.length != other.mInputs.length) { @@ -1028,23 +1028,23 @@ public class GT_Recipe implements Comparable<GT_Recipe> { return false; } // Check Outputs Match - GT_ItemStack output1 = new GT_ItemStack(this.mOutput); - GT_ItemStack output2 = new GT_ItemStack(other.mOutput); + GTItemStack output1 = new GTItemStack(this.mOutput); + GTItemStack output2 = new GTItemStack(other.mOutput); if (!output1.equals(output2)) { return false; } // Check Scanned Item Match - GT_ItemStack scan1 = new GT_ItemStack(this.mResearchItem); - GT_ItemStack scan2 = new GT_ItemStack(other.mResearchItem); + GTItemStack scan1 = new GTItemStack(this.mResearchItem); + GTItemStack scan2 = new GTItemStack(other.mResearchItem); if (!scan1.equals(scan2)) { return false; } // Check Items Match - GT_ItemStack[] thisInputs = new GT_ItemStack[this.mInputs.length]; - GT_ItemStack[] otherInputs = new GT_ItemStack[other.mInputs.length]; + GTItemStack[] thisInputs = new GTItemStack[this.mInputs.length]; + GTItemStack[] otherInputs = new GTItemStack[other.mInputs.length]; for (int i = 0; i < thisInputs.length; i++) { - thisInputs[i] = new GT_ItemStack(this.mInputs[i]); - otherInputs[i] = new GT_ItemStack(other.mInputs[i]); + thisInputs[i] = new GTItemStack(this.mInputs[i]); + otherInputs[i] = new GTItemStack(other.mInputs[i]); } for (int i = 0; i < thisInputs.length; i++) { if (!thisInputs[i].equals(otherInputs[i]) || thisInputs[i].mStackSize != otherInputs[i].mStackSize) { @@ -1064,13 +1064,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public int getPersistentHash() { if (mPersistentHash == 0) - GT_Log.err.println("Assline recipe persistent hash has not been set! Recipe: " + mOutput); + GTLog.err.println("Assline recipe persistent hash has not been set! Recipe: " + mOutput); return mPersistentHash; } @Override public String toString() { - return "GT_Recipe_AssemblyLine{" + "mResearchItem=" + return "GTRecipe_AssemblyLine{" + "mResearchItem=" + mResearchItem + ", mResearchTime=" + mResearchTime @@ -1106,16 +1106,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @return An array containing the amount of item to consume from the first slot of every input bus. * {@code null} if at least one item fails to match the recipe ingredient. */ - public static int[] getItemConsumptionAmountArray(ArrayList<GT_MetaTileEntity_Hatch_InputBus> inputBusses, - GT_Recipe_AssemblyLine recipe) { + public static int[] getItemConsumptionAmountArray(ArrayList<MTEHatchInputBus> inputBusses, + RecipeAssemblyLine recipe) { int itemCount = recipe.mInputs.length; if (itemCount == 0) return null; int[] tStacks = new int[itemCount]; for (int i = 0; i < itemCount; i++) { - GT_MetaTileEntity_Hatch_InputBus inputBus = inputBusses.get(i); + MTEHatchInputBus inputBus = inputBusses.get(i); if (!inputBus.isValid()) return null; ItemStack slotStack; - if (inputBus instanceof GT_MetaTileEntity_Hatch_InputBus_ME meBus) { + if (inputBus instanceof MTEHatchInputBusME meBus) { slotStack = meBus.getShadowItemStack(0); } else { slotStack = inputBus.getStackInSlot(0); @@ -1132,13 +1132,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { public static int getMatchedIngredientAmount(ItemStack aSlotStack, ItemStack aIngredient, ItemStack[] alts) { if (alts == null || alts.length == 0) { - if (GT_Utility.areStacksEqual(aSlotStack, aIngredient, true)) { + if (GTUtility.areStacksEqual(aSlotStack, aIngredient, true)) { return aIngredient.stackSize; } return -1; } for (ItemStack tAltStack : alts) { - if (GT_Utility.areStacksEqual(aSlotStack, tAltStack, true)) { + if (GTUtility.areStacksEqual(aSlotStack, tAltStack, true)) { return tAltStack.stackSize; } } @@ -1147,30 +1147,30 @@ public class GT_Recipe implements Comparable<GT_Recipe> { /** * @param inputBusses Input bus list to check. Usually the input bus list of multi. - * @param itemConsumptions Should be generated by {@link GT_Recipe_AssemblyLine#getItemConsumptionAmountArray}. + * @param itemConsumptions Should be generated by {@link RecipeAssemblyLine#getItemConsumptionAmountArray}. * @Return The number of parallel recipes, or 0 if recipe is not satisfied at all. 0 < number < 1 means that * inputs are found but not enough. */ - public static double maxParallelCalculatedByInputItems(ArrayList<GT_MetaTileEntity_Hatch_InputBus> inputBusses, - int maxParallel, int[] itemConsumptions, Map<GT_Utility.ItemId, ItemStack> inputsFromME) { + public static double maxParallelCalculatedByInputItems(ArrayList<MTEHatchInputBus> inputBusses, int maxParallel, + int[] itemConsumptions, Map<GTUtility.ItemId, ItemStack> inputsFromME) { // Recipe item matching is done in the generation of itemConsumptions. - Map<GT_Utility.ItemId, Long> itemConsumptionsFromME = new Object2LongOpenHashMap<>(); + Map<GTUtility.ItemId, Long> itemConsumptionsFromME = new Object2LongOpenHashMap<>(); double currentParallel = maxParallel; // Calculate the amount of each item to consume from ME for (int i = 0; i < itemConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_InputBus inputBus = inputBusses.get(i); + MTEHatchInputBus inputBus = inputBusses.get(i); if (!inputBus.isValid()) return 0; - if (inputBus instanceof GT_MetaTileEntity_Hatch_InputBus_ME meBus) { + if (inputBus instanceof MTEHatchInputBusME meBus) { ItemStack item = meBus.getShadowItemStack(0); if (item == null) return 0; - GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(item); + GTUtility.ItemId id = GTUtility.ItemId.createNoCopy(item); itemConsumptionsFromME.merge(id, (long) itemConsumptions[i], Long::sum); } } // Calculate parallel from ME input busses - for (Entry<GT_Utility.ItemId, Long> entry : itemConsumptionsFromME.entrySet()) { + for (Entry<GTUtility.ItemId, Long> entry : itemConsumptionsFromME.entrySet()) { if (!inputsFromME.containsKey(entry.getKey())) return 0; long consume = entry.getValue(); // For non-consumed inputs @@ -1182,9 +1182,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // Calculate parallel from regular input busses for (int i = 0; i < itemConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_InputBus inputBus = inputBusses.get(i); + MTEHatchInputBus inputBus = inputBusses.get(i); if (!inputBus.isValid()) return 0; - if (inputBus instanceof GT_MetaTileEntity_Hatch_InputBus_ME) continue; + if (inputBus instanceof MTEHatchInputBusME) continue; ItemStack item = inputBus.getStackInSlot(0); if (item == null) return 0; @@ -1202,19 +1202,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { * @return The number of parallel recipes, or 0 if recipe is not satisfied at all. 0 < number < 1 means that * fluids are found but not enough. */ - public static double maxParallelCalculatedByInputFluids(ArrayList<GT_MetaTileEntity_Hatch_Input> inputHatches, - int maxParallel, FluidStack[] fluidConsumptions, Map<Fluid, FluidStack> fluidsFromME) { + public static double maxParallelCalculatedByInputFluids(ArrayList<MTEHatchInput> inputHatches, int maxParallel, + FluidStack[] fluidConsumptions, Map<Fluid, FluidStack> fluidsFromME) { Map<Fluid, Long> fluidConsumptionsFromME = new Reference2LongOpenHashMap<>(); double currentParallel = maxParallel; // Calculate the amount of each fluid to consume from ME for (int i = 0; i < fluidConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_Input inputHatch = inputHatches.get(i); + MTEHatchInput inputHatch = inputHatches.get(i); if (!inputHatch.isValid()) return 0; - if (inputHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + if (inputHatch instanceof MTEHatchInputME meHatch) { FluidStack fluid = meHatch.getShadowFluidStack(0); if (fluid == null) return 0; - if (!GT_Utility.areFluidsEqual(fluid, fluidConsumptions[i])) return 0; + if (!GTUtility.areFluidsEqual(fluid, fluidConsumptions[i])) return 0; fluidConsumptionsFromME.merge(fluid.getFluid(), (long) fluidConsumptions[i].amount, Long::sum); } } @@ -1229,18 +1229,18 @@ public class GT_Recipe implements Comparable<GT_Recipe> { // Calculate parallel from regular input hatches for (int i = 0; i < fluidConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_Input inputHatch = inputHatches.get(i); + MTEHatchInput inputHatch = inputHatches.get(i); if (!inputHatch.isValid()) return 0; - if (inputHatch instanceof GT_MetaTileEntity_Hatch_Input_ME) continue; + if (inputHatch instanceof MTEHatchInputME) continue; FluidStack fluid; - if (inputHatch instanceof GT_MetaTileEntity_Hatch_MultiInput multiInput) { + if (inputHatch instanceof MTEHatchMultiInput multiInput) { fluid = multiInput.getFluid(0); } else { fluid = inputHatch.getFillableStack(); } if (fluid == null) return 0; - if (!GT_Utility.areFluidsEqual(fluid, fluidConsumptions[i])) return 0; + if (!GTUtility.areFluidsEqual(fluid, fluidConsumptions[i])) return 0; currentParallel = Math.min(currentParallel, (double) fluid.amount / fluidConsumptions[i].amount); if (currentParallel <= 0) return 0; } @@ -1249,19 +1249,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> { /** * WARNING: Ensure that item inputs are enough to be consumed with - * {@link GT_Recipe_AssemblyLine#maxParallelCalculatedByInputItems} before calling this method! + * {@link RecipeAssemblyLine#maxParallelCalculatedByInputItems} before calling this method! * * @param inputBusses Input bus list to check. Usually the input bus list of multi. - * @param itemConsumptions Should be generated by {@link GT_Recipe_AssemblyLine#getItemConsumptionAmountArray}. + * @param itemConsumptions Should be generated by {@link RecipeAssemblyLine#getItemConsumptionAmountArray}. */ - public static void consumeInputItems(ArrayList<GT_MetaTileEntity_Hatch_InputBus> inputBusses, - int amountMultiplier, int[] itemConsumptions, Map<GT_Utility.ItemId, ItemStack> inputsFromME) { + public static void consumeInputItems(ArrayList<MTEHatchInputBus> inputBusses, int amountMultiplier, + int[] itemConsumptions, Map<GTUtility.ItemId, ItemStack> inputsFromME) { for (int i = 0; i < itemConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_InputBus inputBus = inputBusses.get(i); + MTEHatchInputBus inputBus = inputBusses.get(i); if (!inputBus.isValid()) continue; ItemStack item; - if (inputBus instanceof GT_MetaTileEntity_Hatch_InputBus_ME meBus) { - item = inputsFromME.get(GT_Utility.ItemId.createNoCopy(meBus.getShadowItemStack(0))); + if (inputBus instanceof MTEHatchInputBusME meBus) { + item = inputsFromME.get(GTUtility.ItemId.createNoCopy(meBus.getShadowItemStack(0))); } else { item = inputBus.getStackInSlot(0); } @@ -1271,22 +1271,22 @@ public class GT_Recipe implements Comparable<GT_Recipe> { /** * WARNING: Ensure that fluid inputs are enough to be consumed with - * {@link GT_Recipe_AssemblyLine#maxParallelCalculatedByInputFluids} before calling this method! + * {@link RecipeAssemblyLine#maxParallelCalculatedByInputFluids} before calling this method! * * @param inputHatches Input hatch list to check. Usually the input hatch list of multi. * @param fluidConsumptions Fluid inputs of the recipe. */ - public static void consumeInputFluids(ArrayList<GT_MetaTileEntity_Hatch_Input> inputHatches, - int amountMultiplier, FluidStack[] fluidConsumptions, Map<Fluid, FluidStack> fluidsFromME) { + public static void consumeInputFluids(ArrayList<MTEHatchInput> inputHatches, int amountMultiplier, + FluidStack[] fluidConsumptions, Map<Fluid, FluidStack> fluidsFromME) { for (int i = 0; i < fluidConsumptions.length; i++) { - GT_MetaTileEntity_Hatch_Input inputHatch = inputHatches.get(i); + MTEHatchInput inputHatch = inputHatches.get(i); if (!inputHatch.isValid()) continue; FluidStack fluid; - if (inputHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + if (inputHatch instanceof MTEHatchInputME meHatch) { fluid = fluidsFromME.get( meHatch.getShadowFluidStack(0) .getFluid()); - } else if (inputHatch instanceof GT_MetaTileEntity_Hatch_MultiInput multiInput) { + } else if (inputHatch instanceof MTEHatchMultiInput multiInput) { fluid = multiInput.getFluid(0); } else { fluid = inputHatch.getFillableStack(); @@ -1296,14 +1296,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> { } } - public static class GT_Recipe_WithAlt extends GT_Recipe { + public static class GTRecipe_WithAlt extends GTRecipe { public ItemStack[][] mOreDictAlt; /** - * Only for {@link GT_RecipeBuilder}. + * Only for {@link GTRecipeBuilder}. */ - GT_Recipe_WithAlt(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, + GTRecipe_WithAlt(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, boolean nbtSensitive, String[] neiDesc, @@ -1331,7 +1331,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> { this.mOreDictAlt = mOreDictAlt; } - public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + public GTRecipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt) { super( @@ -1354,13 +1354,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (mOreDictAlt[aIndex] != null && mOreDictAlt[aIndex].length > 0) { ItemStack[] rStacks = new ItemStack[mOreDictAlt[aIndex].length]; for (int i = 0; i < mOreDictAlt[aIndex].length; i++) { - rStacks[i] = GT_Utility.copyOrNull(mOreDictAlt[aIndex][i]); + rStacks[i] = GTUtility.copyOrNull(mOreDictAlt[aIndex][i]); } return rStacks; } } if (aIndex >= mInputs.length) return null; - return GT_Utility.copyOrNull(mInputs[aIndex]); + return GTUtility.copyOrNull(mInputs[aIndex]); } } } diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GTRecipeBuilder.java index 137b7d6c86..6f8acfb2dc 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GTRecipeBuilder.java @@ -1,8 +1,8 @@ package gregtech.api.util; -import static gregtech.api.util.GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES; -import static gregtech.api.util.GT_Utility.copyFluidArray; -import static gregtech.api.util.GT_Utility.copyItemArray; +import static gregtech.api.util.GTRecipeMapUtil.SPECIAL_VALUE_ALIASES; +import static gregtech.api.util.GTUtility.copyFluidArray; +import static gregtech.api.util.GTUtility.copyItemArray; import java.util.ArrayList; import java.util.Arrays; @@ -22,8 +22,8 @@ import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.Contract; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; +import gregtech.GTMod; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Mods; import gregtech.api.interfaces.IRecipeMap; import gregtech.api.recipe.RecipeCategory; @@ -33,7 +33,7 @@ import gregtech.api.recipe.metadata.RecipeMetadataStorage; import gregtech.api.util.extensions.ArrayExt; @SuppressWarnings({ "unused", "UnusedReturnValue" }) -public class GT_RecipeBuilder { +public class GTRecipeBuilder { // debug mode expose problems. panic mode help you check nothing is wrong-ish without you actively monitoring private static final boolean DEBUG_MODE_NULL; @@ -117,9 +117,9 @@ public class GT_RecipeBuilder { protected boolean skip = false; protected boolean valid = true; - GT_RecipeBuilder() {} + GTRecipeBuilder() {} - private GT_RecipeBuilder(ItemStack[] inputsBasic, Object[] inputsOreDict, ItemStack[] outputs, ItemStack[][] alts, + private GTRecipeBuilder(ItemStack[] inputsBasic, Object[] inputsOreDict, ItemStack[] outputs, ItemStack[][] alts, FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int[] chances, Object special, int duration, int eut, int specialValue, boolean enabled, boolean hidden, boolean fakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, boolean nbtSensitive, String[] neiDesc, RecipeCategory recipeCategory, @@ -164,18 +164,18 @@ public class GT_RecipeBuilder { } private static ItemStack[] fix(ItemStack[] inputs) { - return GT_OreDictUnificator.setStackArray(true, ArrayExt.withoutTrailingNulls(inputs, ItemStack[]::new)); + return GTOreDictUnificator.setStackArray(true, ArrayExt.withoutTrailingNulls(inputs, ItemStack[]::new)); } - public static GT_RecipeBuilder builder() { - return new GT_RecipeBuilder(); + public static GTRecipeBuilder builder() { + return new GTRecipeBuilder(); } /** * Creates empty builder where only duration and EU/t are set to 0. */ - public static GT_RecipeBuilder empty() { - return new GT_RecipeBuilder().duration(0) + public static GTRecipeBuilder empty() { + return new GTRecipeBuilder().duration(0) .eut(0); } @@ -186,9 +186,9 @@ public class GT_RecipeBuilder { private static void handleNullRecipeComponents(String componentType) { // place a breakpoint here to catch all these issues - GT_Log.err.print("null detected in "); - GT_Log.err.println(componentType); - new NullPointerException().printStackTrace(GT_Log.err); + GTLog.err.print("null detected in "); + GTLog.err.println(componentType); + new NullPointerException().printStackTrace(GTLog.err); if (PANIC_MODE_NULL) { throw new IllegalArgumentException("null in argument"); } @@ -203,8 +203,8 @@ public class GT_RecipeBuilder { return; } // place a breakpoint here to catch all these issues - GT_Log.err.print("invalid recipe"); - new IllegalArgumentException().printStackTrace(GT_Log.err); + GTLog.err.print("invalid recipe"); + new IllegalArgumentException().printStackTrace(GTLog.err); if (PANIC_MODE_INVALID) { throw new IllegalArgumentException("invalid recipe"); } @@ -214,18 +214,18 @@ public class GT_RecipeBuilder { if (!DEBUG_MODE_COLLISION && !PANIC_MODE_COLLISION) { return; } - GT_Log.err.print("Recipe collision resulting in recipe loss detected with "); - GT_Log.err.println(details); + GTLog.err.print("Recipe collision resulting in recipe loss detected with "); + GTLog.err.println(details); if (PANIC_MODE_COLLISION) { throw new IllegalArgumentException("Recipe Collision"); } else { // place a breakpoint here to catch all these issues - new IllegalArgumentException().printStackTrace(GT_Log.err); + new IllegalArgumentException().printStackTrace(GTLog.err); } } public static void onConfigLoad() { - PANIC_MODE_NULL |= GT_Mod.gregtechproxy.crashOnNullRecipeInput; + PANIC_MODE_NULL |= GTMod.gregtechproxy.crashOnNullRecipeInput; } // endregion @@ -235,7 +235,7 @@ public class GT_RecipeBuilder { /** * Non-OreDicted item inputs. Assumes input is unified. */ - public GT_RecipeBuilder itemInputsUnified(ItemStack... inputs) { + public GTRecipeBuilder itemInputsUnified(ItemStack... inputs) { if (skip) return this; if (debugNull() && containsNull(inputs)) handleNullRecipeComponents("itemInputUnified"); inputsBasic = ArrayExt.withoutTrailingNulls(inputs, ItemStack[]::new); @@ -247,7 +247,7 @@ public class GT_RecipeBuilder { /** * Non-OreDicted item inputs. Assumes input is not unified. */ - public GT_RecipeBuilder itemInputs(ItemStack... inputs) { + public GTRecipeBuilder itemInputs(ItemStack... inputs) { if (skip) return this; if (debugNull() && containsNull(inputs)) handleNullRecipeComponents("itemInputs"); inputsBasic = fix(inputs); @@ -259,7 +259,7 @@ public class GT_RecipeBuilder { /** * OreDicted item inputs. Currently only used for assline recipes adder. */ - public GT_RecipeBuilder itemInputs(Object... inputs) { + public GTRecipeBuilder itemInputs(Object... inputs) { if (skip) return this; inputsOreDict = inputs; alts = new ItemStack[inputs.length][]; @@ -271,12 +271,12 @@ public class GT_RecipeBuilder { alts[i] = ((ItemStack[]) input).clone(); } else if (input instanceof Object[]arr) { if (arr.length != 2) continue; - List<ItemStack> ores = GT_OreDictUnificator.getOres(arr[0]); + List<ItemStack> ores = GTOreDictUnificator.getOres(arr[0]); if (ores.isEmpty()) continue; int size = ((Number) arr[1]).intValue(); alts[i] = ores.stream() - .map(s -> GT_Utility.copyAmount(size, s)) - .filter(GT_Utility::isStackValid) + .map(s -> GTUtility.copyAmount(size, s)) + .filter(GTUtility::isStackValid) .toArray(ItemStack[]::new); } else if (input == null) { handleNullRecipeComponents("recipe oredict input"); @@ -292,7 +292,7 @@ public class GT_RecipeBuilder { return noOptimize(); } - public GT_RecipeBuilder itemOutputs(ItemStack... outputs) { + public GTRecipeBuilder itemOutputs(ItemStack... outputs) { if (skip) return this; if (debugNull() && containsNull(outputs)) handleNullRecipeComponents("itemOutputs"); this.outputs = outputs; @@ -306,7 +306,7 @@ public class GT_RecipeBuilder { * Not intended to be used by recipe authors. * Intended for recipe rewrite middlewares. */ - public GT_RecipeBuilder itemOutputs(ItemStack[] outputs, int[] chances) { + public GTRecipeBuilder itemOutputs(ItemStack[] outputs, int[] chances) { if (skip) return this; if (debugNull() && containsNull(outputs)) handleNullRecipeComponents("itemOutputs"); this.outputs = outputs; @@ -317,21 +317,21 @@ public class GT_RecipeBuilder { return this; } - public GT_RecipeBuilder fluidInputs(FluidStack... fluidInputs) { + public GTRecipeBuilder fluidInputs(FluidStack... fluidInputs) { if (skip) return this; if (debugNull() && containsNull(fluidInputs)) handleNullRecipeComponents("fluidInputs"); this.fluidInputs = fix(fluidInputs); return this; } - public GT_RecipeBuilder fluidOutputs(FluidStack... fluidOutputs) { + public GTRecipeBuilder fluidOutputs(FluidStack... fluidOutputs) { if (skip) return this; if (debugNull() && containsNull(fluidOutputs)) handleNullRecipeComponents("fluidOutputs"); this.fluidOutputs = fix(fluidOutputs); return this; } - public GT_RecipeBuilder outputChances(int... chances) { + public GTRecipeBuilder outputChances(int... chances) { if (skip) return this; if (outputs != null && chances.length != outputs.length) { throw new IllegalArgumentException("Output chances array and items array length differs"); @@ -340,29 +340,29 @@ public class GT_RecipeBuilder { return this; } - public GT_RecipeBuilder special(Object special) { + public GTRecipeBuilder special(Object special) { this.special = special; return this; } - public GT_RecipeBuilder duration(int duration) { + public GTRecipeBuilder duration(int duration) { this.duration = duration; return this; } - public GT_RecipeBuilder duration(long duration) { + public GTRecipeBuilder duration(long duration) { this.duration = (int) duration; return this; } - public GT_RecipeBuilder eut(int eut) { + public GTRecipeBuilder eut(int eut) { if (DEBUG_MODE_FULL_ENERGY) { // Ignores ULV voltage - for (int i = 1; i < GT_Values.VP.length; i++) { - if (eut <= GT_Values.V[i] && eut > GT_Values.VP[i]) { - GT_Log.err.println( - "EUt > Practical Voltage detected. EUt: " + eut + ", Practical Voltage: " + GT_Values.VP[i]); - new IllegalArgumentException().printStackTrace(GT_Log.err); + for (int i = 1; i < GTValues.VP.length; i++) { + if (eut <= GTValues.V[i] && eut > GTValues.VP[i]) { + GTLog.err.println( + "EUt > Practical Voltage detected. EUt: " + eut + ", Practical Voltage: " + GTValues.VP[i]); + new IllegalArgumentException().printStackTrace(GTLog.err); break; } } @@ -371,7 +371,7 @@ public class GT_RecipeBuilder { return this; } - public GT_RecipeBuilder eut(long eut) { + public GTRecipeBuilder eut(long eut) { return eut((int) eut); } @@ -379,48 +379,48 @@ public class GT_RecipeBuilder { * prefer to use metadata over this. should only use when the target recipe map does not yet support metadata * system, or it's to bridge legacy code and modern code. */ - public GT_RecipeBuilder specialValue(int specialValue) { + public GTRecipeBuilder specialValue(int specialValue) { this.specialValue = specialValue; return this; } // I don't expect anyone to actually call this... - public GT_RecipeBuilder disabled() { + public GTRecipeBuilder disabled() { this.enabled = false; return this; } - public GT_RecipeBuilder hidden() { + public GTRecipeBuilder hidden() { this.hidden = true; return this; } - public GT_RecipeBuilder fake() { + public GTRecipeBuilder fake() { this.fakeRecipe = true; return this; } - public GT_RecipeBuilder noBuffer() { + public GTRecipeBuilder noBuffer() { this.mCanBeBuffered = false; return this; } - public GT_RecipeBuilder needsEmptyOutput() { + public GTRecipeBuilder needsEmptyOutput() { this.mNeedsEmptyOutput = true; return this; } - public GT_RecipeBuilder nbtSensitive() { + public GTRecipeBuilder nbtSensitive() { this.nbtSensitive = true; return this; } - public GT_RecipeBuilder setNEIDesc(String... neiDesc) { + public GTRecipeBuilder setNEIDesc(String... neiDesc) { this.neiDesc = neiDesc; return this; } - public GT_RecipeBuilder recipeCategory(RecipeCategory recipeCategory) { + public GTRecipeBuilder recipeCategory(RecipeCategory recipeCategory) { this.recipeCategory = recipeCategory; return this; } @@ -428,7 +428,7 @@ public class GT_RecipeBuilder { /** * Prevent the resulting recipe from optimizing recipe, which is a process that reduce recipe batch size. */ - public GT_RecipeBuilder noOptimize() { + public GTRecipeBuilder noOptimize() { this.optimize = false; return this; } @@ -436,7 +436,7 @@ public class GT_RecipeBuilder { /** * Prevents checking collision with existing recipes when adding the built recipe. */ - public GT_RecipeBuilder ignoreCollision() { + public GTRecipeBuilder ignoreCollision() { this.checkForCollision = false; return this; } @@ -445,9 +445,9 @@ public class GT_RecipeBuilder { * Sets metadata of the recipe. It can be used for recipe emitter to do special things, or for being stored in the * built recipe and used for actual recipe processing. * <p> - * {@link GT_RecipeConstants} has a series of metadata keys. Or you can create one by yourself. + * {@link GTRecipeConstants} has a series of metadata keys. Or you can create one by yourself. */ - public <T> GT_RecipeBuilder metadata(RecipeMetadataKey<T> key, T value) { + public <T> GTRecipeBuilder metadata(RecipeMetadataKey<T> key, T value) { if (skip) return this; if (metadataStorage == null) { metadataStorage = new RecipeMetadataStorage(); @@ -487,18 +487,18 @@ public class GT_RecipeBuilder { * * @param mods Mod(s) required for the recipe. */ - public GT_RecipeBuilder requireMods(Mods... mods) { + public GTRecipeBuilder requireMods(Mods... mods) { skip = Stream.of(mods) .anyMatch(mod -> !mod.isModLoaded()); return this; } - public GT_RecipeBuilder requiresCleanRoom() { - return metadata(GT_RecipeConstants.CLEANROOM, true); + public GTRecipeBuilder requiresCleanRoom() { + return metadata(GTRecipeConstants.CLEANROOM, true); } - public GT_RecipeBuilder requiresLowGravity() { - return metadata(GT_RecipeConstants.LOW_GRAVITY, true); + public GTRecipeBuilder requiresLowGravity() { + return metadata(GTRecipeConstants.LOW_GRAVITY, true); } // endregion @@ -517,8 +517,8 @@ public class GT_RecipeBuilder { * <p> * checkout docs/RecipeBuilder.md for more info on whether to copy or not. */ - public GT_RecipeBuilder copy() { - return new GT_RecipeBuilder( + public GTRecipeBuilder copy() { + return new GTRecipeBuilder( copyItemArray(inputsBasic), copy(inputsOreDict), copyItemArray(outputs), @@ -548,8 +548,8 @@ public class GT_RecipeBuilder { /** * produce a deep copy of current values. anything unset will remain unset. discard all existing metadata */ - public GT_RecipeBuilder copyNoMetadata() { - return new GT_RecipeBuilder( + public GTRecipeBuilder copyNoMetadata() { + return new GTRecipeBuilder( copyItemArray(inputsBasic), copy(inputsOreDict), copyItemArray(outputs), @@ -646,12 +646,12 @@ public class GT_RecipeBuilder { // region validator - public GT_RecipeBuilder clearInvalid() { + public GTRecipeBuilder clearInvalid() { valid = true; return this; } - public GT_RecipeBuilder invalidate() { + public GTRecipeBuilder invalidate() { valid = false; return this; } @@ -672,43 +672,43 @@ public class GT_RecipeBuilder { * Validate if input item match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateNoInput() { + public GTRecipeBuilder validateNoInput() { if (skip) return this; - return GT_Utility.isArrayEmptyOrNull(inputsBasic) ? this : invalidate(); + return GTUtility.isArrayEmptyOrNull(inputsBasic) ? this : invalidate(); } /** * Validate if input fluid match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateNoInputFluid() { + public GTRecipeBuilder validateNoInputFluid() { if (skip) return this; - return GT_Utility.isArrayEmptyOrNull(fluidInputs) ? this : invalidate(); + return GTUtility.isArrayEmptyOrNull(fluidInputs) ? this : invalidate(); } /** * Validate if output item match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateNoOutput() { + public GTRecipeBuilder validateNoOutput() { if (skip) return this; - return GT_Utility.isArrayEmptyOrNull(outputs) ? this : invalidate(); + return GTUtility.isArrayEmptyOrNull(outputs) ? this : invalidate(); } /** * Validate if output fluid match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateNoOutputFluid() { + public GTRecipeBuilder validateNoOutputFluid() { if (skip) return this; - return GT_Utility.isArrayEmptyOrNull(fluidOutputs) ? this : invalidate(); + return GTUtility.isArrayEmptyOrNull(fluidOutputs) ? this : invalidate(); } /** * Validate if input item match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateInputCount(int min, int max) { + public GTRecipeBuilder validateInputCount(int min, int max) { if (skip) return this; if (inputsBasic == null) return min < 0 ? this : invalidate(); return isArrayValid(inputsBasic, min, max) ? this : invalidate(); @@ -718,7 +718,7 @@ public class GT_RecipeBuilder { * Validate if input fluid match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateInputFluidCount(int min, int max) { + public GTRecipeBuilder validateInputFluidCount(int min, int max) { if (skip) return this; if (fluidInputs == null) return min < 0 ? this : invalidate(); return isArrayValid(fluidInputs, min, max) ? this : invalidate(); @@ -728,7 +728,7 @@ public class GT_RecipeBuilder { * Validate if output item match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateOutputCount(int min, int max) { + public GTRecipeBuilder validateOutputCount(int min, int max) { if (skip) return this; if (outputs == null) return min < 0 ? this : invalidate(); return isArrayValid(outputs, min, max) ? this : invalidate(); @@ -738,13 +738,13 @@ public class GT_RecipeBuilder { * Validate if output fluid match requirement. Return as invalidated if fails prereq. Specify -1 as min to allow * unset. Both bound inclusive. Only supposed to be called by IRecipeMap and not client code. */ - public GT_RecipeBuilder validateOutputFluidCount(int min, int max) { + public GTRecipeBuilder validateOutputFluidCount(int min, int max) { if (skip) return this; if (fluidOutputs == null) return min < 0 ? this : invalidate(); return isArrayValid(fluidOutputs, min, max) ? this : invalidate(); } - public GT_RecipeBuilder validateAnyInput() { + public GTRecipeBuilder validateAnyInput() { if (skip) return this; if (fluidInputs != null && isArrayValid(fluidInputs, 1, Integer.MAX_VALUE)) { return this; @@ -755,7 +755,7 @@ public class GT_RecipeBuilder { return invalidate(); } - public GT_RecipeBuilder validateAnyOutput() { + public GTRecipeBuilder validateAnyOutput() { if (skip) return this; if (fluidOutputs != null && isArrayValid(fluidOutputs, 1, Integer.MAX_VALUE)) { return this; @@ -774,7 +774,7 @@ public class GT_RecipeBuilder { * * @return Built recipe. Returns empty if failed to build. */ - public Optional<GT_Recipe> build() { + public Optional<GTRecipe> build() { if (skip) { return Optional.empty(); } @@ -786,7 +786,7 @@ public class GT_RecipeBuilder { optimize(); return Optional.of( decorate( - new GT_Recipe( + new GTRecipe( inputsBasic, outputs, fluidInputs, @@ -807,12 +807,12 @@ public class GT_RecipeBuilder { recipeCategory))); } - public GT_RecipeBuilder forceOreDictInput() { + public GTRecipeBuilder forceOreDictInput() { if (inputsOreDict != null || inputsBasic == null) return this; return itemInputs((Object[]) inputsBasic); } - public Optional<GT_Recipe.GT_Recipe_WithAlt> buildWithAlt() { + public Optional<GTRecipe.GTRecipe_WithAlt> buildWithAlt() { if (skip) { return Optional.empty(); } @@ -827,7 +827,7 @@ public class GT_RecipeBuilder { // no optimize. return Optional.of( decorate( - new GT_Recipe.GT_Recipe_WithAlt( + new GTRecipe.GTRecipe_WithAlt( inputsBasic, outputs, fluidInputs, @@ -882,7 +882,7 @@ public class GT_RecipeBuilder { } } - private <T extends GT_Recipe> T decorate(T r) { + private <T extends GTRecipe> T decorate(T r) { r.mHidden = hidden; r.mCanBeBuffered = mCanBeBuffered; r.mNeedsEmptyOutput = mNeedsEmptyOutput; @@ -894,12 +894,12 @@ public class GT_RecipeBuilder { return r; } - private void applyDefaultSpecialValues(GT_Recipe recipe) { + private void applyDefaultSpecialValues(GTRecipe recipe) { if (recipe.mSpecialValue != 0) return; int specialValue = 0; - if (getMetadataOrDefault(GT_RecipeConstants.LOW_GRAVITY, false)) specialValue -= 100; - if (getMetadataOrDefault(GT_RecipeConstants.CLEANROOM, false)) specialValue -= 200; + if (getMetadataOrDefault(GTRecipeConstants.LOW_GRAVITY, false)) specialValue -= 100; + if (getMetadataOrDefault(GTRecipeConstants.CLEANROOM, false)) specialValue -= 200; for (RecipeMetadataKey<Integer> ident : SPECIAL_VALUE_ALIASES) { Integer metadata = getMetadataOrDefault(ident, null); if (metadata != null) { @@ -910,14 +910,14 @@ public class GT_RecipeBuilder { recipe.mSpecialValue = specialValue; } - public Collection<GT_Recipe> addTo(IRecipeMap recipeMap) { + public Collection<GTRecipe> addTo(IRecipeMap recipeMap) { if (skip) { return Collections.emptyList(); } return recipeMap.doAdd(this); } - public GT_RecipeBuilder reset() { + public GTRecipeBuilder reset() { metadataStorage = null; alts = null; chances = null; diff --git a/src/main/java/gregtech/api/util/GT_RecipeConstants.java b/src/main/java/gregtech/api/util/GTRecipeConstants.java index c8a002c6c2..82a477756a 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeConstants.java +++ b/src/main/java/gregtech/api/util/GTRecipeConstants.java @@ -1,7 +1,7 @@ package gregtech.api.util; import static gregtech.api.recipe.RecipeMaps.scannerFakeRecipes; -import static gregtech.api.util.GT_RecipeMapUtil.convertCellToFluid; +import static gregtech.api.util.GTRecipeMapUtil.convertCellToFluid; import java.util.ArrayList; import java.util.Arrays; @@ -14,12 +14,8 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import com.elisis.gtnhlanth.common.item.MaskList; -import com.elisis.gtnhlanth.common.item.PhotolithographicMask; -import com.elisis.gtnhlanth.common.register.LanthItemList; - import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -30,12 +26,15 @@ import gregtech.api.recipe.RecipeCategories; import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.RecipeMetadataKey; import gregtech.api.recipe.metadata.SimpleRecipeMetadataKey; -import gregtech.common.items.GT_MetaGenerated_Item_03; -import gregtech.common.items.ID_MetaItem_03; +import gregtech.common.items.IDMetaItem03; +import gregtech.common.items.MetaGeneratedItem03; +import gtnhlanth.common.item.ItemPhotolithographicMask; +import gtnhlanth.common.item.MaskList; +import gtnhlanth.common.register.LanthItemList; // this class is intended to be import-static-ed on every recipe script // so take care to not put unrelated stuff here! -public class GT_RecipeConstants { +public class GTRecipeConstants { /** * Set to true to signal the recipe require low gravity. do nothing if recipe set specialValue explicitly. Can @@ -222,18 +221,18 @@ public class GT_RecipeConstants { * Will override the fluid input with oxygen/plasma for the respective recipe maps, so there is no point setting it. */ public static final IRecipeMap UniversalArcFurnace = IRecipeMap.newRecipeMap(builder -> { - if (!GT_Utility.isArrayOfLength(builder.getItemInputsBasic(), 1) - || GT_Utility.isArrayEmptyOrNull(builder.getItemOutputs())) return Collections.emptyList(); + if (!GTUtility.isArrayOfLength(builder.getItemInputsBasic(), 1) + || GTUtility.isArrayEmptyOrNull(builder.getItemOutputs())) return Collections.emptyList(); int aDuration = builder.getDuration(); if (aDuration <= 0) { return Collections.emptyList(); } builder.duration(aDuration); boolean recycle = builder.getMetadataOrDefault(RECYCLE, false); - Collection<GT_Recipe> ret = new ArrayList<>(); + Collection<GTRecipe> ret = new ArrayList<>(); for (Materials mat : new Materials[] { Materials.Argon, Materials.Nitrogen }) { int tPlasmaAmount = (int) Math.max(1L, aDuration / (mat.getMass() * 16L)); - GT_RecipeBuilder plasmaBuilder = builder.copy() + GTRecipeBuilder plasmaBuilder = builder.copy() .fluidInputs(mat.getPlasma(tPlasmaAmount)) .fluidOutputs(mat.getGas(tPlasmaAmount)); if (recycle) { @@ -241,7 +240,7 @@ public class GT_RecipeConstants { } ret.addAll(RecipeMaps.plasmaArcFurnaceRecipes.doAdd(plasmaBuilder)); } - GT_RecipeBuilder arcBuilder = builder.copy() + GTRecipeBuilder arcBuilder = builder.copy() .fluidInputs(Materials.Oxygen.getGas(aDuration)); if (recycle) { arcBuilder.recipeCategory(RecipeCategories.arcFurnaceRecycling); @@ -257,11 +256,11 @@ public class GT_RecipeConstants { for (ItemStack input : builder.getItemInputsBasic()) { // config >= 10 -> this is a special chemical recipe that output fluid/canned fluid variant. // it doesn't belong to multiblocks - if (GT_Utility.isAnyIntegratedCircuit(input) && input.getItemDamage() >= 10) { + if (GTUtility.isAnyIntegratedCircuit(input) && input.getItemDamage() >= 10) { return builder.addTo(RecipeMaps.chemicalReactorRecipes); } } - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .addTo(RecipeMaps.chemicalReactorRecipes), convertCellToFluid(builder, false) @@ -288,20 +287,20 @@ public class GT_RecipeConstants { // spotless:on // Find the wafer used Wafer wafer = null; - PhotolithographicMask t1Item = (PhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK1); - PhotolithographicMask t2Item = (PhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK2); - PhotolithographicMask t3Item = (PhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK3); + ItemPhotolithographicMask t1Item = (ItemPhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK1); + ItemPhotolithographicMask t2Item = (ItemPhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK2); + ItemPhotolithographicMask t3Item = (ItemPhotolithographicMask) LanthItemList.maskMap.get(MaskList.BLANK3); for (ItemStack input : builder.getItemInputsBasic()) { - if (input.getItem() instanceof GT_MetaGenerated_Item_03) { + if (input.getItem() instanceof MetaGeneratedItem03) { int meta = input.getItemDamage() - 32000; // Check if this input item is indicating a wafer recipe we want to modify - if (meta == ID_MetaItem_03.Circuit_Silicon_Wafer3.ID) wafer = Wafer.Naquadah; - else if (meta == ID_MetaItem_03.Circuit_Silicon_Wafer4.ID) wafer = Wafer.Europium; - else if (meta == ID_MetaItem_03.Circuit_Silicon_Wafer5.ID) wafer = Wafer.Americium; + if (meta == IDMetaItem03.Circuit_Silicon_Wafer3.ID) wafer = Wafer.Naquadah; + else if (meta == IDMetaItem03.Circuit_Silicon_Wafer4.ID) wafer = Wafer.Europium; + else if (meta == IDMetaItem03.Circuit_Silicon_Wafer5.ID) wafer = Wafer.Americium; } // Now look for beamline masks - if (input.getItem() instanceof PhotolithographicMask mask) { + if (input.getItem() instanceof ItemPhotolithographicMask mask) { String spectrum = mask.getDescSpectrum(); if (spectrum.equals(t1Item.getDescSpectrum())) wafer = Wafer.MaskT1; else if (spectrum.equals(t2Item.getDescSpectrum())) wafer = Wafer.MaskT2; @@ -326,10 +325,10 @@ public class GT_RecipeConstants { // Naquadah wafers can use grade 1-2 purified water for a bonus, otherwise use distilled so we don't // have to // deal with circuits - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .itemInputs(itemInputs) - .fluidInputs(GT_ModHandler.getDistilledWater(100L)) + .fluidInputs(GTModHandler.getDistilledWater(100L)) .addTo(RecipeMaps.laserEngraverRecipes), builder.copy() .itemInputs(itemInputs) @@ -344,7 +343,7 @@ public class GT_RecipeConstants { } case Europium -> { // Require purified water for europium wafers, at least grade 3 - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .fluidInputs(Materials.Grade3PurifiedWater.getFluid(100L)) .duration(recipeTime) @@ -356,7 +355,7 @@ public class GT_RecipeConstants { } case Americium -> { // Require purified water for americium wafers, at least grade 5 - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .fluidInputs(Materials.Grade5PurifiedWater.getFluid(100L)) .duration(recipeTime) @@ -369,7 +368,7 @@ public class GT_RecipeConstants { // Masks require much more purified water because they can make many wafers at once case MaskT1 -> { // T1 masks require grade 1, 2 or 3 purified water - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .fluidInputs(Materials.Grade1PurifiedWater.getFluid(32000L)) .duration(recipeTime) @@ -385,7 +384,7 @@ public class GT_RecipeConstants { } case MaskT2 -> { // T2 masks require grade 4 or 5 purified water - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .fluidInputs(Materials.Grade4PurifiedWater.getFluid(32000L)) .duration(recipeTime) @@ -397,7 +396,7 @@ public class GT_RecipeConstants { } case MaskT3 -> { // T3 masks require grade 6, 7 or 8 purified water - return GT_Utility.concat( + return GTUtility.concat( builder.copy() .fluidInputs(Materials.Grade6PurifiedWater.getFluid(32000L)) .duration(recipeTime) @@ -422,7 +421,7 @@ public class GT_RecipeConstants { * in ticks. */ public static final IRecipeMap AssemblyLine = IRecipeMap.newRecipeMap(builder -> { - Optional<GT_Recipe.GT_Recipe_WithAlt> rr = builder.forceOreDictInput() + Optional<GTRecipe.GTRecipe_WithAlt> rr = builder.forceOreDictInput() .validateInputCount(4, 16) .validateOutputCount(1, 1) .validateOutputFluidCount(-1, 0) @@ -430,7 +429,7 @@ public class GT_RecipeConstants { .buildWithAlt(); // noinspection SimplifyOptionalCallChains if (!rr.isPresent()) return Collections.emptyList(); - GT_Recipe.GT_Recipe_WithAlt r = rr.get(); + GTRecipe.GTRecipe_WithAlt r = rr.get(); ItemStack[][] mOreDictAlt = r.mOreDictAlt; Object[] inputs = builder.getItemInputsOreDict(); ItemStack aResearchItem = builder.getMetadata(RESEARCH_ITEM); @@ -443,19 +442,19 @@ public class GT_RecipeConstants { ItemStack[] alts = mOreDictAlt[i]; Object input = inputs[i]; if (input == null) { - GT_Log.err.println( + GTLog.err.println( "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " + aOutput.getUnlocalizedName() + " there is some null item in that recipe"); } if (input instanceof ItemStack) { - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash((ItemStack) input, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash((ItemStack) input, true, false); } else if (input instanceof ItemStack[]) { for (ItemStack alt : ((ItemStack[]) input)) { - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(alt, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(alt, true, false); if (alt == null) { - GT_Log.err.println( + GTLog.err.println( "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " + aOutput.getUnlocalizedName() @@ -476,18 +475,18 @@ public class GT_RecipeConstants { tPersistentHash = tPersistentHash * 31 + ((Number) objs[1]).intValue(); } } - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aResearchItem, true, false); - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aOutput, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(aResearchItem, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(aOutput, true, false); for (FluidStack fluidInput : r.mFluidInputs) { if (fluidInput == null) continue; - tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(fluidInput, true, false); + tPersistentHash = tPersistentHash * 31 + GTUtility.persistentHash(fluidInput, true, false); } int aResearchTime = builder.getMetadataOrDefault(RESEARCH_TIME, 0); tPersistentHash = tPersistentHash * 31 + aResearchTime; tPersistentHash = tPersistentHash * 31 + r.mDuration; tPersistentHash = tPersistentHash * 31 + r.mEUt; - GT_Recipe.GT_Recipe_AssemblyLine tRecipe = new GT_Recipe.GT_Recipe_AssemblyLine( + GTRecipe.RecipeAssemblyLine tRecipe = new GTRecipe.RecipeAssemblyLine( aResearchItem, aResearchTime, r.mInputs, @@ -497,14 +496,14 @@ public class GT_RecipeConstants { r.mEUt, r.mOreDictAlt); tRecipe.setPersistentHash(tPersistentHash); - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(tRecipe); - GT_AssemblyLineUtils.addRecipeToCache(tRecipe); + GTRecipe.RecipeAssemblyLine.sAssemblylineRecipes.add(tRecipe); + AssemblyLineUtils.addRecipeToCache(tRecipe); ItemStack writesDataStick = ItemList.Tool_DataStick.getWithName(1L, "Writes Research result"); - GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(writesDataStick, tRecipe, false); - Collection<GT_Recipe> ret = new ArrayList<>(3); + AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(writesDataStick, tRecipe, false); + Collection<GTRecipe> ret = new ArrayList<>(3); ret.addAll( - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(aResearchItem) .itemOutputs(aOutput) .special(writesDataStick) @@ -517,7 +516,7 @@ public class GT_RecipeConstants { .addTo(scannerFakeRecipes)); ItemStack readsDataStick = ItemList.Tool_DataStick.getWithName(1L, "Reads Research result"); - GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(readsDataStick, tRecipe, false); + AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(readsDataStick, tRecipe, false); ret.add( RecipeMaps.assemblylineVisualRecipes.addFakeRecipe( false, @@ -539,13 +538,13 @@ public class GT_RecipeConstants { * Adds an Electric Blast Furnace recipe that might use gas. */ public static final IRecipeMap BlastFurnaceWithGas = IRecipeMap.newRecipeMap(builder -> { - Collection<GT_Recipe> ret = new ArrayList<>(); + Collection<GTRecipe> ret = new ArrayList<>(); int basicGasAmount = builder.getMetadataOrDefault(ADDITIVE_AMOUNT, 1000); double durationBase = builder.getDuration(); ArrayList<ItemStack> items = new ArrayList<>(Arrays.asList(builder.getItemInputsBasic())); int circuitConfig = 1; if (items.size() == 1) {// Set circuit config if it is a dust -> ingot recipe. - ItemData data = GT_OreDictUnificator.getAssociation(items.get(0)); + ItemData data = GTOreDictUnificator.getAssociation(items.get(0)); if (data != null) { OrePrefixes prefix = data.mPrefix; if (OrePrefixes.dust.equals(prefix)) { @@ -558,7 +557,7 @@ public class GT_RecipeConstants { } } else { // Set circuit config if there is an integrated circuit for (int i = 0; i < items.size(); i++) { - if (GT_Utility.isAnyIntegratedCircuit(items.get(i))) { + if (GTUtility.isAnyIntegratedCircuit(items.get(i))) { circuitConfig = items.get(i) .getItemDamage(); items.remove(i--); @@ -567,7 +566,7 @@ public class GT_RecipeConstants { } if (builder.getMetadataOrDefault(NO_GAS, false)) { - items.add(GT_Utility.getIntegratedCircuit(circuitConfig)); + items.add(GTUtility.getIntegratedCircuit(circuitConfig)); ret.addAll( builder.copy() .itemInputs(items.toArray(new ItemStack[0])) @@ -578,7 +577,7 @@ public class GT_RecipeConstants { circuitConfig += 10; } - items.add(GT_Utility.getIntegratedCircuit(circuitConfig)); + items.add(GTUtility.getIntegratedCircuit(circuitConfig)); boolean nobleGases = builder.getMetadataOrDefault(NOBLE_GASES, false); boolean anaerobeGases = builder.getMetadataOrDefault(ANAEROBE_GASES, false); Collection<BlastFurnaceGasStat> gases = new ArrayList<>(); @@ -596,7 +595,7 @@ public class GT_RecipeConstants { ret.addAll( builder.copy() .itemInputs(items.toArray(new ItemStack[0])) - .fluidInputs(GT_Utility.copyAmount(gasAmount, gas.gas)) + .fluidInputs(GTUtility.copyAmount(gasAmount, gas.gas)) .duration(duration) .addTo(RecipeMaps.blastFurnaceRecipes)); } @@ -608,11 +607,11 @@ public class GT_RecipeConstants { * oredict via {@link #OREDICT_INPUT}. It will be used along all other item inputs as input of this recipe. */ public static IRecipeMap AssemblerOD = IRecipeMap.newRecipeMap(builder -> { - Collection<GT_Recipe> ret = new ArrayList<>(); - for (ItemStack input : GT_OreDictUnificator.getOresImmutable(builder.getMetadata(OREDICT_INPUT))) { + Collection<GTRecipe> ret = new ArrayList<>(); + for (ItemStack input : GTOreDictUnificator.getOresImmutable(builder.getMetadata(OREDICT_INPUT))) { ret.addAll( builder.copy() - .itemInputs(GT_RecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) + .itemInputs(GTRecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) .addTo(RecipeMaps.assemblerRecipes)); } return ret; @@ -667,26 +666,26 @@ public class GT_RecipeConstants { } static { - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COIL_HEAT); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUSION_THRESHOLD); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUEL_VALUE); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NANO_FORGE_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_EXOTIC_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_PLASMA_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DEFC_CASING_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(CHEMPLANT_CASING_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(QFT_FOCUS_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DISSOLUTION_TANK_RATIO); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RTG_DURATION_IN_DAYS); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(LNG_BASIC_OUTPUT); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NFR_COIL_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NKE_RANGE); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(PRECISE_ASSEMBLER_CASING_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COAL_CASING_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COMPRESSION_TIER); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RESEARCH_STATION_DATA); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(SIEVERTS); - GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DECAY_TICKS); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COIL_HEAT); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUSION_THRESHOLD); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUEL_VALUE); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NANO_FORGE_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_EXOTIC_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_PLASMA_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DEFC_CASING_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(CHEMPLANT_CASING_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(QFT_FOCUS_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DISSOLUTION_TANK_RATIO); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RTG_DURATION_IN_DAYS); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(LNG_BASIC_OUTPUT); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NFR_COIL_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NKE_RANGE); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(PRECISE_ASSEMBLER_CASING_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COAL_CASING_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COMPRESSION_TIER); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RESEARCH_STATION_DATA); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(SIEVERTS); + GTRecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DECAY_TICKS); } } diff --git a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java b/src/main/java/gregtech/api/util/GTRecipeMapUtil.java index 67d50188fe..86ef5b4031 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java +++ b/src/main/java/gregtech/api/util/GTRecipeMapUtil.java @@ -30,9 +30,9 @@ import gregtech.api.recipe.RecipeMetadataKey; /** * Define helpers useful in the creation of recipe maps. */ -public class GT_RecipeMapUtil { +public class GTRecipeMapUtil { - public static final Function<GT_Recipe, GT_Recipe> ALL_FAKE_RECIPE = r -> { + public static final Function<GTRecipe, GTRecipe> ALL_FAKE_RECIPE = r -> { r.mFakeRecipe = true; return r; }; @@ -51,24 +51,24 @@ public class GT_RecipeMapUtil { return newArr; } - public static GT_RecipeTemplate asTemplate(GT_Recipe r) { + public static GTRecipeTemplate asTemplate(GTRecipe r) { return asTemplate(r, false); } - public static GT_RecipeTemplate asTemplate(GT_Recipe r, boolean includeTemplate) { - return new GT_RecipeTemplate(r, includeTemplate); + public static GTRecipeTemplate asTemplate(GTRecipe r, boolean includeTemplate) { + return new GTRecipeTemplate(r, includeTemplate); } - public static List<GT_Recipe> buildRecipeForMultiblock(GT_RecipeBuilder b) { + public static List<GTRecipe> buildRecipeForMultiblock(GTRecipeBuilder b) { return buildOrEmpty(convertCellToFluid(b, true)); } - public static List<GT_Recipe> buildRecipeForMultiblockNoCircuit(GT_RecipeBuilder b) { + public static List<GTRecipe> buildRecipeForMultiblockNoCircuit(GTRecipeBuilder b) { return buildOrEmpty(convertCellToFluid(b, false)); } - public static GT_RecipeBuilder convertCellToFluid(GT_RecipeBuilder b, boolean removeIntegratedCircuit) { + public static GTRecipeBuilder convertCellToFluid(GTRecipeBuilder b, boolean removeIntegratedCircuit) { List<ItemStack> itemInputs = new ArrayList<>(Arrays.asList(b.getItemInputsBasic())); List<ItemStack> itemOutputs = new ArrayList<>(Arrays.asList(b.getItemOutputs())); List<FluidStack> fluidInputs = new ArrayList<>(Arrays.asList(b.getFluidInputs())); @@ -93,16 +93,16 @@ public class GT_RecipeMapUtil { TIntList chances) { for (int i = items.size() - 1; i >= 0; i--) { ItemStack item = items.get(i); - if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item) - || (removeIntegratedCircuit && GT_Utility.isAnyIntegratedCircuit(item))) { - fluids.add(GT_Utility.convertCellToFluid(item)); + if (GTUtility.getFluidForFilledItem(item, true) != null || GTUtility.isCellEmpty(item) + || (removeIntegratedCircuit && GTUtility.isAnyIntegratedCircuit(item))) { + fluids.add(GTUtility.convertCellToFluid(item)); items.remove(i); if (chances != null) chances.removeAt(i); } } } - public static List<GT_Recipe> buildOrEmpty(GT_RecipeBuilder builder) { + public static List<GTRecipe> buildOrEmpty(GTRecipeBuilder builder) { return builder.build() .map(Collections::singletonList) .orElse(Collections.emptyList()); @@ -134,7 +134,7 @@ public class GT_RecipeMapUtil { /** * Use this to register recipes for a recipe map in addon not present at compile time. * <p> - * Do not use this for recipes maps already in {@link GT_RecipeConstants}. None of them will be available via this + * Do not use this for recipes maps already in {@link GTRecipeConstants}. None of them will be available via this * interface! * * @param identifier recipe map id @@ -148,26 +148,26 @@ public class GT_RecipeMapUtil { else registerAction.accept(map); } - public static final class GT_RecipeTemplate { + public static final class GTRecipeTemplate { - private final GT_Recipe template; - private final List<GT_Recipe> derivatives = new ArrayList<>(); + private final GTRecipe template; + private final List<GTRecipe> derivatives = new ArrayList<>(); - private GT_RecipeTemplate(GT_Recipe template, boolean includeTemplate) { + private GTRecipeTemplate(GTRecipe template, boolean includeTemplate) { this.template = template; if (includeTemplate) derivatives.add(template); } - public GT_Recipe derive() { - GT_Recipe derived = template.copyShallow(); + public GTRecipe derive() { + GTRecipe derived = template.copyShallow(); derivatives.add(derived); return derived; } - public List<GT_Recipe> getAll() { + public List<GTRecipe> getAll() { // fix shallow references Set<Object> references = Collections.newSetFromMap(new IdentityHashMap<>()); - for (GT_Recipe r : derivatives) { + for (GTRecipe r : derivatives) { if (!references.add(r.mInputs)) r.mInputs = r.mInputs.clone(); if (!references.add(r.mOutputs)) r.mOutputs = r.mOutputs.clone(); if (!references.add(r.mFluidInputs)) r.mFluidInputs = r.mFluidInputs.clone(); diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java index 5acb15b242..919b37e7d9 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java @@ -1,9 +1,9 @@ package gregtech.api.util; -import static gregtech.api.enums.GT_Values.L; -import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.GT_Values.RA; -import static gregtech.api.enums.GT_Values.VP; +import static gregtech.api.enums.GTValues.L; +import static gregtech.api.enums.GTValues.M; +import static gregtech.api.enums.GTValues.RA; +import static gregtech.api.enums.GTValues.VP; import static gregtech.api.enums.Materials.Bronze; import static gregtech.api.enums.Materials.Cobalt; import static gregtech.api.enums.Materials.DarkSteel; @@ -24,12 +24,12 @@ import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; import static gregtech.api.recipe.RecipeMaps.hammerRecipes; import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; import static gregtech.api.recipe.RecipeMaps.wiremillRecipes; -import static gregtech.api.util.GT_RecipeBuilder.SECONDS; -import static gregtech.api.util.GT_RecipeBuilder.TICKS; -import static gregtech.api.util.GT_RecipeConstants.RECYCLE; -import static gregtech.api.util.GT_RecipeConstants.UniversalArcFurnace; -import static gregtech.api.util.GT_Utility.calculateRecipeEU; -import static gregtech.api.util.GT_Utility.getTier; +import static gregtech.api.util.GTRecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.TICKS; +import static gregtech.api.util.GTRecipeConstants.RECYCLE; +import static gregtech.api.util.GTRecipeConstants.UniversalArcFurnace; +import static gregtech.api.util.GTUtility.calculateRecipeEU; +import static gregtech.api.util.GTUtility.getTier; import java.lang.reflect.Field; import java.util.ArrayList; @@ -54,8 +54,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.SetMultimap; import cpw.mods.fml.relauncher.ReflectionHelper; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -68,7 +68,7 @@ import ic2.api.reactor.IReactorComponent; /** * Class for Automatic Recipe registering. */ -public class GT_RecipeRegistrator { +public class GTRecipeRegistrator { /** * List of Materials, which are used in the Creation of Sticks. All Rod Materials are automatically added to this @@ -159,42 +159,42 @@ public class GT_RecipeRegistrator { static { // flush the cache on post load finish - GregTech_API.sAfterGTPostload.add(() -> indexedRecipeListCache = null); + GregTechAPI.sAfterGTPostload.add(() -> indexedRecipeListCache = null); } public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) { - if (GT_Utility.isStackInvalid(aStack)) return; + if (GTUtility.isStackInvalid(aStack)) return; if (aByproduct != null) { aByproduct = aByproduct.clone(); aByproduct.mAmount /= aStack.stackSize; } - GT_OreDictUnificator.addItemData( - GT_Utility.copyAmount(1, aStack), + GTOreDictUnificator.addItemData( + GTUtility.copyAmount(1, aStack), new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); } public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { - if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) + if (GTUtility.isStackInvalid(aStack) || GTUtility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) || aData == null || !aData.hasValidMaterialData() || !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes || aData.mMaterial.mAmount <= 0 - || GT_Utility.getFluidForFilledItem(aStack, false) != null + || GTUtility.getFluidForFilledItem(aStack, false) != null || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) return; - registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null); - if (!GT_Utility.areStacksEqual(GT_ModHandler.getIC2Item("iridiumOre", 1L), aStack)) { + registerReverseMacerating(GTUtility.copyAmount(1, aStack), aData, aData.mPrefix == null); + if (!GTUtility.areStacksEqual(GTModHandler.getIC2Item("iridiumOre", 1L), aStack)) { registerReverseSmelting( - GT_Utility.copyAmount(1, aStack), + GTUtility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, true); registerReverseFluidSmelting( - GT_Utility.copyAmount(1, aStack), + GTUtility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, aData.getByProduct(0)); - registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData); + registerReverseArcSmelting(GTUtility.copyAmount(1, aStack), aData); } } @@ -213,14 +213,14 @@ public class GT_RecipeRegistrator { ItemStack recipeOutput = aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) - ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) + ? GTOreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) - ? GT_OreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) + ? GTOreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null - : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount); + : GTOreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount); - GT_RecipeBuilder builder = RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, aStack)); + GTRecipeBuilder builder = RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, aStack)); if (recipeOutput != null) { builder.itemOutputs(recipeOutput); } @@ -254,13 +254,13 @@ public class GT_RecipeRegistrator { aMaterialAmount /= aStack.stackSize; - if (aAllowAlloySmelter) GT_ModHandler.addSmeltingAndAlloySmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), + if (aAllowAlloySmelter) GTModHandler.addSmeltingAndAlloySmeltingRecipe( + GTUtility.copyAmount(1, aStack), + GTOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), false); - else GT_ModHandler.addSmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); + else GTModHandler.addSmeltingRecipe( + GTUtility.copyAmount(1, aStack), + GTOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); } public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, @@ -285,7 +285,7 @@ public class GT_RecipeRegistrator { if (tMaterial.mMaterial == Materials.Iron || tMaterial.mMaterial == Materials.Copper || tMaterial.mMaterial == Materials.WroughtIron || tMaterial.mMaterial == Materials.AnnealedCopper) { - ItemData stackData = GT_OreDictUnificator.getItemData(aStack); + ItemData stackData = GTOreDictUnificator.getItemData(aStack); if (stackData != null && (stackData.mPrefix == OrePrefixes.ingot || stackData.mPrefix == OrePrefixes.dust)) { // iron ingot/dust -> wrought iron, copper ingot/dust -> annealed copper @@ -333,16 +333,16 @@ public class GT_RecipeRegistrator { tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass(); ArrayList<ItemStack> outputs = new ArrayList<>(); - if (GT_OreDictUnificator.getIngotOrDust(aData.mMaterial) != null) { - outputs.add(GT_OreDictUnificator.getIngotOrDust(aData.mMaterial)); + if (GTOreDictUnificator.getIngotOrDust(aData.mMaterial) != null) { + outputs.add(GTOreDictUnificator.getIngotOrDust(aData.mMaterial)); } for (int i = 0; i < 8; i++) { - if (GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(i)) != null) { - outputs.add(GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(i))); + if (GTOreDictUnificator.getIngotOrDust(aData.getByProduct(i)) != null) { + outputs.add(GTOreDictUnificator.getIngotOrDust(aData.getByProduct(i))); } } if (!outputs.isEmpty()) { - GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder(); recipeBuilder.itemInputs(aStack) .itemOutputs(outputs.toArray(new ItemStack[0])) .fluidInputs(Materials.Oxygen.getGas((int) Math.max(16, tAmount / M))) @@ -386,17 +386,17 @@ public class GT_RecipeRegistrator { { ArrayList<ItemStack> outputs = new ArrayList<>(); - if (GT_OreDictUnificator.getDust(aData.mMaterial) != null) { - outputs.add(GT_OreDictUnificator.getDust(aData.mMaterial)); + if (GTOreDictUnificator.getDust(aData.mMaterial) != null) { + outputs.add(GTOreDictUnificator.getDust(aData.mMaterial)); } for (int i = 0; i < 3; i++) { - if (GT_OreDictUnificator.getDust(aData.getByProduct(i)) != null) { - outputs.add(GT_OreDictUnificator.getDust(aData.getByProduct(i))); + if (GTOreDictUnificator.getDust(aData.getByProduct(i)) != null) { + outputs.add(GTOreDictUnificator.getDust(aData.getByProduct(i))); } } if (!outputs.isEmpty()) { ItemStack[] outputsArray = outputs.toArray(new ItemStack[0]); - GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder(); + GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder(); recipeBuilder.itemInputs(aStack) .itemOutputs(outputsArray) .duration( @@ -414,10 +414,10 @@ public class GT_RecipeRegistrator { for (MaterialStack tMaterial : aData.getAllMaterialStacks()) { if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL) && tMaterial.mMaterial != Materials.Glass - && GT_OreDictUnificator.getDust(aData.mMaterial) != null) { - GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, aStack)) - .itemOutputs(GT_OreDictUnificator.getDust(aData.mMaterial)) + && GTOreDictUnificator.getDust(aData.mMaterial) != null) { + GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, aStack)) + .itemOutputs(GTOreDictUnificator.getDust(aData.mMaterial)) .duration(10 * SECONDS) .eut(TierEU.RECIPE_LV) .recipeCategory(RecipeCategories.forgeHammerRecycling) @@ -445,13 +445,13 @@ public class GT_RecipeRegistrator { public static synchronized void registerUsagesForMaterials(String aPlate, boolean aRecipeReplacing, ItemStack... aMats) { for (ItemStack aMat : aMats) { - aMat = GT_Utility.copyOrNull(aMat); + aMat = GTUtility.copyOrNull(aMat); if (aMat == null) continue; - ItemData aItemData = GT_OreDictUnificator.getItemData(aMat); + ItemData aItemData = GTOreDictUnificator.getItemData(aMat); if (aItemData == null || aItemData.mPrefix != OrePrefixes.ingot) aPlate = null; - if (aPlate != null && GT_OreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null; + if (aPlate != null && GTOreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null; sMt1.func_150996_a(aMat.getItem()); sMt1.stackSize = 1; @@ -463,19 +463,19 @@ public class GT_RecipeRegistrator { if (aItemData != null && aItemData.hasValidPrefixMaterialData()) { for (RecipeShape tRecipe : sShapes) { - for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputsBuffered(tRecipe.shape)) { - GT_OreDictUnificator.addItemData( + for (ItemStack tCrafted : GTModHandler.getRecipeOutputsBuffered(tRecipe.shape)) { + GTOreDictUnificator.addItemData( tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tRecipe.amount1)); // - // GT_Log.out.println("###################################################################################"); - // GT_Log.out.println("registerUsagesForMaterials used aPlate: "+aPlate); - // GT_Log.out.println("registerUsagesForMaterials used aPlate: + // GTLog.out.println("###################################################################################"); + // GTLog.out.println("registerUsagesForMaterials used aPlate: "+aPlate); + // GTLog.out.println("registerUsagesForMaterials used aPlate: // "+aMat.getUnlocalizedName()); - // GT_Log.out.println("registerUsagesForMaterials used aPlate: + // GTLog.out.println("registerUsagesForMaterials used aPlate: // "+aMat.getDisplayName()); // - // GT_Log.out.println("###################################################################################"); + // GTLog.out.println("###################################################################################"); } } } @@ -484,9 +484,9 @@ public class GT_RecipeRegistrator { } private static List<IRecipe> getRecipeList(RecipeShape shape) { - boolean force = !GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished; + boolean force = !GregTechAPI.sPostloadStarted || GregTechAPI.sPostloadFinished; if (force || indexedRecipeListCache == null) { - synchronized (GT_RecipeRegistrator.class) { + synchronized (GTRecipeRegistrator.class) { if (indexedRecipeListCache == null || force) { indexedRecipeListCache = createIndexedRecipeListCache(); } @@ -515,12 +515,12 @@ public class GT_RecipeRegistrator { } buffer.clear(); ItemStack tStack = tRecipe.getRecipeOutput(); - if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 + if (GTUtility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) - && !GT_ModHandler.isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, GT_ModHandler.sNonReplaceableItems)) { + && !GTModHandler.isElectricItem(tStack) + && !GTUtility.isStackInList(tStack, GTModHandler.sNonReplaceableItems)) { if (tRecipe instanceof ShapedOreRecipe tShapedRecipe) { if (checkRecipeShape( buffer, @@ -586,7 +586,7 @@ public class GT_RecipeRegistrator { private static synchronized void registerStickStuff(String aPlate, ItemData aItemData, boolean aRecipeReplacing) { ItemStack tStack; for (Materials tMaterial : sRodMaterialList) { - ItemStack tMt2 = GT_OreDictUnificator.get(OrePrefixes.stick, tMaterial, 1); + ItemStack tMt2 = GTOreDictUnificator.get(OrePrefixes.stick, tMaterial, 1); if (tMt2 != null) { sMt2.func_150996_a(tMt2.getItem()); sMt2.stackSize = 1; @@ -595,10 +595,10 @@ public class GT_RecipeRegistrator { for (int i = 0; i < sShapes.length; i++) { RecipeShape tRecipe = sShapes[i]; - for (ItemStack tCrafted : GT_ModHandler + for (ItemStack tCrafted : GTModHandler .getRecipeOutputs(getRecipeList(tRecipe), true, tRecipe.shape)) { if (aItemData != null && aItemData.hasValidPrefixMaterialData()) - GT_OreDictUnificator.addItemData( + GTOreDictUnificator.addItemData( tCrafted, new ItemData( aItemData.mMaterial.mMaterial, @@ -608,22 +608,22 @@ public class GT_RecipeRegistrator { if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) { assert aItemData != null; - if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe.shape))) { + if (null != (tStack = GTModHandler.removeRecipe(tRecipe.shape))) { switch (sShapesA[i].length) { - case 2 -> GT_ModHandler.addCraftingRecipe( + case 2 -> GTModHandler.addCraftingRecipe( tStack, - GT_ModHandler.RecipeBits.BUFFERED, + GTModHandler.RecipeBits.BUFFERED, new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); - case 3 -> GT_ModHandler.addCraftingRecipe( + case 3 -> GTModHandler.addCraftingRecipe( tStack, - GT_ModHandler.RecipeBits.BUFFERED, + GTModHandler.RecipeBits.BUFFERED, new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); - default -> GT_ModHandler.addCraftingRecipe( + default -> GTModHandler.addCraftingRecipe( tStack, - GT_ModHandler.RecipeBits.BUFFERED, + GTModHandler.RecipeBits.BUFFERED, new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); @@ -666,119 +666,119 @@ public class GT_RecipeRegistrator { */ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt, OrePrefixes prefix1, OrePrefixes prefix2, int multiplier) { - if (GT_OreDictUnificator.get(prefix1, aMaterial, 1L) != null - && GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L) != null) { - GT_Values.RA.stdBuilder() - .itemInputs(GT_OreDictUnificator.get(prefix1, aMaterial, 1L), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier)) + if (GTOreDictUnificator.get(prefix1, aMaterial, 1L) != null + && GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L) != null) { + GTValues.RA.stdBuilder() + .itemInputs(GTOreDictUnificator.get(prefix1, aMaterial, 1L), GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier)) .duration(baseDuration * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), - GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) + GTOreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), + GTUtility.getIntegratedCircuit(2)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) .duration(((int) (baseDuration * 1.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) + GTOreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), + GTUtility.getIntegratedCircuit(4)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) .duration(baseDuration * 2 * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(8)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L)) + GTOreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), + GTUtility.getIntegratedCircuit(8)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L)) .duration(((int) (baseDuration * 2.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), - GT_Utility.getIntegratedCircuit(12)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L)) + GTOreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), + GTUtility.getIntegratedCircuit(12)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L)) .duration(baseDuration * 3 * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(16)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L)) + GTOreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), + GTUtility.getIntegratedCircuit(16)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L)) .duration(((int) (baseDuration * 3.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); } - if (GT_OreDictUnificator.get(prefix2, aMaterial, 1L) != null - && GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L) != null) { - GT_Values.RA.stdBuilder() - .itemInputs(GT_OreDictUnificator.get(prefix2, aMaterial, 1L), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L / multiplier)) + if (GTOreDictUnificator.get(prefix2, aMaterial, 1L) != null + && GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L) != null) { + GTValues.RA.stdBuilder() + .itemInputs(GTOreDictUnificator.get(prefix2, aMaterial, 1L), GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L / multiplier)) .duration(((int) (baseDuration * 0.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) + GTOreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), + GTUtility.getIntegratedCircuit(2)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) .duration(baseDuration * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) + GTOreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), + GTUtility.getIntegratedCircuit(4)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) .duration(((int) (baseDuration * 1.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(8)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L)) + GTOreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), + GTUtility.getIntegratedCircuit(8)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L)) .duration(baseDuration * 2 * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), - GT_Utility.getIntegratedCircuit(12)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L)) + GTOreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), + GTUtility.getIntegratedCircuit(12)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L)) .duration(((int) (baseDuration * 2.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs( - GT_OreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), - GT_Utility.getIntegratedCircuit(16)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L)) + GTOreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), + GTUtility.getIntegratedCircuit(16)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L)) .duration(baseDuration * 3 * TICKS) .eut(aEUt) .addTo(wiremillRecipes); } - if (GT_OreDictUnificator.get(prefix1, aMaterial, 1L) != null - && GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 1L) != null) { - GT_Values.RA.stdBuilder() - .itemInputs(GT_OreDictUnificator.get(prefix1, aMaterial, 1L), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier)) + if (GTOreDictUnificator.get(prefix1, aMaterial, 1L) != null + && GTOreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 1L) != null) { + GTValues.RA.stdBuilder() + .itemInputs(GTOreDictUnificator.get(prefix1, aMaterial, 1L), GTUtility.getIntegratedCircuit(3)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier)) .duration(baseDuration * TICKS) .eut(aEUt) .addTo(wiremillRecipes); } - if (GT_OreDictUnificator.get(prefix2, aMaterial, 1L) != null - && GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 1L) != null) { - GT_Values.RA.stdBuilder() - .itemInputs(GT_OreDictUnificator.get(prefix2, aMaterial, 1L), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier)) + if (GTOreDictUnificator.get(prefix2, aMaterial, 1L) != null + && GTOreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 1L) != null) { + GTValues.RA.stdBuilder() + .itemInputs(GTOreDictUnificator.get(prefix2, aMaterial, 1L), GTUtility.getIntegratedCircuit(3)) + .itemOutputs(GTOreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier)) .duration(((int) (baseDuration * 0.5f)) * TICKS) .eut(aEUt) .addTo(wiremillRecipes); diff --git a/src/main/java/gregtech/api/util/GT_RenderingWorld.java b/src/main/java/gregtech/api/util/GTRenderingWorld.java index 7220b921a5..ace0e9cd8d 100644 --- a/src/main/java/gregtech/api/util/GT_RenderingWorld.java +++ b/src/main/java/gregtech/api/util/GTRenderingWorld.java @@ -26,9 +26,9 @@ import cpw.mods.fml.common.gameevent.TickEvent; /** * Provide a fake IBlockAccess to support CTM. Facade are supposed to set these when they are placed/received by client. */ -public class GT_RenderingWorld implements IBlockAccess { +public class GTRenderingWorld implements IBlockAccess { - private static final GT_RenderingWorld INSTANCE = new GT_RenderingWorld(); + private static final GTRenderingWorld INSTANCE = new GTRenderingWorld(); /* * I do not think this map would ever grow too huge, so I won't go too overcomplicated on this one */ @@ -36,16 +36,16 @@ public class GT_RenderingWorld implements IBlockAccess { private final Map<ChunkCoordIntPair, Set<ChunkPosition>> index = new HashMap<>(); private IBlockAccess mWorld = Minecraft.getMinecraft().theWorld; - private GT_RenderingWorld() { + private GTRenderingWorld() { new FMLEventHandler(); new ForgeEventHandler(); } - public static GT_RenderingWorld getInstance() { + public static GTRenderingWorld getInstance() { return INSTANCE; } - public static GT_RenderingWorld getInstance(IBlockAccess aWorld) { + public static GTRenderingWorld getInstance(IBlockAccess aWorld) { if (aWorld == INSTANCE) return INSTANCE; if (aWorld == null) INSTANCE.mWorld = Minecraft.getMinecraft().theWorld; else INSTANCE.mWorld = aWorld; diff --git a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java b/src/main/java/gregtech/api/util/GTShapedRecipe.java index 95a1a0bb66..587f3fa852 100644 --- a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java +++ b/src/main/java/gregtech/api/util/GTShapedRecipe.java @@ -8,15 +8,15 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.oredict.ShapedOreRecipe; -import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.interfaces.internal.IGTCraftingRecipe; -public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRecipe { +public class GTShapedRecipe extends ShapedOreRecipe implements IGTCraftingRecipe { public final boolean mRemovableByGT, mKeepingNBT; private final Enchantment[] mEnchantmentsAdded; private final int[] mEnchantmentLevelsAdded; - public GT_Shaped_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, + public GTShapedRecipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; @@ -52,7 +52,7 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec ItemStack rStack = super.getCraftingResult(aGrid); if (rStack != null) { // Update the Stack - GT_Utility.updateItemStack(rStack); + GTUtility.updateItemStack(rStack); // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { @@ -67,28 +67,28 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec } // Charge Values - if (GT_ModHandler.isElectricItem(rStack)) { - GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + if (GTModHandler.isElectricItem(rStack)) { + GTModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; - for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( + for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GTModHandler.dischargeElectricItem( aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true); - if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); + if (tCharge > 0) GTModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments - for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( + for (int i = 0; i < mEnchantmentsAdded.length; i++) GTUtility.ItemNBT.addEnchantment( rStack, mEnchantmentsAdded[i], EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + mEnchantmentLevelsAdded[i]); // Update the Stack again - GT_Utility.updateItemStack(rStack); + GTUtility.updateItemStack(rStack); } return rStack; } diff --git a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java b/src/main/java/gregtech/api/util/GTShapelessRecipe.java index 582dd7cc10..20c1d361be 100644 --- a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java +++ b/src/main/java/gregtech/api/util/GTShapelessRecipe.java @@ -8,15 +8,15 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.oredict.ShapelessOreRecipe; -import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.interfaces.internal.IGTCraftingRecipe; -public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_CraftingRecipe { +public class GTShapelessRecipe extends ShapelessOreRecipe implements IGTCraftingRecipe { public final boolean mRemovableByGT, mKeepingNBT; private final Enchantment[] mEnchantmentsAdded; private final int[] mEnchantmentLevelsAdded; - public GT_Shapeless_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, + public GTShapelessRecipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; @@ -52,7 +52,7 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft ItemStack rStack = super.getCraftingResult(aGrid); if (rStack != null) { // Update the Stack - GT_Utility.updateItemStack(rStack); + GTUtility.updateItemStack(rStack); // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { @@ -67,28 +67,28 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft } // Charge Values - if (GT_ModHandler.isElectricItem(rStack)) { - GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + if (GTModHandler.isElectricItem(rStack)) { + GTModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; - for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( + for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GTModHandler.dischargeElectricItem( aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true); - if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); + if (tCharge > 0) GTModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments - for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( + for (int i = 0; i < mEnchantmentsAdded.length; i++) GTUtility.ItemNBT.addEnchantment( rStack, mEnchantmentsAdded[i], EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + mEnchantmentLevelsAdded[i]); // Update the Stack again - GT_Utility.updateItemStack(rStack); + GTUtility.updateItemStack(rStack); } return rStack; } diff --git a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java b/src/main/java/gregtech/api/util/GTSpawnEventHandler.java index ebdba1144b..2e86fef136 100644 --- a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java +++ b/src/main/java/gregtech/api/util/GTSpawnEventHandler.java @@ -11,18 +11,18 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_MonsterRepellent; +import gregtech.common.tileentities.machines.basic.MTEMonsterRepellent; -public class GT_SpawnEventHandler { +public class GTSpawnEventHandler { public static volatile List<int[]> mobReps = new CopyOnWriteArrayList<>(); // Future Optimiztation ideas, if this isn't sufficient // 1: Keep a weakref list of mob repellents so we already have the tile // 2: Have the tick method update a HashMap of (int[], range) so we don't have to load the tile at all - public GT_SpawnEventHandler() { + public GTSpawnEventHandler() { MinecraftForge.EVENT_BUS.register(this); } @@ -50,7 +50,7 @@ public class GT_SpawnEventHandler { } if (event.entityLiving.isCreatureType(EnumCreatureType.monster, false)) { - final double maxRangeCheck = Math.pow(getPoweredRepellentRange(GT_Values.V.length - 1), 2); + final double maxRangeCheck = Math.pow(getPoweredRepellentRange(GTValues.V.length - 1), 2); for (int[] rep : mobReps) { if (rep[3] == event.entity.worldObj.provider.dimensionId) { // If the chunk isn't loaded, we ignore this Repellent @@ -65,7 +65,7 @@ public class GT_SpawnEventHandler { final TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]); if (tTile instanceof BaseMetaTileEntity metaTile - && metaTile.getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent repellent + && metaTile.getMetaTileEntity() instanceof MTEMonsterRepellent repellent && check <= Math.pow(repellent.mRange, 2)) { if (event.entityLiving instanceof EntitySlime slime) { slime.setCustomNameTag("DoNotSpawnSlimes"); diff --git a/src/main/java/gregtech/api/util/GT_StreamUtil.java b/src/main/java/gregtech/api/util/GTStreamUtil.java index c29e611c4e..4b71fe5ee8 100644 --- a/src/main/java/gregtech/api/util/GT_StreamUtil.java +++ b/src/main/java/gregtech/api/util/GTStreamUtil.java @@ -9,7 +9,7 @@ import javax.annotation.ParametersAreNonnullByDefault; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -public final class GT_StreamUtil { +public final class GTStreamUtil { /** * Backport of {@link Stream#ofNullable}. diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GTStructureUtility.java index 6bbb3e1223..2109a7e75b 100644 --- a/src/main/java/gregtech/api/util/GT_StructureUtility.java +++ b/src/main/java/gregtech/api/util/GTStructureUtility.java @@ -34,26 +34,25 @@ import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; -import com.gtnewhorizon.structurelib.structure.StructureUtility; import com.gtnewhorizon.structurelib.util.ItemStackPredicate; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IHeatingCoil; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.common.blocks.GT_Block_Casings5; -import gregtech.common.blocks.GT_Block_FrameBox; -import gregtech.common.blocks.GT_Cyclotron_Coils; -import gregtech.common.blocks.GT_Item_Machines; +import gregtech.api.metatileentity.implementations.MTETieredMachineBlock; +import gregtech.common.blocks.BlockCasings5; +import gregtech.common.blocks.BlockCyclotronCoils; +import gregtech.common.blocks.BlockFrameBox; +import gregtech.common.blocks.ItemMachines; -public class GT_StructureUtility { +public class GTStructureUtility { // private static final Map<Class<?>, String> customNames = new HashMap<>(); - private GT_StructureUtility() { + private GTStructureUtility() { throw new AssertionError("Not instantiable"); } @@ -61,7 +60,7 @@ public class GT_StructureUtility { return aTile != null && clazz.isInstance(aTile.getMetaTileEntity()); } - public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, + public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGTHatchAdder<T> aHatchAdder, int aTextureIndex, int aDots) { return ofHatchAdder(aHatchAdder, aTextureIndex, StructureLibAPI.getBlockHint(), aDots - 1); } @@ -75,7 +74,7 @@ public class GT_StructureUtility { @Override public boolean check(T t, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); - if (block instanceof GT_Block_FrameBox frameBox) { + if (block instanceof BlockFrameBox frameBox) { int meta = world.getBlockMetadata(x, y, z); Materials material = frameBox.getMaterial(meta); return aFrameMaterial == material; @@ -96,21 +95,21 @@ public class GT_StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { ItemStack tFrameStack = getFrameStack(); - if (!GT_Utility.isStackValid(tFrameStack) + if (!GTUtility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock tFrameStackItem)) return false; return tFrameStackItem .placeBlockAt(tFrameStack, null, world, x, y, z, 6, 0, 0, 0, Items.feather.getDamage(tFrameStack)); } private ItemStack getFrameStack() { - return GT_OreDictUnificator.get(OrePrefixes.frameGt, aFrameMaterial, 1); + return GTOreDictUnificator.get(OrePrefixes.frameGt, aFrameMaterial, 1); } @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { ItemStack tFrameStack = getFrameStack(); - if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) + if (!GTUtility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return BlocksToPlace.errored; return BlocksToPlace.create(tFrameStack); } @@ -133,9 +132,9 @@ public class GT_StructureUtility { AutoPlaceEnvironment env) { if (check(t, world, x, y, z)) return SKIP; ItemStack tFrameStack = getFrameStack(); - if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) + if (!GTUtility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return REJECT; // honestly, this is more like a programming error or pack issue - return StructureUtility.survivalPlaceBlock( + return com.gtnewhorizon.structurelib.structure.StructureUtility.survivalPlaceBlock( tFrameStack, ItemStackPredicate.NBTMode.IGNORE_KNOWN_INSIGNIFICANT_TAGS, null, @@ -151,19 +150,19 @@ public class GT_StructureUtility { }; } - public static <T> GT_HatchElementBuilder<T> buildHatchAdder() { - return GT_HatchElementBuilder.builder(); + public static <T> HatchElementBuilder<T> buildHatchAdder() { + return HatchElementBuilder.builder(); } /** * Completely equivalent to {@link #buildHatchAdder()}, except it plays nicer with type inference when statically * imported */ - public static <T> GT_HatchElementBuilder<T> buildHatchAdder(Class<T> typeToken) { - return GT_HatchElementBuilder.builder(); + public static <T> HatchElementBuilder<T> buildHatchAdder(Class<T> typeToken) { + return HatchElementBuilder.builder(); } - public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, + public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGTHatchAdder<T> aHatchAdder, int aTextureIndex, Block aHintBlock, int aHintMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); @@ -185,7 +184,7 @@ public class GT_StructureUtility { }; } - public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, + public static <T> IStructureElement<T> ofHatchAdder(IGTHatchAdder<T> aHatchAdder, int aTextureIndex, Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, Function<T, Class<? extends IMetaTileEntity>> aMetaId, final IStructureElement.PlaceResult acceptType) { if (aHatchAdder == null) { @@ -217,7 +216,7 @@ public class GT_StructureUtility { AutoPlaceEnvironment env) { Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t); if (clazz == null) return BlocksToPlace.createEmpty(); - return BlocksToPlace.create(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))); + return BlocksToPlace.create(is -> clazz.isInstance(ItemMachines.getMetaTileEntity(is))); } @Override @@ -245,8 +244,8 @@ public class GT_StructureUtility { Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t); if (clazz == null) return REJECT; ItemStack taken = env.getSource() - .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true); - if (GT_Utility.isStackInvalid(taken)) { + .takeOne(is -> clazz.isInstance(ItemMachines.getMetaTileEntity(is)), true); + if (GTUtility.isStackInvalid(taken)) { env.getChatter() .accept( new ChatComponentTranslation( @@ -254,7 +253,7 @@ public class GT_StructureUtility { clazz.getSimpleName())); return REJECT; } - if (StructureUtility + if (com.gtnewhorizon.structurelib.structure.StructureUtility .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) == ACCEPT) return acceptType; return REJECT; @@ -262,7 +261,7 @@ public class GT_StructureUtility { }; } - public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, + public static <T> IStructureElement<T> ofHatchAdder(IGTHatchAdder<T> aHatchAdder, int aTextureIndex, Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, ToIntFunction<T> aMetaId) { if (aHatchAdder == null) { throw new IllegalArgumentException(); @@ -291,7 +290,7 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); + ItemMachines item = (ItemMachines) Item.getItemFromBlock(GregTechAPI.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return BlocksToPlace.createEmpty(); return BlocksToPlace.create( @@ -321,7 +320,7 @@ public class GT_StructureUtility { && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT; - GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); + ItemMachines item = (ItemMachines) Item.getItemFromBlock(GregTechAPI.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return REJECT; ItemStack taken = env.getSource() @@ -329,19 +328,19 @@ public class GT_StructureUtility { ItemStackPredicate.from(item) .setMeta(meta), true); - if (GT_Utility.isStackInvalid(taken)) { + if (GTUtility.isStackInvalid(taken)) { env.getChatter() .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta)); return REJECT; } - return StructureUtility + return com.gtnewhorizon.structurelib.structure.StructureUtility .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) == ACCEPT ? ACCEPT_STOP : REJECT; } }; } - public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int textureIndex, + public static <T> IStructureElement<T> ofHatchAdderOptional(IGTHatchAdder<T> aHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) { return ofHatchAdderOptional( aHatchAdder, @@ -352,7 +351,7 @@ public class GT_StructureUtility { placeCasingMeta); } - public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, + public static <T> IStructureElement<T> ofHatchAdderOptional(IGTHatchAdder<T> aHatchAdder, int aTextureIndex, Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); @@ -384,7 +383,7 @@ public class GT_StructureUtility { public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { if (check(t, world, x, y, z)) return SKIP; - return StructureUtility + return com.gtnewhorizon.structurelib.structure.StructureUtility .survivalPlaceBlock(placeCasing, placeCasingMeta, world, x, y, z, s, actor, chatter); } }; @@ -433,12 +432,12 @@ public class GT_StructureUtility { @Override public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockCasings5, getMetaFromHint(trigger)); + StructureLibAPI.hintParticle(world, x, y, z, GregTechAPI.sBlockCasings5, getMetaFromHint(trigger)); return true; } private int getMetaFromHint(ItemStack trigger) { - return GT_Block_Casings5.getMetaFromCoilHeat(getHeatFromHint(trigger)); + return BlockCasings5.getMetaFromCoilHeat(getHeatFromHint(trigger)); } private HeatingCoilLevel getHeatFromHint(ItemStack trigger) { @@ -448,13 +447,13 @@ public class GT_StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return world.setBlock(x, y, z, GregTech_API.sBlockCasings5, getMetaFromHint(trigger), 3); + return world.setBlock(x, y, z, GregTechAPI.sBlockCasings5, getMetaFromHint(trigger), 3); } @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return BlocksToPlace.create(GregTech_API.sBlockCasings5, getMetaFromHint(trigger)); + return BlocksToPlace.create(GregTechAPI.sBlockCasings5, getMetaFromHint(trigger)); } @Override @@ -477,8 +476,8 @@ public class GT_StructureUtility { boolean isCoil = block instanceof IHeatingCoil && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) == getHeatFromHint(trigger); if (isCoil) return SKIP; - return StructureUtility.survivalPlaceBlock( - GregTech_API.sBlockCasings5, + return com.gtnewhorizon.structurelib.structure.StructureUtility.survivalPlaceBlock( + GregTechAPI.sBlockCasings5, getMetaFromHint(trigger), world, x, @@ -524,9 +523,9 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); - if (block != GregTech_API.sSolenoidCoilCasings) return false; + if (block != GregTechAPI.sSolenoidCoilCasings) return false; - var coils = ((GT_Cyclotron_Coils) GregTech_API.sSolenoidCoilCasings); + var coils = ((BlockCyclotronCoils) GregTechAPI.sSolenoidCoilCasings); Byte existingLevel = aSolenoidTierGetter.apply(t); byte newLevel = (byte) (coils.getVoltageTier(world.getBlockMetadata(x, y, z))); @@ -541,7 +540,7 @@ public class GT_StructureUtility { @Override public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { StructureLibAPI - .hintParticle(world, x, y, z, GregTech_API.sSolenoidCoilCasings, getMetaFromHint(trigger)); + .hintParticle(world, x, y, z, GregTechAPI.sSolenoidCoilCasings, getMetaFromHint(trigger)); return true; } @@ -551,13 +550,13 @@ public class GT_StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return world.setBlock(x, y, z, GregTech_API.sSolenoidCoilCasings, getMetaFromHint(trigger), 3); + return world.setBlock(x, y, z, GregTechAPI.sSolenoidCoilCasings, getMetaFromHint(trigger), 3); } @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return BlocksToPlace.create(GregTech_API.sSolenoidCoilCasings, getMetaFromHint(trigger)); + return BlocksToPlace.create(GregTechAPI.sSolenoidCoilCasings, getMetaFromHint(trigger)); } @Override @@ -578,13 +577,13 @@ public class GT_StructureUtility { AutoPlaceEnvironment env) { Block block = world.getBlock(x, y, z); - boolean isCoil = block == GregTech_API.sSolenoidCoilCasings + boolean isCoil = block == GregTechAPI.sSolenoidCoilCasings && world.getBlockMetadata(x, y, z) == getMetaFromHint(trigger); if (isCoil) return SKIP; - return StructureUtility.survivalPlaceBlock( - GregTech_API.sSolenoidCoilCasings, + return com.gtnewhorizon.structurelib.structure.StructureUtility.survivalPlaceBlock( + GregTechAPI.sSolenoidCoilCasings, getMetaFromHint(trigger), world, x, @@ -600,7 +599,7 @@ public class GT_StructureUtility { @Nonnull public static Predicate<ItemStack> filterByMTEClass(List<? extends Class<? extends IMetaTileEntity>> list) { return is -> { - IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); + IMetaTileEntity tile = ItemMachines.getMetaTileEntity(is); return tile != null && list.stream() .anyMatch(c -> c.isInstance(tile)); }; @@ -609,10 +608,9 @@ public class GT_StructureUtility { @Nonnull public static Predicate<ItemStack> filterByMTETier(int aMinTier, int aMaxTier) { return is -> { - IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); - return tile instanceof GT_MetaTileEntity_TieredMachineBlock - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier <= aMaxTier - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier >= aMinTier; + IMetaTileEntity tile = ItemMachines.getMetaTileEntity(is); + return tile instanceof MTETieredMachineBlock && ((MTETieredMachineBlock) tile).mTier <= aMaxTier + && ((MTETieredMachineBlock) tile).mTier >= aMinTier; }; } } diff --git a/src/main/java/gregtech/api/util/GT_ToolHarvestHelper.java b/src/main/java/gregtech/api/util/GTToolHarvestHelper.java index 4263b77be6..8dd5d6b93c 100644 --- a/src/main/java/gregtech/api/util/GT_ToolHarvestHelper.java +++ b/src/main/java/gregtech/api/util/GTToolHarvestHelper.java @@ -10,7 +10,7 @@ import ic2.core.block.machine.BlockMiningTip; import ic2.core.block.wiring.BlockCable; import ic2.core.crop.BlockCrop; -public class GT_ToolHarvestHelper { +public class GTToolHarvestHelper { public static boolean isAppropriateTool(Block aBlock, byte aMetaData, String... tTools) { diff --git a/src/main/java/gregtech/api/util/GTTooltipDataCache.java b/src/main/java/gregtech/api/util/GTTooltipDataCache.java new file mode 100644 index 0000000000..a26f7a84d8 --- /dev/null +++ b/src/main/java/gregtech/api/util/GTTooltipDataCache.java @@ -0,0 +1,104 @@ +package gregtech.api.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.util.StatCollector; + +import gregtech.GTMod; + +public class GTTooltipDataCache { + + public static class TooltipData { + + public List<String> text; + public List<String> shiftText; + + public TooltipData(List<String> text, List<String> shiftText) { + this.text = text; + this.shiftText = shiftText; + } + } + + private final Map<String, TooltipData> fetchedTooltipData = new HashMap<>(); + + /** + * Returns tooltip data respecting the user's configured verbosity levels, applying any formatting arguments. + * + * @param key the key to lookup + * @param args arguments for string formatting (prefer using positional arguments) + * @return The tooltip data the user asked for + */ + public TooltipData getData(String key, Object... args) { + TooltipData tooltipData = fetchedTooltipData.get(key); + if (tooltipData == null) { + tooltipData = getUncachedTooltipData(key, args); + fetchedTooltipData.put(key, tooltipData); + } + return tooltipData; + } + + /** + * Builds tooltip data respecting the user's configured verbosity levels, applying any formatting arguments. + * + * @param key the key to lookup + * @param args arguments for string formatting (prefer using positional arguments) + * @return The tooltip data the user asked for + */ + public TooltipData getUncachedTooltipData(String key, Object... args) { + List<String> lines = getAllLines(key, args); + int normalLines = lines.size(); + if (Math.max(GTMod.gregtechproxy.mTooltipVerbosity, GTMod.gregtechproxy.mTooltipShiftVerbosity) >= 3) { + lines.addAll(getAllLines(key + ".extended", args)); // Are extended lines enabled? If so add them to the + // lines + } + if (lines.size() == 0) { + lines.add(key); // Fallback in case no lines could be found at all + } + return new TooltipData( + lines.subList(0, getVerbosityIndex(GTMod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), + lines.subList(0, getVerbosityIndex(GTMod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); + } + + /** + * Gets all the lines for the given key and every other subsequent consecutive key with a .n suffix, n in {1,2,3...} + * + * @param key the key to lookup + * @param args arguments for string formatting (prefer using positional arguments) + * @return The lines for the key and all of it's subkeys + */ + private List<String> getAllLines(String key, Object... args) { + List<String> lines = new ArrayList<>(); + String keyToLookup = key; + int i = 1; // First loop has no .number postfix + while (StatCollector.canTranslate(keyToLookup)) { + lines.add(StatCollector.translateToLocalFormatted(keyToLookup, args)); + keyToLookup = key + "." + i++; + } + return lines; + } + + /** + * Determines how many lines from a tooltip to include from the full line list to respect a given verbosity level. + * + * @param tooltipVerbosity the verbosity level we're applying + * @param defaultIndex return if tooltipVerbosity is 2 + * @param maxIndex return if tooltipVerbosity is greater than 2 + * @return verbosity appropriate index + */ + private static int getVerbosityIndex(int tooltipVerbosity, int defaultIndex, int maxIndex) { + int index; + if (tooltipVerbosity < 1) { + index = 0; + } else if (tooltipVerbosity == 1) { + index = 1; + } else if (tooltipVerbosity == 2) { + index = defaultIndex; + } else { + index = maxIndex; + } + return index; + } +} diff --git a/src/main/java/gregtech/api/util/GT_Util.java b/src/main/java/gregtech/api/util/GTUtil.java index cdca6a1b9e..db2a628bbe 100644 --- a/src/main/java/gregtech/api/util/GT_Util.java +++ b/src/main/java/gregtech/api/util/GTUtil.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.util.GT_Utility.filterValidMTEs; +import static gregtech.api.util.GTUtility.filterValidMTEs; import java.util.List; @@ -20,12 +20,12 @@ import net.minecraftforge.common.util.Constants; import gregtech.api.enums.ItemList; import gregtech.api.interfaces.IDataCopyable; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.MTEHatch; +import gregtech.api.metatileentity.implementations.MTEMultiBlockBase; import gregtech.api.multitileentity.interfaces.IMultiTileEntity; -import gregtech.common.items.behaviors.Behaviour_DataOrb; +import gregtech.common.items.behaviors.BehaviourDataOrb; -public class GT_Util { +public class GTUtil { // Last broken tile entity public static final ThreadLocal<TileEntity> LAST_BROKEN_TILEENTITY = new ThreadLocal<>(); @@ -153,7 +153,7 @@ public class GT_Util { world.getBlockMetadata(x, 0, z); aChunk = world.getChunkFromBlockCoords(x, z); if (aChunk == null) { - GT_Log.err.println( + GTLog.err.println( "Some important Chunk does not exist for some reason at Coordinates X: " + x + " and Z: " + z); return false; } @@ -217,11 +217,10 @@ public class GT_Util { return (short) ((aColors >>> 24) & 255); } - public static boolean saveMultiblockInputConfiguration(GT_MetaTileEntity_MultiBlockBase controller, - EntityPlayer player) { + public static boolean saveMultiblockInputConfiguration(MTEMultiBlockBase controller, EntityPlayer player) { NBTTagCompound newTag = new NBTTagCompound(); ItemStack dataOrb = player.getHeldItem(); - if (GT_Utility.isStackInvalid(dataOrb) || !ItemList.Tool_DataOrb.isStackEqual(dataOrb, false, true)) { + if (GTUtility.isStackInvalid(dataOrb) || !ItemList.Tool_DataOrb.isStackEqual(dataOrb, false, true)) { return false; } if (!controller.saveOtherHatchConfiguration(player)) { @@ -245,21 +244,20 @@ public class GT_Util { // TODO this doesn't work for now // newTag.setTag("mDualInputHatches", saveToDataStick(player, controller.mDualInputHatches)); dataOrb.setTagCompound(newTag); - Behaviour_DataOrb.setDataTitle(dataOrb, "Multiblock Hatch Configuration"); - Behaviour_DataOrb.setDataName(dataOrb, String.format("%s configuration saved", count)); + BehaviourDataOrb.setDataTitle(dataOrb, "Multiblock Hatch Configuration"); + BehaviourDataOrb.setDataName(dataOrb, String.format("%s configuration saved", count)); return true; } public static boolean hasMultiblockInputConfiguration(ItemStack dataOrb) { - return !GT_Utility.isStackInvalid(dataOrb) && ItemList.Tool_DataOrb.isStackEqual(dataOrb, false, true) + return !GTUtility.isStackInvalid(dataOrb) && ItemList.Tool_DataOrb.isStackEqual(dataOrb, false, true) && dataOrb.getTagCompound() != null && "MultiblockConfiguration".equals( dataOrb.getTagCompound() .getString("type")); } - public static boolean loadMultiblockInputConfiguration(GT_MetaTileEntity_MultiBlockBase controller, - EntityPlayer player) { + public static boolean loadMultiblockInputConfiguration(MTEMultiBlockBase controller, EntityPlayer player) { ItemStack dataOrb = player.getHeldItem(); if (!hasMultiblockInputConfiguration(dataOrb)) { return false; @@ -297,10 +295,9 @@ public class GT_Util { return true; } - private static NBTTagList saveConfigurationToDataStick(EntityPlayer player, - List<? extends GT_MetaTileEntity_Hatch> hatches) { + private static NBTTagList saveConfigurationToDataStick(EntityPlayer player, List<? extends MTEHatch> hatches) { NBTTagList list = new NBTTagList(); - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { + for (MTEHatch tHatch : filterValidMTEs(hatches)) { if (!(tHatch instanceof IDataCopyable copyable)) { list.appendTag(new NBTTagCompound()); continue; @@ -313,12 +310,12 @@ public class GT_Util { } private static boolean loadConfigurationFromDataStick(NBTTagList list, EntityPlayer player, - List<? extends GT_MetaTileEntity_Hatch> hatches) { + List<? extends MTEHatch> hatches) { if (list == null || list.tagList.isEmpty()) return false; - List<? extends GT_MetaTileEntity_Hatch> validMTEs = filterValidMTEs(hatches); + List<? extends MTEHatch> validMTEs = filterValidMTEs(hatches); int end = Math.min(validMTEs.size(), list.tagCount()); for (int i = 0; i < end; i++) { - GT_MetaTileEntity_Hatch tHatch = validMTEs.get(i); + MTEHatch tHatch = validMTEs.get(i); NBTTagCompound tag = list.getCompoundTagAt(i); if (!(tHatch instanceof IDataCopyable copyable)) { if (tag.hasNoTags()) continue; @@ -331,12 +328,12 @@ public class GT_Util { } private static boolean checkCanLoadConfigurationFromDataStick(NBTTagList list, EntityPlayer player, - List<? extends GT_MetaTileEntity_Hatch> hatches) { + List<? extends MTEHatch> hatches) { if (list == null || list.tagList.isEmpty()) return false; - List<? extends GT_MetaTileEntity_Hatch> validMTEs = filterValidMTEs(hatches); + List<? extends MTEHatch> validMTEs = filterValidMTEs(hatches); int end = Math.min(validMTEs.size(), list.tagCount()); for (int i = 0; i < end; i++) { - GT_MetaTileEntity_Hatch tHatch = validMTEs.get(i); + MTEHatch tHatch = validMTEs.get(i); NBTTagCompound tag = list.getCompoundTagAt(i); if (tag.hasNoTags()) continue; if (!(tHatch instanceof IDataCopyable copyable) || !copyable.getCopiedDataIdentifier(player) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GTUtility.java index 84e67ab728..08a1711b97 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GTUtility.java @@ -1,18 +1,18 @@ package gregtech.api.util; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.COMPASS_DIRECTIONS; -import static gregtech.api.enums.GT_Values.D1; -import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.GT; -import static gregtech.api.enums.GT_Values.L; -import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.GT_Values.NW; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.W; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.COMPASS_DIRECTIONS; +import static gregtech.api.enums.GTValues.D1; +import static gregtech.api.enums.GTValues.E; +import static gregtech.api.enums.GTValues.GT; +import static gregtech.api.enums.GTValues.L; +import static gregtech.api.enums.GTValues.M; +import static gregtech.api.enums.GTValues.NW; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.enums.GTValues.W; import static gregtech.api.enums.Materials.FLUID_MAP; import static gregtech.api.enums.Mods.Translocator; -import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; +import static gregtech.common.UndergroundOil.undergroundOilReadInformation; import static net.minecraftforge.common.util.ForgeDirection.DOWN; import static net.minecraftforge.common.util.ForgeDirection.EAST; import static net.minecraftforge.common.util.ForgeDirection.NORTH; @@ -130,12 +130,12 @@ import cofh.api.energy.IEnergyReceiver; import cofh.api.transport.IItemDuct; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.damagesources.GT_DamageSources; -import gregtech.api.damagesources.GT_DamageSources.DamageSourceHotItem; -import gregtech.api.enchants.Enchantment_Hazmat; -import gregtech.api.enchants.Enchantment_Radioactivity; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.damagesources.GTDamageSources; +import gregtech.api.damagesources.GTDamageSources.DamageSourceHotItem; +import gregtech.api.enchants.EnchantmentHazmat; +import gregtech.api.enchants.EnchantmentRadioactivity; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; @@ -156,20 +156,20 @@ import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.interfaces.tileentity.IUpgradableMachine; -import gregtech.api.items.GT_EnergyArmor_Item; -import gregtech.api.items.GT_Generic_Item; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.GTGenericItem; +import gregtech.api.items.ItemEnergyArmor; +import gregtech.api.items.MetaGeneratedTool; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.net.GT_Packet_Sound; +import gregtech.api.net.GTPacketSound; import gregtech.api.objects.CollectorUtils; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_ItemStack2; +import gregtech.api.objects.GTItemStack; +import gregtech.api.objects.GTItemStack2; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.threads.GT_Runnable_Sound; +import gregtech.api.threads.RunnableSound; import gregtech.api.util.extensions.ArrayExt; -import gregtech.common.GT_Pollution; -import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.Pollution; +import gregtech.common.blocks.BlockOresAbstract; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputOreDict; @@ -182,7 +182,7 @@ import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap; * <p/> * Just a few Utility Functions I use. */ -public class GT_Utility { +public class GTUtility { /** * Formats a number with group separator and at most 2 fraction digits. @@ -195,8 +195,8 @@ public class GT_Utility { */ private static final List<FluidContainerData> sFluidContainerList = new ArrayList<>(); - private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new /* Concurrent */ HashMap<>(); - private static final Map<GT_ItemStack, Map<String, FluidContainerData>> sEmptyContainerToFluidToData = new HashMap<>(); + private static final Map<GTItemStack, FluidContainerData> sFilledContainerToData = new /* Concurrent */ HashMap<>(); + private static final Map<GTItemStack, Map<String, FluidContainerData>> sEmptyContainerToFluidToData = new HashMap<>(); private static final Map<String, List<ItemStack>> sFluidToContainers = new HashMap<>(); /** * Must use {@code Supplier} here because the ore prefixes have not yet been registered at class load time. @@ -205,19 +205,19 @@ public class GT_Utility { private static final Map<Integer, Boolean> sOreTable = new HashMap<>(); public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true, RF_CHECK = false; - public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new /* Concurrent */ HashMap<>(); + public static Map<GTPlayedSound, Integer> sPlayedSoundMap = new /* Concurrent */ HashMap<>(); private static int sBookCount = 0; public static UUID defaultUuid = null; // maybe default non-null? // UUID.fromString("00000000-0000-0000-0000-000000000000"); static { - GregTech_API.sItemStackMappings.add(sFilledContainerToData); - GregTech_API.sItemStackMappings.add(sEmptyContainerToFluidToData); + GregTechAPI.sItemStackMappings.add(sFilledContainerToData); + GregTechAPI.sItemStackMappings.add(sEmptyContainerToFluidToData); // 1 is the magic index to get the cobblestone block. // See: GT_Block_Stones.java, GT_Block_Granites.java Function<Materials, Supplier<ItemStack>> materialToCobble = m -> Suppliers.memoize( - () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m) + () -> GTOreDictUnificator.getOres(OrePrefixes.stone, m) .get(1))::get; sOreToCobble.put(OrePrefixes.oreBlackgranite, materialToCobble.apply(Materials.GraniteBlack)); sOreToCobble.put(OrePrefixes.oreRedgranite, materialToCobble.apply(Materials.GraniteRed)); @@ -303,7 +303,7 @@ public class GT_Utility { if (aPrivate) tField.setAccessible(true); return tField; } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } return null; } @@ -318,7 +318,7 @@ public class GT_Utility { if (aPrivate) tField.setAccessible(true); return tField.get(aObject instanceof Class || aObject instanceof String ? null : aObject); } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } return null; } @@ -359,7 +359,7 @@ public class GT_Utility { if (aPrivate) tMethod.setAccessible(true); return tMethod.invoke(aObject, aParameters); } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } return null; } @@ -374,7 +374,7 @@ public class GT_Utility { aLogErrors, aParameters); } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } return aReplacementObject; } @@ -389,13 +389,13 @@ public class GT_Utility { } catch (Throwable ignored) {} } } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } } else { try { return aClass.getConstructors()[aConstructorIndex].newInstance(aParameters); } catch (Throwable e) { - if (aLogErrors) e.printStackTrace(GT_Log.err); + if (aLogErrors) e.printStackTrace(GTLog.err); } } return aReplacementObject; @@ -423,7 +423,7 @@ public class GT_Utility { if (tPotionHashmap != null) return ((HashMap<?, ?>) tPotionHashmap.get(aPlayer)).get(aPotionIndex) != null; } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return false; } @@ -454,7 +454,7 @@ public class GT_Utility { if (tPotionHashmap != null) ((HashMap<?, ?>) tPotionHashmap.get(aPlayer)).remove(aPotionIndex); } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } @@ -463,10 +463,10 @@ public class GT_Utility { if (aPlayer.isInvisible()) { for (int i = 0; i < 4; i++) { if (aPlayer.inventory.armorInventory[i] != null) { - if (aPlayer.inventory.armorInventory[i].getItem() instanceof GT_EnergyArmor_Item) { - if ((((GT_EnergyArmor_Item) aPlayer.inventory.armorInventory[i].getItem()).mSpecials & 512) + if (aPlayer.inventory.armorInventory[i].getItem() instanceof ItemEnergyArmor) { + if ((((ItemEnergyArmor) aPlayer.inventory.armorInventory[i].getItem()).mSpecials & 512) != 0) { - if (GT_ModHandler.canUseElectricItem(aPlayer.inventory.armorInventory[i], 10000)) { + if (GTModHandler.canUseElectricItem(aPlayer.inventory.armorInventory[i], 10000)) { return true; } } @@ -475,7 +475,7 @@ public class GT_Utility { } } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return false; } @@ -506,7 +506,7 @@ public class GT_Utility { } public static long getAmperageForTier(long voltage, byte tier) { - return ceilDiv(voltage, GT_Values.V[tier]); + return ceilDiv(voltage, GTValues.V[tier]); } /** @@ -516,7 +516,7 @@ public class GT_Utility { if (voltage > V[V.length - 1]) { return voltage; } - return V[GT_Utility.getTier(voltage)]; + return V[GTUtility.getTier(voltage)]; } public static String getColoredTierNameFromVoltage(long voltage) { @@ -524,7 +524,7 @@ public class GT_Utility { } public static String getColoredTierNameFromTier(byte tier) { - return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + EnumChatFormatting.RESET; + return GTValues.TIER_COLORS[tier] + GTValues.VN[tier] + EnumChatFormatting.RESET; } /** @@ -536,11 +536,11 @@ public class GT_Utility { if (tier < 0) { return ""; } else if (tier == 0) { - return " (" + GT_Values.VN[1] + ")"; - } else if (tier >= GT_Values.VN.length - 1) { + return " (" + GTValues.VN[1] + ")"; + } else if (tier >= GTValues.VN.length - 1) { return " (MAX+)"; } - return " (" + GT_Values.VN[tier] + ")"; + return " (" + GTValues.VN[tier] + ")"; } public static void sendChatToPlayer(EntityPlayer aPlayer, String aChatMessage) { @@ -1786,7 +1786,7 @@ public class GT_Utility { } public static boolean areStacksEqualOrNull(ItemStack stack1, ItemStack stack2) { - return (stack1 == null && stack2 == null) || GT_Utility.areStacksEqual(stack1, stack2); + return (stack1 == null && stack2 == null) || GTUtility.areStacksEqual(stack1, stack2); } /** @@ -1820,8 +1820,8 @@ public class GT_Utility { public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return areStacksEqual( - GT_OreDictUnificator.get_nocopy(aStack1), - GT_OreDictUnificator.get_nocopy(aStack2), + GTOreDictUnificator.get_nocopy(aStack1), + GTOreDictUnificator.get_nocopy(aStack2), aIgnoreNBT); } @@ -1846,13 +1846,13 @@ public class GT_Utility { for (FluidContainerData tData : sFluidContainerList) { String fluidName = tData.fluid.getFluid() .getName(); - sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData); + sFilledContainerToData.put(new GTItemStack(tData.filledContainer), tData); Map<String, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData - .get(new GT_ItemStack(tData.emptyContainer)); + .get(new GTItemStack(tData.emptyContainer)); List<ItemStack> tContainers = sFluidToContainers.get(fluidName); if (tFluidToContainer == null) { sEmptyContainerToFluidToData - .put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); + .put(new GTItemStack(tData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); } tFluidToContainer.put(fluidName, tData); if (tContainers == null) { @@ -1867,13 +1867,13 @@ public class GT_Utility { String fluidName = aData.fluid.getFluid() .getName(); sFluidContainerList.add(aData); - sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData); + sFilledContainerToData.put(new GTItemStack(aData.filledContainer), aData); Map<String, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData - .get(new GT_ItemStack(aData.emptyContainer)); + .get(new GTItemStack(aData.emptyContainer)); List<ItemStack> tContainers = sFluidToContainers.get(fluidName); if (tFluidToContainer == null) { sEmptyContainerToFluidToData - .put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); + .put(new GTItemStack(aData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); } tFluidToContainer.put(fluidName, aData); if (tContainers == null) { @@ -1897,7 +1897,7 @@ public class GT_Utility { public static ItemStack fillFluidContainer(FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack) || aFluid == null) return null; - if (GT_ModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) { + if (GTModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) { if (aFluid.amount >= 1000) { return new ItemStack(Items.potionitem, 1, 0); } @@ -1911,7 +1911,7 @@ public class GT_Utility { else((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true); return aStack; } - Map<String, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(aStack)); + Map<String, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get(new GTItemStack(aStack)); if (tFluidToContainer == null) return null; FluidContainerData tData = tFluidToContainer.get( aFluid.getFluid() @@ -1980,7 +1980,7 @@ public class GT_Utility { && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) return aFluid .isFluidEqual(((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); - FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + FluidContainerData tData = sFilledContainerToData.get(new GTItemStack(aStack)); return tData != null && tData.fluid.isFluidEqual(aFluid); } @@ -1989,7 +1989,7 @@ public class GT_Utility { if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) return ((IFluidContainerItem) aStack.getItem()).drain(copyAmount(1, aStack), Integer.MAX_VALUE, true); - FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + FluidContainerData tData = sFilledContainerToData.get(new GTItemStack(aStack)); return tData == null ? null : tData.fluid.copy(); } @@ -1998,7 +1998,7 @@ public class GT_Utility { */ public static ItemStack getContainerForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack)) return null; - FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + FluidContainerData tData = sFilledContainerToData.get(new GTItemStack(aStack)); if (tData != null) return copyAmount(1, tData.emptyContainer); if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { @@ -2036,7 +2036,7 @@ public class GT_Utility { return null; } - int tCapsuleCount = GT_ModHandler.getCapsuleCellContainerCount(aStack); + int tCapsuleCount = GTModHandler.getCapsuleCellContainerCount(aStack); if (tCapsuleCount > 0) return ItemList.Cell_Empty.get(tCapsuleCount); if (ItemList.IC2_ForgeHammer.isStackEqual(aStack) || ItemList.IC2_WireCutter.isStackEqual(aStack)) @@ -2045,9 +2045,9 @@ public class GT_Utility { } public static FluidStack getFluidFromContainerOrFluidDisplay(ItemStack stack) { - FluidStack fluidStack = GT_Utility.getFluidForFilledItem(stack, true); + FluidStack fluidStack = GTUtility.getFluidForFilledItem(stack, true); if (fluidStack == null) { - fluidStack = GT_Utility.getFluidFromDisplayStack(stack); + fluidStack = GTUtility.getFluidFromDisplayStack(stack); } return fluidStack; } @@ -2060,14 +2060,14 @@ public class GT_Utility { Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator = aRecipeList .entrySet() .iterator(); - aOutput = GT_OreDictUnificator.get(aOutput); + aOutput = GTOreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() .matches(aContainer, aInput)) { List<ItemStack> tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) - if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { + if (aOutput == null || areStacksEqual(GTOreDictUnificator.get(tOutput), aOutput)) { tIterator.remove(); rReturn = true; break; @@ -2083,14 +2083,14 @@ public class GT_Utility { boolean rReturn = false; Iterator<Map.Entry<IRecipeInput, RecipeOutput>> tIterator = aRecipeList.entrySet() .iterator(); - aOutput = GT_OreDictUnificator.get(aOutput); + aOutput = GTOreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry<IRecipeInput, RecipeOutput> tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() .matches(aInput)) { List<ItemStack> tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) - if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { + if (aOutput == null || areStacksEqual(GTOreDictUnificator.get(tOutput), aOutput)) { tIterator.remove(); rReturn = true; break; @@ -2105,8 +2105,7 @@ public class GT_Utility { if (aRecipeList == null || aRecipeList.isEmpty()) return; toRemove.entrySet() .removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue()))); - final Map<ItemStack, ItemStack> finalToRemove = Maps - .transformValues(toRemove, GT_OreDictUnificator::get_nocopy); + final Map<ItemStack, ItemStack> finalToRemove = Maps.transformValues(toRemove, GTOreDictUnificator::get_nocopy); aRecipeList.entrySet() .removeIf( @@ -2123,21 +2122,21 @@ public class GT_Utility { return tList.stream() .anyMatch( tOutput -> (aOutput == null - || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput))); + || areStacksEqual(GTOreDictUnificator.get(tOutput), aOutput))); })); } public static boolean addSimpleIC2MachineRecipe(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, NBTTagCompound aNBT, Object... aOutput) { if (isStackInvalid(aInput) || aOutput.length == 0 || aRecipeList == null) return false; - ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput); + ItemData tOreName = GTOreDictUnificator.getAssociation(aInput); for (Object o : aOutput) { if (o == null) { GT_FML_LOGGER.info("EmptyIC2Output!" + aInput.getUnlocalizedName()); return false; } } - ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput); + ItemStack[] tStack = GTOreDictUnificator.getStackArray(true, aOutput); if (tStack.length > 0 && areStacksEqual(aInput, tStack[0])) return false; if (tOreName != null) { if (tOreName.toString() @@ -2156,7 +2155,7 @@ public class GT_Utility { public static ItemStack getWrittenBook(String aMapping, ItemStack aStackToPutNBT) { if (isStringInvalid(aMapping)) return null; - ItemStack rStack = GregTech_API.sBookList.get(aMapping); + ItemStack rStack = GregTechAPI.sBookList.get(aMapping); if (rStack == null) return aStackToPutNBT; if (aStackToPutNBT != null) { aStackToPutNBT.setTagCompound(rStack.getTagCompound()); @@ -2167,23 +2166,23 @@ public class GT_Utility { public static ItemStack getWrittenBook(String aMapping, String aTitle, String aAuthor, String... aPages) { if (isStringInvalid(aMapping)) return null; - ItemStack rStack = GregTech_API.sBookList.get(aMapping); + ItemStack rStack = GregTechAPI.sBookList.get(aMapping); if (rStack != null) return copyAmount(1, rStack); if (isStringInvalid(aTitle) || isStringInvalid(aAuthor) || aPages.length == 0) return null; sBookCount++; rStack = new ItemStack(Items.written_book, 1); NBTTagCompound tNBT = new NBTTagCompound(); - tNBT.setString("title", GT_LanguageManager.addStringLocalization("Book." + aTitle + ".Name", aTitle)); + tNBT.setString("title", GTLanguageManager.addStringLocalization("Book." + aTitle + ".Name", aTitle)); tNBT.setString("author", aAuthor); NBTTagList tNBTList = new NBTTagList(); for (byte i = 0; i < aPages.length; i++) { - aPages[i] = GT_LanguageManager + aPages[i] = GTLanguageManager .addStringLocalization("Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), aPages[i]); if (i < 48) { if (aPages[i].length() < 256) tNBTList.appendTag(new NBTTagString(aPages[i])); - else GT_Log.err.println("WARNING: String for written Book too long! -> " + aPages[i]); + else GTLog.err.println("WARNING: String for written Book too long! -> " + aPages[i]); } else { - GT_Log.err.println("WARNING: Too much Pages for written Book! -> " + aTitle); + GTLog.err.println("WARNING: Too much Pages for written Book! -> " + aTitle); break; } } @@ -2195,14 +2194,14 @@ public class GT_Utility { + " at its creation. Gotta get 'em all!")); tNBT.setTag("pages", tNBTList); rStack.setTagCompound(tNBT); - GT_Log.out.println( - "GT_Mod: Added Book to Book List - Mapping: '" + aMapping + GTLog.out.println( + "GTMod: Added Book to Book List - Mapping: '" + aMapping + "' - Name: '" + aTitle + "' - Author: '" + aAuthor + "'"); - GregTech_API.sBookList.put(aMapping, rStack); + GregTechAPI.sBookList.put(aMapping, rStack); return copyOrNull(rStack); } @@ -2289,8 +2288,8 @@ public class GT_Utility { if (!FMLCommonHandler.instance() .getEffectiveSide() .isClient() || GT.getThePlayer() == null || !GT.getThePlayer().worldObj.isRemote) return false; - if (GregTech_API.sMultiThreadedSounds) new Thread( - new GT_Runnable_Sound( + if (GregTechAPI.sMultiThreadedSounds) new Thread( + new RunnableSound( GT.getThePlayer().worldObj, aX, aY, @@ -2300,7 +2299,7 @@ public class GT_Utility { aSoundStrength, aSoundModulation), "Sound Effect").start(); - else new GT_Runnable_Sound( + else new RunnableSound( GT.getThePlayer().worldObj, aX, aY, @@ -2317,7 +2316,7 @@ public class GT_Utility { if (isStringInvalid(aSoundName) || aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( aWorld, - new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), + new GTPacketSound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), aX, aZ); return true; @@ -2328,13 +2327,7 @@ public class GT_Utility { if (aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( aWorld, - new GT_Packet_Sound( - sound.resourceLocation.toString(), - aSoundStrength, - aSoundModulation, - aX, - (short) aY, - aZ), + new GTPacketSound(sound.resourceLocation.toString(), aSoundStrength, aSoundModulation, aX, (short) aY, aZ), aX, aZ); return true; @@ -2453,14 +2446,14 @@ public class GT_Utility { public static boolean isDebugItem(ItemStack aStack) { return /* ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */ areStacksEqual( - GT_ModHandler.getIC2Item("debug", 1), + GTModHandler.getIC2Item("debug", 1), aStack, true); } public static ItemStack updateItemStack(ItemStack aStack) { - if (isStackValid(aStack) && aStack.getItem() instanceof GT_Generic_Item) - ((GT_Generic_Item) aStack.getItem()).isItemStackUsable(aStack); + if (isStackValid(aStack) && aStack.getItem() instanceof GTGenericItem) + ((GTGenericItem) aStack.getItem()).isItemStackUsable(aStack); return aStack; } @@ -2678,7 +2671,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sFrostHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sFrostHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2689,7 +2682,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sHeatHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sHeatHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2701,7 +2694,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sBioHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sBioHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2712,7 +2705,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sRadioHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sRadioHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2723,7 +2716,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sElectroHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sElectroHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2734,7 +2727,7 @@ public class GT_Utility { for (byte i = 1; i < 5; i++) { ItemStack tStack = aEntity.getEquipmentInSlot(i); - if (!isStackInList(tStack, GregTech_API.sGasHazmatList) && !hasHazmatEnchant(tStack)) { + if (!isStackInList(tStack, GregTechAPI.sGasHazmatList) && !hasHazmatEnchant(tStack)) { return false; } } @@ -2744,27 +2737,27 @@ public class GT_Utility { public static boolean hasHazmatEnchant(ItemStack aStack) { if (aStack == null) return false; Map<Integer, Integer> tEnchantments = EnchantmentHelper.getEnchantments(aStack); - Integer tLevel = tEnchantments.get(Enchantment_Hazmat.INSTANCE.effectId); + Integer tLevel = tEnchantments.get(EnchantmentHazmat.INSTANCE.effectId); return tLevel != null && tLevel >= 1; } public static float getHeatDamageFromItem(ItemStack aStack) { - ItemData tData = GT_OreDictUnificator.getItemData(aStack); + ItemData tData = GTOreDictUnificator.getItemData(aStack); return tData == null ? 0 : (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage) + (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0); } public static int getRadioactivityLevel(ItemStack aStack) { - ItemData tData = GT_OreDictUnificator.getItemData(aStack); + ItemData tData = GTOreDictUnificator.getItemData(aStack); if (tData != null && tData.hasValidMaterialData()) { - if (tData.mMaterial.mMaterial.mEnchantmentArmors instanceof Enchantment_Radioactivity) + if (tData.mMaterial.mMaterial.mEnchantmentArmors instanceof EnchantmentRadioactivity) return tData.mMaterial.mMaterial.mEnchantmentArmorsLevel; - if (tData.mMaterial.mMaterial.mEnchantmentTools instanceof Enchantment_Radioactivity) + if (tData.mMaterial.mMaterial.mEnchantmentTools instanceof EnchantmentRadioactivity) return tData.mMaterial.mMaterial.mEnchantmentToolsLevel; } - return EnchantmentHelper.getEnchantmentLevel(Enchantment_Radioactivity.INSTANCE.effectId, aStack); + return EnchantmentHelper.getEnchantmentLevel(EnchantmentRadioactivity.INSTANCE.effectId, aStack); } public static boolean isImmuneToBreathingGasses(EntityLivingBase aEntity) { @@ -2772,7 +2765,7 @@ public class GT_Utility { } public static boolean applyHeatDamage(EntityLivingBase entity, float damage) { - return applyHeatDamage(entity, damage, GT_DamageSources.getHeatDamage()); + return applyHeatDamage(entity, damage, GTDamageSources.getHeatDamage()); } public static boolean applyHeatDamageFromItem(EntityLivingBase entity, float damage, ItemStack item) { @@ -2788,7 +2781,7 @@ public class GT_Utility { public static boolean applyFrostDamage(EntityLivingBase aEntity, float aDamage) { if (aDamage > 0 && aEntity != null && !isWearingFullFrostHazmat(aEntity)) { - return aEntity.attackEntityFrom(GT_DamageSources.getFrostDamage(), aDamage); + return aEntity.attackEntityFrom(GTDamageSources.getFrostDamage(), aDamage); } return false; } @@ -2796,7 +2789,7 @@ public class GT_Utility { public static boolean applyElectricityDamage(EntityLivingBase aEntity, long aVoltage, long aAmperage) { long aDamage = getTier(aVoltage) * aAmperage * 4; if (aDamage > 0 && aEntity != null && !isWearingFullElectroHazmat(aEntity)) { - return aEntity.attackEntityFrom(GT_DamageSources.getElectricDamage(), aDamage); + return aEntity.attackEntityFrom(GTDamageSources.getElectricDamage(), aDamage); } return false; } @@ -3019,7 +3012,7 @@ public class GT_Utility { } else if (tRawStack != null) { tRealStackSize = tRawStack.stackSize; } - ItemStack tRet = GT_OreDictUnificator.get(true, tRawStack); + ItemStack tRet = GTOreDictUnificator.get(true, tRawStack); if (tRet != null) tRet.stackSize = tRealStackSize; return tRet; } @@ -3063,31 +3056,31 @@ public class GT_Utility { if (aStack == null) return false; if (aSet.contains(aStack)) return true; - return aSet.contains(GT_ItemStack.internalCopyStack(aStack, true)); + return aSet.contains(GTItemStack.internalCopyStack(aStack, true)); } - public static boolean isStackInList(ItemStack aStack, Collection<GT_ItemStack> aList) { + public static boolean isStackInList(ItemStack aStack, Collection<GTItemStack> aList) { if (aStack == null) { return false; } - return isStackInList(new GT_ItemStack(aStack), aList); + return isStackInList(new GTItemStack(aStack), aList); } - public static boolean isStackInList(ItemStack aStack, Set<GT_ItemStack2> aList) { + public static boolean isStackInList(ItemStack aStack, Set<GTItemStack2> aList) { if (aStack == null) { return false; } - return isStackInList(new GT_ItemStack2(aStack), aList); + return isStackInList(new GTItemStack2(aStack), aList); } - public static boolean isStackInList(GT_ItemStack aStack, Collection<GT_ItemStack> aList) { + public static boolean isStackInList(GTItemStack aStack, Collection<GTItemStack> aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GTItemStack(aStack.mItem, aStack.mStackSize, W))); } - public static boolean isStackInList(GT_ItemStack2 aStack, Set<GT_ItemStack2> aList) { + public static boolean isStackInList(GTItemStack2 aStack, Set<GTItemStack2> aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack2(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GTItemStack2(aStack.mItem, aStack.mStackSize, W))); } /** @@ -3104,8 +3097,8 @@ public class GT_Utility { .getMethod("clone") .invoke(aMap); } catch (Throwable e) { - GT_Log.err.println("Failed to clone Map of type " + aMap.getClass()); - e.printStackTrace(GT_Log.err); + GTLog.err.println("Failed to clone Map of type " + aMap.getClass()); + e.printStackTrace(GTLog.err); } } @@ -3175,9 +3168,9 @@ public class GT_Utility { * This checks if the Dimension is really a Dimension and not another Planet or something. Used for my Teleporter. */ public static boolean isRealDimension(int aDimensionID) { - if (aDimensionID <= 1 && aDimensionID >= -1 && !GregTech_API.sDimensionalList.contains(aDimensionID)) + if (aDimensionID <= 1 && aDimensionID >= -1 && !GregTechAPI.sDimensionalList.contains(aDimensionID)) return true; - return !GregTech_API.sDimensionalList.contains(aDimensionID) + return !GregTechAPI.sDimensionalList.contains(aDimensionID) && DimensionManager.isDimensionRegistered(aDimensionID); } @@ -3314,7 +3307,7 @@ public class GT_Utility { tTileEntity = (TileEntity) chamber.getReactor(); } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } rEUAmount += addReactorInfo(tList, tTileEntity); rEUAmount += addAlignmentInfo(tList, tTileEntity); @@ -3380,28 +3373,28 @@ public class GT_Utility { + " -----"); try { tList.add( - GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE + GTUtility.trans("162", "Name: ") + EnumChatFormatting.BLUE + ((tTileEntity instanceof IInventory inv) ? inv.getInventoryName() : tBlock.getUnlocalizedName()) + EnumChatFormatting.RESET - + GT_Utility.trans("163", " MetaData: ") + + GTUtility.trans("163", " MetaData: ") + EnumChatFormatting.AQUA + aWorld.getBlockMetadata(aX, aY, aZ) + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW + GTUtility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + EnumChatFormatting.RESET - + GT_Utility.trans("165", " Blast Resistance: ") + + GTUtility.trans("165", " Blast Resistance: ") + EnumChatFormatting.YELLOW + tBlock .getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ) + EnumChatFormatting.RESET); if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material") + EnumChatFormatting.GOLD + GTUtility.trans("166", "Is valid Beacon Pyramid Material") + EnumChatFormatting.RESET); } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this block's info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } @@ -3413,7 +3406,7 @@ public class GT_Utility { final FluidTankInfo[] tTanks = fluidHandler.getTankInfo(side); if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { tList.add( - GT_Utility.trans("167", "Tank ") + i + GTUtility.trans("167", "Tank ") + i + ": " + EnumChatFormatting.GREEN + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) @@ -3430,7 +3423,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this tile's fluid tank info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3446,21 +3439,21 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this block's debug info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } private static void addPollutionInfo(ArrayList<String> tList, Chunk currentChunk) { - if (GT_Pollution.hasPollution(currentChunk)) { + if (Pollution.hasPollution(currentChunk)) { tList.add( - GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED - + formatNumbers(GT_Pollution.getPollution(currentChunk)) + GTUtility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED + + formatNumbers(Pollution.getPollution(currentChunk)) + EnumChatFormatting.RESET - + GT_Utility.trans("203", " gibbl")); + + GTUtility.trans("203", " gibbl")); } else { tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!") + EnumChatFormatting.GREEN + GTUtility.trans("204", "No Pollution in Chunk! HAYO!") + EnumChatFormatting.RESET); } } @@ -3477,7 +3470,7 @@ public class GT_Utility { + EnumChatFormatting.RESET + " L"); else tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") + EnumChatFormatting.GOLD + GTUtility.trans("201", "Nothing") + EnumChatFormatting.RESET + ": " + EnumChatFormatting.YELLOW @@ -3501,7 +3494,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this leaves' info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3514,28 +3507,28 @@ public class GT_Utility { if (crop.getScanLevel() < 4) crop.setScanLevel((byte) 4); if (crop.getCrop() != null) { tList.add( - GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() + GTUtility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() .name() - + GT_Utility.trans("188", " Growth: ") + + GTUtility.trans("188", " Growth: ") + crop.getGrowth() - + GT_Utility.trans("189", " Gain: ") + + GTUtility.trans("189", " Gain: ") + crop.getGain() - + GT_Utility.trans("190", " Resistance: ") + + GTUtility.trans("190", " Resistance: ") + crop.getResistance()); } tList.add( - GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() - + GT_Utility.trans("192", " Water: ") + GTUtility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() + + GTUtility.trans("192", " Water: ") + crop.getHydrationStorage() - + GT_Utility.trans("193", " Weed-Ex: ") + + GTUtility.trans("193", " Weed-Ex: ") + crop.getWeedExStorage() - + GT_Utility.trans("194", " Scan-Level: ") + + GTUtility.trans("194", " Scan-Level: ") + crop.getScanLevel()); tList.add( - GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() - + GT_Utility.trans("196", " Humidity: ") + GTUtility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() + + GTUtility.trans("196", " Humidity: ") + crop.getHumidity() - + GT_Utility.trans("197", " Air-Quality: ") + + GTUtility.trans("197", " Air-Quality: ") + crop.getAirQuality()); if (crop.getCrop() != null) { final StringBuilder tStringB = new StringBuilder(); @@ -3545,15 +3538,15 @@ public class GT_Utility { .append(tAttribute); } final String tString = tStringB.toString(); - tList.add(GT_Utility.trans("198", "Attributes:") + tString.replaceFirst(",", E)); + tList.add(GTUtility.trans("198", "Attributes:") + tString.replaceFirst(",", E)); tList.add( - GT_Utility.trans("199", "Discovered by: ") + crop.getCrop() + GTUtility.trans("199", "Discovered by: ") + crop.getCrop() .discoveredBy()); } } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this crop's info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3565,7 +3558,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } @@ -3573,13 +3566,13 @@ public class GT_Utility { try { if (tTileEntity instanceof IGregTechTileEntity gtTE) { tList.add( - GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + GTUtility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + gtTE.getOwnerName() + EnumChatFormatting.RESET); } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's owner.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } @@ -3587,31 +3580,31 @@ public class GT_Utility { try { if (tTileEntity instanceof IBasicEnergyContainer energyContainer && energyContainer.getEUCapacity() > 0) { tList.add( - GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED + GTUtility.trans("179", "Max IN: ") + EnumChatFormatting.RED + formatNumbers(energyContainer.getInputVoltage()) + " (" - + GT_Values.VN[getTier(energyContainer.getInputVoltage())] + + GTValues.VN[getTier(energyContainer.getInputVoltage())] + ") " + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") + + GTUtility.trans("182", " EU at ") + EnumChatFormatting.RED + formatNumbers(energyContainer.getInputAmperage()) + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + + GTUtility.trans("183", " A")); tList.add( - GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED + GTUtility.trans("181", "Max OUT: ") + EnumChatFormatting.RED + formatNumbers(energyContainer.getOutputVoltage()) + " (" - + GT_Values.VN[getTier(energyContainer.getOutputVoltage())] + + GTValues.VN[getTier(energyContainer.getOutputVoltage())] + ") " + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") + + GTUtility.trans("182", " EU at ") + EnumChatFormatting.RED + formatNumbers(energyContainer.getOutputAmperage()) + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + + GTUtility.trans("183", " A")); tList.add( - GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN + GTUtility.trans("184", "Energy: ") + EnumChatFormatting.GREEN + formatNumbers(energyContainer.getStoredEU()) + EnumChatFormatting.RESET + " EU / " @@ -3622,7 +3615,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's energy info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } @@ -3637,7 +3630,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's covers.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3659,7 +3652,7 @@ public class GT_Utility { rEUAmount += 400; int tValue = 0; if (0 < (tValue = progress.getMaxProgress())) tList.add( - GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN + GTUtility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN + formatNumbers(progress.getProgress()) + EnumChatFormatting.RESET + " / " @@ -3669,7 +3662,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's progress.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3680,12 +3673,12 @@ public class GT_Utility { if (tTileEntity instanceof IUpgradableMachine upgradableMachine) { rEUAmount += 500; if (upgradableMachine.hasMufflerUpgrade()) tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade") + EnumChatFormatting.GREEN + GTUtility.trans("177", "Has Muffler Upgrade") + EnumChatFormatting.RESET); } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's upgrades.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3696,7 +3689,7 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IEnergyStorage storage) { rEUAmount += 200; tList.add( - GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW + GTUtility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW + formatNumbers(storage.getStored()) + EnumChatFormatting.RESET + " EU / " @@ -3707,7 +3700,7 @@ public class GT_Utility { } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's IC2 energy info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3718,13 +3711,13 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor conductor) { rEUAmount += 200; tList.add( - GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW + GTUtility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW + conductor.getConductionLoss() + EnumChatFormatting.RESET); } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's EU conduction info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3735,24 +3728,24 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IWrenchable wrenchable) { rEUAmount += 100; tList.add( - GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN + GTUtility.trans("171", "Facing: ") + EnumChatFormatting.GREEN + wrenchable.getFacing() + EnumChatFormatting.RESET - + GT_Utility.trans("172", " / Chance: ") + + GTUtility.trans("172", " / Chance: ") + EnumChatFormatting.YELLOW + (wrenchable.getWrenchDropRate() * 100) + EnumChatFormatting.RESET + "%"); tList.add( wrenchable.wrenchCanRemove(aPlayer) - ? EnumChatFormatting.GREEN + GT_Utility.trans("173", "You can remove this with a Wrench") + ? EnumChatFormatting.GREEN + GTUtility.trans("173", "You can remove this with a Wrench") + EnumChatFormatting.RESET - : EnumChatFormatting.RED + GT_Utility.trans("174", "You can NOT remove this with a Wrench") + : EnumChatFormatting.RED + GTUtility.trans("174", "You can NOT remove this with a Wrench") + EnumChatFormatting.RESET); } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's IC@ wrenchability.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3765,14 +3758,14 @@ public class GT_Utility { if (tAlignment != null) { rEUAmount += 100; tList.add( - GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN + GTUtility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN + tAlignment.getExtendedFacing() + EnumChatFormatting.RESET); } } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this device's alignment info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } @@ -3783,7 +3776,7 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.reactor.IReactor reactor) { rEUAmount += 500; tList.add( - GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN + GTUtility.trans("168", "Heat: ") + EnumChatFormatting.GREEN + formatNumbers(reactor.getHeat()) + EnumChatFormatting.RESET + " / " @@ -3791,23 +3784,23 @@ public class GT_Utility { + formatNumbers(reactor.getMaxHeat()) + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW + GTUtility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW + reactor.getHeatEffectModifier() + EnumChatFormatting.RESET); } } catch (Throwable e) { tList.add(String.format("§cAn exception was thrown while fetching this reactor's info.§r")); - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return rEUAmount; } public static String trans(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish); + return GTLanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish); } public static String getTrans(String aKey) { - return GT_LanguageManager.getTranslation("Interaction_DESCRIPTION_Index_" + aKey); + return GTLanguageManager.getTranslation("Interaction_DESCRIPTION_Index_" + aKey); } /** @@ -3925,7 +3918,7 @@ public class GT_Utility { */ public static boolean consumeItems(EntityPlayer player, ItemStack stack, gregtech.api.enums.Materials mat, int count) { - if (stack != null && GT_OreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat + if (stack != null && GTOreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat && stack.stackSize >= count) { if ((!player.capabilities.isCreativeMode) && (stack.stackSize != 111)) stack.stackSize -= count; return true; @@ -4007,11 +4000,11 @@ public class GT_Utility { return -1; } - public static Map<GT_Utility.ItemId, Long> convertItemListToMap(Collection<ItemStack> itemStacks) { - Map<GT_Utility.ItemId, Long> result = new Object2LongOpenHashMap<>(); + public static Map<GTUtility.ItemId, Long> convertItemListToMap(Collection<ItemStack> itemStacks) { + Map<GTUtility.ItemId, Long> result = new Object2LongOpenHashMap<>(); for (ItemStack itemStack : itemStacks) { if (itemStack != null && itemStack.stackSize > 0) { - GT_Utility.ItemId itemId = GT_Utility.ItemId.createNoCopy(itemStack); + GTUtility.ItemId itemId = GTUtility.ItemId.createNoCopy(itemStack); result.merge(itemId, (long) itemStack.stackSize, Long::sum); } } @@ -4361,29 +4354,29 @@ public class GT_Utility { } public static boolean isPartOfMaterials(ItemStack aStack, Materials aMaterials) { - return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); + return GTOreDictUnificator.getAssociation(aStack) != null + && GTOreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); } public static boolean isPartOfOrePrefix(ItemStack aStack, OrePrefixes aPrefix) { - return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); + return GTOreDictUnificator.getAssociation(aStack) != null + && GTOreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); } public static final ImmutableSet<String> ORE_BLOCK_CLASSES = ImmutableSet.of( - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores", - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres", + "bartworks.system.material.BWMetaGeneratedOres", + "bartworks.system.material.BWMetaGeneratedSmallOres", "gtPlusPlus.core.block.base.BlockBaseOre"); public static boolean isOre(Block aBlock, int aMeta) { - return (aBlock instanceof GT_Block_Ores_Abstract) || isOre(new ItemStack(aBlock, 1, aMeta)) + return (aBlock instanceof BlockOresAbstract) || isOre(new ItemStack(aBlock, 1, aMeta)) || ORE_BLOCK_CLASSES.contains( aBlock.getClass() .getName()); } public static boolean isOre(ItemStack aStack) { - int tItem = GT_Utility.stackToInt(aStack); + int tItem = GTUtility.stackToInt(aStack); if (sOreTable.containsKey(tItem)) { return sOreTable.get(tItem); } @@ -4407,7 +4400,7 @@ public class GT_Utility { // We take the modulus of the metadata by 16000 because that is the magic number to convert small ores to // regular ores. // See: GT_TileEntity_Ores.java - ItemData association = GT_OreDictUnificator + ItemData association = GTOreDictUnificator .getAssociation(new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000)); if (association != null) { Supplier<ItemStack> supplier = sOreToCobble.get(association.mPrefix); @@ -4418,7 +4411,7 @@ public class GT_Utility { return new ItemStack(Blocks.cobblestone); } - public static Optional<GT_Recipe> reverseShapelessRecipe(ItemStack output, Object... aRecipe) { + public static Optional<GTRecipe> reverseShapelessRecipe(ItemStack output, Object... aRecipe) { if (output == null) { return Optional.empty(); } @@ -4430,7 +4423,7 @@ public class GT_Utility { ItemStack toAdd = ((ItemStack) o).copy(); inputs.add(toAdd); } else if (o instanceof String) { - ItemStack stack = GT_OreDictUnificator.get(o, 1); + ItemStack stack = GTOreDictUnificator.get(o, 1); if (stack == null) { Optional<ItemStack> oStack = OreDictionary.getOres((String) o) .stream() @@ -4449,10 +4442,10 @@ public class GT_Utility { else throw new IllegalStateException("A Recipe contains an invalid input! Output: " + output); } - inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); + inputs.removeIf(x -> x.getItem() instanceof MetaGeneratedTool); return Optional.of( - new GT_Recipe( + new GTRecipe( false, new ItemStack[] { output }, inputs.toArray(new ItemStack[0]), @@ -4465,7 +4458,7 @@ public class GT_Utility { 0)); } - public static Optional<GT_Recipe> reverseShapedRecipe(ItemStack output, Object... aRecipe) { + public static Optional<GTRecipe> reverseShapedRecipe(ItemStack output, Object... aRecipe) { if (output == null) { return Optional.empty(); } @@ -4499,7 +4492,7 @@ public class GT_Utility { } else if (o.getKey() instanceof String dictName) { // Do not register tools dictName in inputs if (ToolDictNames.contains(dictName)) continue; - ItemStack stack = GT_OreDictUnificator.get(dictName, null, amount, false, true); + ItemStack stack = GTOreDictUnificator.get(dictName, null, amount, false, true); if (stack == null) { Optional<ItemStack> oStack = OreDictionary.getOres(dictName) .stream() @@ -4521,10 +4514,10 @@ public class GT_Utility { } // Remove tools from inputs in case a recipe has one as a direct Item or ItemStack reference - inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); + inputs.removeIf(x -> x.getItem() instanceof MetaGeneratedTool); return Optional.of( - new GT_Recipe( + new GTRecipe( false, new ItemStack[] { output }, inputs.toArray(new ItemStack[0]), @@ -4603,7 +4596,7 @@ public class GT_Utility { if (itemStack == null) return false; ItemStack tStack = ItemList.Cell_Empty.get(1); tStack.stackSize = itemStack.stackSize; - return GT_Utility.areStacksEqual(itemStack, tStack); + return GTUtility.areStacksEqual(itemStack, tStack); } /** @@ -4745,7 +4738,7 @@ public class GT_Utility { public abstract static class ItemId { public static ItemId create(NBTTagCompound tag) { - return new AutoValue_GT_Utility_ItemId( + return new AutoValue_GTUtility_ItemId( Item.getItemById(tag.getShort("item")), tag.getShort("meta"), tag.hasKey("tag", Constants.NBT.TAG_COMPOUND) ? tag.getCompoundTag("tag") : null); @@ -4760,7 +4753,7 @@ public class GT_Utility { nbt = (NBTTagCompound) nbt.copy(); } - return new AutoValue_GT_Utility_ItemId(itemStack.getItem(), Items.feather.getDamage(itemStack), nbt); + return new AutoValue_GTUtility_ItemId(itemStack.getItem(), Items.feather.getDamage(itemStack), nbt); } /** @@ -4770,28 +4763,28 @@ public class GT_Utility { if (nbt != null) { nbt = (NBTTagCompound) nbt.copy(); } - return new AutoValue_GT_Utility_ItemId(item, metaData, nbt); + return new AutoValue_GTUtility_ItemId(item, metaData, nbt); } /** * This method stores metadata as wildcard and NBT as null. */ public static ItemId createAsWildcard(ItemStack itemStack) { - return new AutoValue_GT_Utility_ItemId(itemStack.getItem(), W, null); + return new AutoValue_GTUtility_ItemId(itemStack.getItem(), W, null); } /** * This method stores NBT as null. */ public static ItemId createWithoutNBT(ItemStack itemStack) { - return new AutoValue_GT_Utility_ItemId(itemStack.getItem(), Items.feather.getDamage(itemStack), null); + return new AutoValue_GTUtility_ItemId(itemStack.getItem(), Items.feather.getDamage(itemStack), null); } /** * This method does not copy NBT in order to save time. Make sure not to mutate it! */ public static ItemId createNoCopy(ItemStack itemStack) { - return new AutoValue_GT_Utility_ItemId( + return new AutoValue_GTUtility_ItemId( itemStack.getItem(), Items.feather.getDamage(itemStack), itemStack.getTagCompound()); @@ -4801,7 +4794,7 @@ public class GT_Utility { * This method does not copy NBT in order to save time. Make sure not to mutate it! */ public static ItemId createNoCopy(Item item, int metaData, @Nullable NBTTagCompound nbt) { - return new AutoValue_GT_Utility_ItemId(item, metaData, nbt); + return new AutoValue_GTUtility_ItemId(item, metaData, nbt); } protected abstract Item item(); @@ -4833,7 +4826,7 @@ public class GT_Utility { public static int getPlasmaFuelValueInEUPerLiterFromFluid(FluidStack aLiquid) { if (aLiquid == null) return 0; - GT_Recipe tFuel = RecipeMaps.plasmaFuels.getBackend() + GTRecipe tFuel = RecipeMaps.plasmaFuels.getBackend() .findFuel(aLiquid); if (tFuel != null) return tFuel.mSpecialValue; return 0; diff --git a/src/main/java/gregtech/api/util/GT_UtilityClient.java b/src/main/java/gregtech/api/util/GTUtilityClient.java index 398c1f6b41..a6039e10d3 100644 --- a/src/main/java/gregtech/api/util/GT_UtilityClient.java +++ b/src/main/java/gregtech/api/util/GTUtilityClient.java @@ -13,7 +13,7 @@ import com.google.common.collect.Lists; import cpw.mods.fml.relauncher.ReflectionHelper; -public class GT_UtilityClient { +public class GTUtilityClient { private static final Field isDrawingField = ReflectionHelper .findField(Tessellator.class, "isDrawing", "field_78415_z"); diff --git a/src/main/java/gregtech/api/util/GT_Waila.java b/src/main/java/gregtech/api/util/GTWaila.java index aaa68ba4c7..a52dd2e459 100644 --- a/src/main/java/gregtech/api/util/GT_Waila.java +++ b/src/main/java/gregtech/api/util/GTWaila.java @@ -1,6 +1,6 @@ package gregtech.api.util; -public abstract class GT_Waila { +public abstract class GTWaila { public static String getMachineProgressString(boolean isActive, int maxProgresstime, int progresstime) { return getMachineProgressString(isActive, (long) maxProgresstime, (long) progresstime); @@ -15,7 +15,7 @@ public abstract class GT_Waila { .append("s / ") .append(String.format("%,.2f", (double) maxProgresstime / 20)) .append("s (") - .append(GT_Utility.formatNumbers((Math.round((double) progresstime / maxProgresstime * 1000) / 10.0))) + .append(GTUtility.formatNumbers((Math.round((double) progresstime / maxProgresstime * 1000) / 10.0))) .append("%)"); return ret.toString(); diff --git a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java deleted file mode 100644 index d59796b251..0000000000 --- a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java +++ /dev/null @@ -1,114 +0,0 @@ -package gregtech.api.util; - -import static gregtech.api.util.GT_Utility.filterValidMTEs; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; - -public class GT_ExoticEnergyInputHelper { - - /** - * The Valid Types of TecTech Hatch List. - */ - private static final List<Class<? extends GT_MetaTileEntity_Hatch>> sExoticEnergyHatchType = new ArrayList<>(); - - static { - tryRegister("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); - tryRegister("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel"); - } - - public static void register(Class<? extends GT_MetaTileEntity_Hatch> clazz) { - if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); - sExoticEnergyHatchType.add(clazz); - } - - @SuppressWarnings("unchecked") - public static void tryRegister(String className) { - Class<?> clazz; - try { - clazz = Class.forName(className); - } catch (ClassNotFoundException e) { - return; - } - if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); - sExoticEnergyHatchType.add((Class<? extends GT_MetaTileEntity_Hatch>) clazz); - } - - public static boolean drainEnergy(long aEU, Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - for (GT_MetaTileEntity_Hatch tHatch : hatches) { - long tDrain = Math.min( - tHatch.getBaseMetaTileEntity() - .getStoredEU(), - aEU); - tHatch.getBaseMetaTileEntity() - .decreaseStoredEnergyUnits(tDrain, false); - aEU -= tDrain; - } - return aEU <= 0; - } - - public static boolean isExoticEnergyInput(IMetaTileEntity aHatch) { - for (Class<?> clazz : sExoticEnergyHatchType) { - if (clazz.isInstance(aHatch)) return true; - } - return false; - } - - public static long getTotalEuMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - long rEU = 0L; - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { - rEU += tHatch.getBaseMetaTileEntity() - .getInputVoltage() * tHatch.maxWorkingAmperesIn(); - } - return rEU; - } - - public static long getMaxInputVoltageMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - long rVoltage = 0; - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { - rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); - } - return rVoltage; - } - - public static long getAverageInputVoltageMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - long rVoltage = 0; - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { - rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); - } - if (hatches.isEmpty()) { - return 0; - } - return rVoltage / hatches.size(); - } - - public static long getMaxInputAmpsMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - long rAmp = 0; - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { - rAmp += tHatch.getBaseMetaTileEntity() - .getInputAmperage(); - } - return rAmp; - } - - public static long getMaxWorkingInputAmpsMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) { - long rAmp = 0; - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(hatches)) { - rAmp += tHatch.maxWorkingAmperesIn(); - } - return rAmp; - } - - public static List<Class<? extends GT_MetaTileEntity_Hatch>> getAllClasses() { - return Collections.unmodifiableList(sExoticEnergyHatchType); - } -} diff --git a/src/main/java/gregtech/api/util/GT_StructureUtilityMuTE.java b/src/main/java/gregtech/api/util/GT_StructureUtilityMuTE.java index a4c4630209..3efbebdcbf 100644 --- a/src/main/java/gregtech/api/util/GT_StructureUtilityMuTE.java +++ b/src/main/java/gregtech/api/util/GT_StructureUtilityMuTE.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import static gregtech.api.multitileentity.enums.GT_MultiTileComponentCasing.*; import static gregtech.api.multitileentity.enums.GT_MultiTileUpgradeCasing.*; import static gregtech.loaders.preload.GT_Loader_MultiTileEntities.*; @@ -16,7 +16,7 @@ import net.minecraft.world.World; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureElement; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.multitileentity.MultiTileEntityBlock; @@ -220,7 +220,7 @@ public class GT_StructureUtilityMuTE { public static class MuTEStructureCasing { private String registryName; - private int registryId = GT_Values.W; + private int registryId = GTValues.W; private final int defaultMeta; private final Integer[] validIds; @@ -253,7 +253,7 @@ public class GT_StructureUtilityMuTE { public int getRegistryId() { // TODO: MuTE registry seems to somehow shift, probably due to NBT shenanigans. Lazy init circumvents this // but it should be properly fixed in the future - if (registryId == GT_Values.W) { + if (registryId == GTValues.W) { MultiTileEntityRegistry registry = MultiTileEntityRegistry.getRegistry(registryName); registryId = Block.getIdFromBlock(registry.getBlock()); } diff --git a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java index 431ef34fa4..6b42a8e7fa 100644 --- a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java +++ b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java @@ -7,7 +7,7 @@ import java.util.Map; import net.minecraft.util.StatCollector; -import gregtech.GT_Mod; +import gregtech.GTMod; public class GT_TooltipDataCache { @@ -50,7 +50,7 @@ public class GT_TooltipDataCache { public TooltipData getUncachedTooltipData(String key, Object... args) { List<String> lines = getAllLines(key, args); int normalLines = lines.size(); - if (Math.max(GT_Mod.gregtechproxy.mTooltipVerbosity, GT_Mod.gregtechproxy.mTooltipShiftVerbosity) >= 3) { + if (Math.max(GTMod.gregtechproxy.mTooltipVerbosity, GTMod.gregtechproxy.mTooltipShiftVerbosity) >= 3) { lines.addAll(getAllLines(key + ".extended", args)); // Are extended lines enabled? If so add them to the // lines } @@ -58,9 +58,8 @@ public class GT_TooltipDataCache { lines.add(key); // Fallback in case no lines could be found at all } return new TooltipData( - lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), - lines - .subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); + lines.subList(0, getVerbosityIndex(GTMod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), + lines.subList(0, getVerbosityIndex(GTMod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); } /** diff --git a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java b/src/main/java/gregtech/api/util/HatchElementBuilder.java index 416edc9c11..8b93861114 100644 --- a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java +++ b/src/main/java/gregtech/api/util/HatchElementBuilder.java @@ -33,7 +33,6 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.IStructureElementChain; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; -import com.gtnewhorizon.structurelib.structure.StructureUtility; import com.gtnewhorizon.structurelib.util.ItemStackPredicate; import gnu.trove.TIntCollection; @@ -42,14 +41,14 @@ import gnu.trove.set.hash.TIntHashSet; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.common.blocks.GT_Item_Machines; +import gregtech.common.blocks.ItemMachines; -public class GT_HatchElementBuilder<T> { +public class HatchElementBuilder<T> { private interface Builtin { } - private IGT_HatchAdder<? super T> mAdder; + private IGTHatchAdder<? super T> mAdder; private int mCasingIndex = -1; private int mDot = -1; private BiPredicate<? super T, ? super IGregTechTileEntity> mShouldSkip; @@ -61,10 +60,10 @@ public class GT_HatchElementBuilder<T> { private boolean mExclusive; private EnumSet<ForgeDirection> mDisallowedDirection = EnumSet.noneOf(ForgeDirection.class); - private GT_HatchElementBuilder() {} + private HatchElementBuilder() {} - public static <T> GT_HatchElementBuilder<T> builder() { - return new GT_HatchElementBuilder<>(); + public static <T> HatchElementBuilder<T> builder() { + return new HatchElementBuilder<>(); } // region composite @@ -73,14 +72,14 @@ public class GT_HatchElementBuilder<T> { * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip. TODO add doc */ @SafeVarargs - public final GT_HatchElementBuilder<T> anyOf(IHatchElement<? super T>... elements) { + public final HatchElementBuilder<T> anyOf(IHatchElement<? super T>... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return adder( Arrays.stream(elements) .map( e -> e.adder() .rebrand()) - .reduce(IGT_HatchAdder::orElse) + .reduce(IGTHatchAdder::orElse) .get()).hatchClasses( Arrays.stream(elements) .map(IHatchElement::mteClasses) @@ -99,7 +98,7 @@ public class GT_HatchElementBuilder<T> { * Will rotate through all elements TODO add doc */ @SafeVarargs - public final GT_HatchElementBuilder<T> atLeast(IHatchElement<? super T>... elements) { + public final HatchElementBuilder<T> atLeast(IHatchElement<? super T>... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return atLeast( Arrays.stream(elements) @@ -111,7 +110,7 @@ public class GT_HatchElementBuilder<T> { * <p> * Will rotate through all elements TODO add doc */ - public final GT_HatchElementBuilder<T> atLeastList(List<IHatchElement<? super T>> elements) { + public final HatchElementBuilder<T> atLeastList(List<IHatchElement<? super T>> elements) { if (elements == null || elements.isEmpty()) throw new IllegalArgumentException(); return atLeast( elements.stream() @@ -121,7 +120,7 @@ public class GT_HatchElementBuilder<T> { /** * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip. TODO add doc */ - public final GT_HatchElementBuilder<T> atLeast(Map<IHatchElement<? super T>, ? extends Number> elements) { + public final HatchElementBuilder<T> atLeast(Map<IHatchElement<? super T>, ? extends Number> elements) { if (elements == null || elements.isEmpty() || elements.containsKey(null) || elements.containsValue(null)) throw new IllegalArgumentException(); List<Class<? extends IMetaTileEntity>> list = elements.keySet() @@ -136,10 +135,10 @@ public class GT_HatchElementBuilder<T> { .map( e -> e.adder() .rebrand()) - .reduce(IGT_HatchAdder::orElse) + .reduce(IGTHatchAdder::orElse) .orElseThrow(AssertionError::new)) .hatchItemFilter( - obj -> GT_StructureUtility.filterByMTEClass( + obj -> GTStructureUtility.filterByMTEClass( elements.entrySet() .stream() .filter( @@ -183,30 +182,30 @@ public class GT_HatchElementBuilder<T> { * element * to be non-exclusive. */ - public GT_HatchElementBuilder<T> exclusive() { + public HatchElementBuilder<T> exclusive() { mExclusive = true; return this; } - public GT_HatchElementBuilder<T> adder(IGT_HatchAdder<? super T> aAdder) { + public HatchElementBuilder<T> adder(IGTHatchAdder<? super T> aAdder) { if (aAdder == null) throw new IllegalArgumentException(); mAdder = aAdder; return this; } - public GT_HatchElementBuilder<T> casingIndex(int aCasingIndex) { + public HatchElementBuilder<T> casingIndex(int aCasingIndex) { if (aCasingIndex <= 0) throw new IllegalArgumentException(); mCasingIndex = aCasingIndex; return this; } - public GT_HatchElementBuilder<T> dot(int aDot) { + public HatchElementBuilder<T> dot(int aDot) { if (aDot <= 0) throw new IllegalArgumentException(); mDot = aDot; return this; } - public GT_HatchElementBuilder<T> shouldSkip(BiPredicate<? super T, ? super IGregTechTileEntity> aShouldSkip) { + public HatchElementBuilder<T> shouldSkip(BiPredicate<? super T, ? super IGregTechTileEntity> aShouldSkip) { if (!(aShouldSkip instanceof Builtin) || mShouldSkip != null) { if (!(mShouldSkip instanceof Builtin) && mShouldSkip != null) throw new IllegalStateException(); if (aShouldSkip == null) throw new IllegalArgumentException(); @@ -215,20 +214,20 @@ public class GT_HatchElementBuilder<T> { return this; } - public GT_HatchElementBuilder<T> shouldReject(Predicate<? super T> aShouldReject) { + public HatchElementBuilder<T> shouldReject(Predicate<? super T> aShouldReject) { if (aShouldReject == null) throw new IllegalArgumentException(); mReject = aShouldReject; return this; } - public GT_HatchElementBuilder<T> hatchItemFilter( + public HatchElementBuilder<T> hatchItemFilter( Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = (t, s) -> aHatchItemFilter.apply(t); return this; } - public GT_HatchElementBuilder<T> hatchItemFilterAnd( + public HatchElementBuilder<T> hatchItemFilterAnd( Function<? super T, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> tOldFilter = mHatchItemFilter; @@ -237,14 +236,14 @@ public class GT_HatchElementBuilder<T> { return this; } - public GT_HatchElementBuilder<T> hatchItemFilter( + public HatchElementBuilder<T> hatchItemFilter( BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = aHatchItemFilter; return this; } - public GT_HatchElementBuilder<T> hatchItemFilterAnd( + public HatchElementBuilder<T> hatchItemFilterAnd( BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction<? super T, ItemStack, ? extends Predicate<ItemStack>> tOldFilter = mHatchItemFilter; @@ -254,33 +253,33 @@ public class GT_HatchElementBuilder<T> { } // region hint - public GT_HatchElementBuilder<T> hint(Supplier<String> aSupplier) { + public HatchElementBuilder<T> hint(Supplier<String> aSupplier) { if (aSupplier == null) throw new IllegalArgumentException(); mHatchItemType = aSupplier; mCacheHint = false; return this; } - public GT_HatchElementBuilder<T> cacheHint(Supplier<String> aSupplier) { + public HatchElementBuilder<T> cacheHint(Supplier<String> aSupplier) { if (aSupplier == null) throw new IllegalArgumentException(); mHatchItemType = aSupplier; mCacheHint = true; return this; } - public GT_HatchElementBuilder<T> cacheHint() { + public HatchElementBuilder<T> cacheHint() { if (mHatchItemType == null) throw new IllegalStateException(); mCacheHint = true; return this; } // endregion - public GT_HatchElementBuilder<T> continueIfSuccess() { + public HatchElementBuilder<T> continueIfSuccess() { mNoStop = true; return this; } - public GT_HatchElementBuilder<T> stopIfSuccess() { + public HatchElementBuilder<T> stopIfSuccess() { mNoStop = false; return this; } @@ -295,7 +294,7 @@ public class GT_HatchElementBuilder<T> { * * @param facings disallowed direction in ABC coordinate system */ - public GT_HatchElementBuilder<T> disallowOnly(ForgeDirection... facings) { + public HatchElementBuilder<T> disallowOnly(ForgeDirection... facings) { if (facings == null) throw new IllegalArgumentException(); mDisallowedDirection = EnumSet.copyOf(Arrays.asList(facings)); return this; @@ -311,7 +310,7 @@ public class GT_HatchElementBuilder<T> { * * @param facings allowed direction in ABC coordinate system */ - public GT_HatchElementBuilder<T> allowOnly(ForgeDirection... facings) { + public HatchElementBuilder<T> allowOnly(ForgeDirection... facings) { if (facings == null) throw new IllegalArgumentException(); mDisallowedDirection = EnumSet.complementOf(EnumSet.copyOf(Arrays.asList(facings))); mDisallowedDirection.remove(ForgeDirection.UNKNOWN); @@ -320,8 +319,8 @@ public class GT_HatchElementBuilder<T> { // endregion // region intermediate - public GT_HatchElementBuilder<T> hatchClass(Class<? extends IMetaTileEntity> clazz) { - return hatchItemFilter(c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))) + public HatchElementBuilder<T> hatchClass(Class<? extends IMetaTileEntity> clazz) { + return hatchItemFilter(c -> is -> clazz.isInstance(ItemMachines.getMetaTileEntity(is))) .cacheHint(() -> "of class " + clazz.getSimpleName()) .shouldSkip( (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> clazz @@ -329,13 +328,13 @@ public class GT_HatchElementBuilder<T> { } @SafeVarargs - public final GT_HatchElementBuilder<T> hatchClasses(Class<? extends IMetaTileEntity>... classes) { + public final HatchElementBuilder<T> hatchClasses(Class<? extends IMetaTileEntity>... classes) { return hatchClasses(Arrays.asList(classes)); } - public final GT_HatchElementBuilder<T> hatchClasses(List<? extends Class<? extends IMetaTileEntity>> classes) { + public final HatchElementBuilder<T> hatchClasses(List<? extends Class<? extends IMetaTileEntity>> classes) { List<? extends Class<? extends IMetaTileEntity>> list = new ArrayList<>(classes); - return hatchItemFilter(obj -> GT_StructureUtility.filterByMTEClass(list)).cacheHint( + return hatchItemFilter(obj -> GTStructureUtility.filterByMTEClass(list)).cacheHint( () -> list.stream() .map(Class::getSimpleName) .sorted() @@ -345,21 +344,21 @@ public class GT_HatchElementBuilder<T> { .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity()))); } - public GT_HatchElementBuilder<T> hatchId(int aId) { + public HatchElementBuilder<T> hatchId(int aId) { return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines - && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId) - .shouldSkip( - (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null - && t.getMetaTileID() == aId); + c -> is -> GTUtility.isStackValid(is) && is.getItem() instanceof ItemMachines && is.getItemDamage() == aId) + .cacheHint(() -> "of id " + aId) + .shouldSkip( + (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null + && t.getMetaTileID() == aId); } - public GT_HatchElementBuilder<T> hatchIds(int... aIds) { + public HatchElementBuilder<T> hatchIds(int... aIds) { if (aIds == null || aIds.length == 0) throw new IllegalArgumentException(); if (aIds.length == 1) return hatchId(aIds[0]); TIntCollection coll = aIds.length < 16 ? new TIntArrayList(aIds) : new TIntHashSet(aIds); return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines + c -> is -> GTUtility.isStackValid(is) && is.getItem() instanceof ItemMachines && coll.contains(is.getItemDamage())).cacheHint( () -> Arrays.stream(coll.toArray()) .sorted() @@ -438,7 +437,7 @@ public class GT_HatchElementBuilder<T> { String tHint = mHatchItemType.get(); if (tHint == null) return "?"; // TODO move this to some .lang instead of half ass it into the crappy gt lang file - tHint = GT_LanguageManager.addStringLocalization("Hatch_Type_" + tHint.replace(' ', '_'), tHint); + tHint = GTLanguageManager.addStringLocalization("Hatch_Type_" + tHint.replace(' ', '_'), tHint); if (mCacheHint) { mHint = tHint; if (mHint != null) @@ -487,13 +486,13 @@ public class GT_HatchElementBuilder<T> { } ItemStack taken = env.getSource() .takeOne(mHatchItemFilter.apply(t, trigger), true); - if (GT_Utility.isStackInvalid(taken)) { + if (GTUtility.isStackInvalid(taken)) { String type = getHint(); env.getChatter() .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_hatch", type)); return PlaceResult.REJECT; } - if (StructureUtility.survivalPlaceBlock( + if (com.gtnewhorizon.structurelib.structure.StructureUtility.survivalPlaceBlock( taken, ItemStackPredicate.NBTMode.IGNORE, null, diff --git a/src/main/java/gregtech/api/util/IGT_HatchAdder.java b/src/main/java/gregtech/api/util/IGTHatchAdder.java index 21796f172e..35a30ad7de 100644 --- a/src/main/java/gregtech/api/util/IGT_HatchAdder.java +++ b/src/main/java/gregtech/api/util/IGTHatchAdder.java @@ -2,7 +2,7 @@ package gregtech.api.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public interface IGT_HatchAdder<T> { +public interface IGTHatchAdder<T> { /** * Callback to add hatch, needs to check if hatch is valid (and add it) @@ -17,12 +17,12 @@ public interface IGT_HatchAdder<T> { * hack to work around java generic issues. */ @SuppressWarnings("unchecked") - default <T2 extends T> IGT_HatchAdder<T2> rebrand() { - return (IGT_HatchAdder<T2>) this; + default <T2 extends T> IGTHatchAdder<T2> rebrand() { + return (IGTHatchAdder<T2>) this; } - default IGT_HatchAdder<T> orElse(IGT_HatchAdder<? super T> fallback) { - return (t, iGregTechTileEntity, aShort) -> IGT_HatchAdder.this.apply(t, iGregTechTileEntity, aShort) + default IGTHatchAdder<T> orElse(IGTHatchAdder<? super T> fallback) { + return (t, iGregTechTileEntity, aShort) -> IGTHatchAdder.this.apply(t, iGregTechTileEntity, aShort) || fallback.apply(t, iGregTechTileEntity, aShort); } } diff --git a/src/main/java/gregtech/api/util/GT_JubilanceMegaApiary.java b/src/main/java/gregtech/api/util/JubilanceMegaApiary.java index f20a58c34a..e24cad6778 100644 --- a/src/main/java/gregtech/api/util/GT_JubilanceMegaApiary.java +++ b/src/main/java/gregtech/api/util/JubilanceMegaApiary.java @@ -5,11 +5,11 @@ import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IJubilanceProvider; -public class GT_JubilanceMegaApiary implements IJubilanceProvider { +public class JubilanceMegaApiary implements IJubilanceProvider { - public static final GT_JubilanceMegaApiary instance = new GT_JubilanceMegaApiary(); + public static final JubilanceMegaApiary instance = new JubilanceMegaApiary(); - protected GT_JubilanceMegaApiary() {} + protected JubilanceMegaApiary() {} @Override public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) { diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java index 2d6712788a..e51f3a0524 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java @@ -36,7 +36,7 @@ import com.gtnewhorizon.structurelib.StructureLibAPI; * <br> * Originally created by kekzdealer */ -public class GT_Multiblock_Tooltip_Builder { +public class MultiblockTooltipBuilder { private static final String TAB = " "; private static final String COLON = ": "; @@ -78,7 +78,7 @@ public class GT_Multiblock_Tooltip_Builder { .mapToObj(i -> StatCollector.translateToLocal("structurelib.blockhint." + i + ".name")) .toArray(String[]::new); - public GT_Multiblock_Tooltip_Builder() { + public MultiblockTooltipBuilder() { iLines = new LinkedList<>(); sLines = new LinkedList<>(); hLines = new LinkedList<>(); @@ -94,7 +94,7 @@ public class GT_Multiblock_Tooltip_Builder { * * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addMachineType(String machine) { + public MultiblockTooltipBuilder addMachineType(String machine) { iLines.add(TT_machineType + COLON + EnumChatFormatting.YELLOW + machine + EnumChatFormatting.RESET); return this; } @@ -105,7 +105,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info The line to be added. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInfo(String info) { + public MultiblockTooltipBuilder addInfo(String info) { iLines.add(info); return this; } @@ -117,7 +117,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInfoAll(String... infoStrings) { + public MultiblockTooltipBuilder addInfoAll(String... infoStrings) { for (String str : infoStrings) { iLines.add(str); } @@ -130,7 +130,7 @@ public class GT_Multiblock_Tooltip_Builder { * * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addSeparator() { + public MultiblockTooltipBuilder addSeparator() { iLines.add("-----------------------------------------"); return this; } @@ -142,7 +142,7 @@ public class GT_Multiblock_Tooltip_Builder { * * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) { + public MultiblockTooltipBuilder addPollutionAmount(int pollution) { iLines.add( TT_causes + COLON + EnumChatFormatting.DARK_PURPLE + pollution + " " + EnumChatFormatting.GRAY + TT_pps); return this; @@ -158,7 +158,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param hollow T/F, adds a (hollow) comment if true * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder beginStructureBlock(int w, int h, int l, boolean hollow) { + public MultiblockTooltipBuilder beginStructureBlock(int w, int h, int l, boolean hollow) { sLines.add( EnumChatFormatting.WHITE + TT_dimensions + COLON @@ -205,7 +205,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param hollow T/F, adds a (hollow) comment if true * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin, + public MultiblockTooltipBuilder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin, int lmax, boolean hollow) { sLines.add( EnumChatFormatting.WHITE + TT_dimensions @@ -249,7 +249,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Positional information. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addController(String info) { + public MultiblockTooltipBuilder addController(String info) { sLines.add(TAB + EnumChatFormatting.WHITE + TT_controller + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -266,7 +266,7 @@ public class GT_Multiblock_Tooltip_Builder { * */ @Deprecated - public GT_Multiblock_Tooltip_Builder addCasingInfo(String casingName, int minCount) { + public MultiblockTooltipBuilder addCasingInfo(String casingName, int minCount) { return addCasingInfoMin(casingName, minCount, false); } @@ -278,7 +278,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param isTiered Flag if this casing accepts multiple tiers (e.g. coils) * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoExactly(String casingName, int count, boolean isTiered) { + public MultiblockTooltipBuilder addCasingInfoExactly(String casingName, int count, boolean isTiered) { return addCasingInfoExactlyColored( casingName, EnumChatFormatting.GRAY, @@ -297,7 +297,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param textColor Color of the casing name text * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoExactlyColored(String casingName, EnumChatFormatting textColor, + public MultiblockTooltipBuilder addCasingInfoExactlyColored(String casingName, EnumChatFormatting textColor, int count, EnumChatFormatting countColor, boolean isTiered) { sLines.add( countColor + TAB @@ -319,7 +319,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param isTiered Flag if this casing accepts multiple tiers (e.g. coils) * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoMin(String casingName, int minCount, boolean isTiered) { + public MultiblockTooltipBuilder addCasingInfoMin(String casingName, int minCount, boolean isTiered) { return addCasingInfoMinColored( casingName, EnumChatFormatting.GRAY, @@ -339,7 +339,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param textColor Color of the casing name text * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoMinColored(String casingName, EnumChatFormatting textColor, + public MultiblockTooltipBuilder addCasingInfoMinColored(String casingName, EnumChatFormatting textColor, int minCount, EnumChatFormatting countColor, boolean isTiered) { sLines.add( countColor + TAB @@ -364,7 +364,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param isTiered Flag if this casing accepts multiple tiers (e.g. coils) * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoRange(String casingName, int minCount, int maxCount, + public MultiblockTooltipBuilder addCasingInfoRange(String casingName, int minCount, int maxCount, boolean isTiered) { return addCasingInfoRangeColored( casingName, @@ -387,7 +387,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param textColor Color of the casing name text * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addCasingInfoRangeColored(String casingName, EnumChatFormatting textColor, + public MultiblockTooltipBuilder addCasingInfoRangeColored(String casingName, EnumChatFormatting textColor, int minCount, int maxCount, EnumChatFormatting countColor, boolean isTiered) { sLines.add( countColor + TAB @@ -413,7 +413,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Positional information. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info) { + public MultiblockTooltipBuilder addOtherStructurePart(String name, String info) { sLines.add(EnumChatFormatting.WHITE + TAB + name + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -425,7 +425,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Positional information. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info) { + public MultiblockTooltipBuilder addMaintenanceHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_maintenancehatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -437,7 +437,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Location where the hatch goes * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info) { + public MultiblockTooltipBuilder addMufflerHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_mufflerhatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -449,7 +449,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Positional information. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info) { + public MultiblockTooltipBuilder addEnergyHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_energyhatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -461,7 +461,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Positional information. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info) { + public MultiblockTooltipBuilder addDynamoHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_dynamohatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -473,7 +473,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Location where the bus goes * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInputBus(String info) { + public MultiblockTooltipBuilder addInputBus(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_inputbus + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -485,7 +485,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Location where the hatch goes * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInputHatch(String info) { + public MultiblockTooltipBuilder addInputHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_inputhatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -497,7 +497,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Location where the bus goes * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOutputBus(String info) { + public MultiblockTooltipBuilder addOutputBus(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_outputbus + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -509,7 +509,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info Location where the bus goes * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOutputHatch(String info) { + public MultiblockTooltipBuilder addOutputHatch(String info) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_outputhatch + COLON + EnumChatFormatting.GRAY + info); return this; } @@ -523,7 +523,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info, int... dots) { + public MultiblockTooltipBuilder addOtherStructurePart(String name, String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + name + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, name); return this; @@ -537,7 +537,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info, int... dots) { + public MultiblockTooltipBuilder addMaintenanceHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_maintenancehatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_maintenancehatch); return this; @@ -551,7 +551,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info, int... dots) { + public MultiblockTooltipBuilder addMufflerHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_mufflerhatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_mufflerhatch); return this; @@ -565,7 +565,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info, int... dots) { + public MultiblockTooltipBuilder addEnergyHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_energyhatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_energyhatch); return this; @@ -579,7 +579,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info, int... dots) { + public MultiblockTooltipBuilder addDynamoHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_dynamohatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_dynamohatch); return this; @@ -593,7 +593,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInputBus(String info, int... dots) { + public MultiblockTooltipBuilder addInputBus(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_inputbus + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_inputbus); return this; @@ -607,7 +607,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addInputHatch(String info, int... dots) { + public MultiblockTooltipBuilder addInputHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_inputhatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_inputhatch); return this; @@ -621,7 +621,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOutputBus(String info, int... dots) { + public MultiblockTooltipBuilder addOutputBus(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_outputbus + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_outputbus); return this; @@ -635,7 +635,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots The valid locations for this part when asked to display hints * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addOutputHatch(String info, int... dots) { + public MultiblockTooltipBuilder addOutputHatch(String info, int... dots) { sLines.add(EnumChatFormatting.WHITE + TAB + TT_outputhatch + COLON + EnumChatFormatting.GRAY + info); for (int dot : dots) hBlocks.put(dot, TT_outputhatch); return this; @@ -648,7 +648,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info The line to be added. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addStructureInfo(String info) { + public MultiblockTooltipBuilder addStructureInfo(String info) { sLines.add(TAB + info); return this; } @@ -661,7 +661,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param purpose the purpose of subchannel * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addSubChannelUsage(String channel, String purpose) { + public MultiblockTooltipBuilder addSubChannelUsage(String channel, String purpose) { sLines.add(TAB + StatCollector.translateToLocalFormatted("GT5U.MBTT.subchannel", channel, purpose)); return this; } @@ -672,7 +672,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param info The line to be added. This should be an entry into minecraft's localization system. * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addStructureHint(String info) { + public MultiblockTooltipBuilder addStructureHint(String info) { hLines.add(StatCollector.translateToLocal(info)); return this; } @@ -685,7 +685,7 @@ public class GT_Multiblock_Tooltip_Builder { * @param dots Possible locations of this block * @return Instance this method was called on. */ - public GT_Multiblock_Tooltip_Builder addStructureHint(String name, int... dots) { + public MultiblockTooltipBuilder addStructureHint(String name, int... dots) { for (int dot : dots) hBlocks.put(dot, StatCollector.translateToLocal(name)); return this; } @@ -697,7 +697,7 @@ public class GT_Multiblock_Tooltip_Builder { * * @param mod Name of the mod that adds this multiblock machine */ - public GT_Multiblock_Tooltip_Builder toolTipFinisher(String mod) { + public MultiblockTooltipBuilder toolTipFinisher(String mod) { iLines.add( TT_hold + " " + EnumChatFormatting.BOLD diff --git a/src/main/java/gregtech/api/util/OutputHatchWrapper.java b/src/main/java/gregtech/api/util/OutputHatchWrapper.java index b2e74d24cf..55f467198a 100644 --- a/src/main/java/gregtech/api/util/OutputHatchWrapper.java +++ b/src/main/java/gregtech/api/util/OutputHatchWrapper.java @@ -8,17 +8,17 @@ import net.minecraftforge.fluids.FluidTankInfo; import org.jetbrains.annotations.NotNull; import gregtech.api.interfaces.fluid.IFluidStore; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.MTEHatchOutput; /** * Wrapper for output hatch to allow multiblocks to apply specific filter. */ public class OutputHatchWrapper implements IFluidStore { - private final GT_MetaTileEntity_Hatch_Output outputHatch; + private final MTEHatchOutput outputHatch; private final Predicate<FluidStack> filter; - public OutputHatchWrapper(GT_MetaTileEntity_Hatch_Output outputHatch, Predicate<FluidStack> filter) { + public OutputHatchWrapper(MTEHatchOutput outputHatch, Predicate<FluidStack> filter) { this.outputHatch = outputHatch; this.filter = filter; } diff --git a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java b/src/main/java/gregtech/api/util/OverclockCalculator.java index 5dda0b5c01..0b27942355 100644 --- a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java +++ b/src/main/java/gregtech/api/util/OverclockCalculator.java @@ -5,7 +5,7 @@ import java.util.function.Supplier; import javax.annotation.Nonnull; -public class GT_OverclockCalculator { +public class OverclockCalculator { // region variables // region basic properties @@ -146,15 +146,15 @@ public class GT_OverclockCalculator { /** * Creates calculator that doesn't do OC at all. Will use recipe duration. */ - public static GT_OverclockCalculator ofNoOverclock(@Nonnull GT_Recipe recipe) { + public static OverclockCalculator ofNoOverclock(@Nonnull GTRecipe recipe) { return ofNoOverclock(recipe.mEUt, recipe.mDuration); } /** * Creates calculator that doesn't do OC at all, with set duration. */ - public static GT_OverclockCalculator ofNoOverclock(long eut, int duration) { - return new GT_OverclockCalculator().setRecipeEUt(eut) + public static OverclockCalculator ofNoOverclock(long eut, int duration) { + return new OverclockCalculator().setRecipeEUt(eut) .setDuration(duration) .setEUt(eut) .setNoOverclock(true); @@ -163,14 +163,14 @@ public class GT_OverclockCalculator { /** * An Overclock helper for calculating overclocks in many different situations */ - public GT_OverclockCalculator() {} + public OverclockCalculator() {} // region setters /** * @param recipeEUt Sets the Recipe's starting voltage */ @Nonnull - public GT_OverclockCalculator setRecipeEUt(long recipeEUt) { + public OverclockCalculator setRecipeEUt(long recipeEUt) { this.recipeEUt = recipeEUt; return this; } @@ -179,7 +179,7 @@ public class GT_OverclockCalculator { * @param machineVoltage Sets the EUt that the machine can use. This is the voltage of the machine */ @Nonnull - public GT_OverclockCalculator setEUt(long machineVoltage) { + public OverclockCalculator setEUt(long machineVoltage) { this.machineVoltage = machineVoltage; return this; } @@ -188,7 +188,7 @@ public class GT_OverclockCalculator { * @param duration Sets the duration of the recipe */ @Nonnull - public GT_OverclockCalculator setDuration(int duration) { + public OverclockCalculator setDuration(int duration) { this.duration = duration; return this; } @@ -197,7 +197,7 @@ public class GT_OverclockCalculator { * @param machineAmperage Sets the Amperage that the machine can support */ @Nonnull - public GT_OverclockCalculator setAmperage(long machineAmperage) { + public OverclockCalculator setAmperage(long machineAmperage) { this.machineAmperage = machineAmperage; return this; } @@ -206,7 +206,7 @@ public class GT_OverclockCalculator { * Enables Perfect OC in calculation */ @Nonnull - public GT_OverclockCalculator enablePerfectOC() { + public OverclockCalculator enablePerfectOC() { this.durationDecreasePerOC = 4; return this; } @@ -215,7 +215,7 @@ public class GT_OverclockCalculator { * Set if we should be calculating overclocking using EBF's perfectOC */ @Nonnull - public GT_OverclockCalculator setHeatOC(boolean heatOC) { + public OverclockCalculator setHeatOC(boolean heatOC) { this.heatOC = heatOC; return this; } @@ -224,7 +224,7 @@ public class GT_OverclockCalculator { * Sets if we should add a heat discount at the end of calculating an overclock, just like the EBF */ @Nonnull - public GT_OverclockCalculator setHeatDiscount(boolean heatDiscount) { + public OverclockCalculator setHeatDiscount(boolean heatDiscount) { this.heatDiscount = heatDiscount; return this; } @@ -233,7 +233,7 @@ public class GT_OverclockCalculator { * Sets the starting heat of the recipe */ @Nonnull - public GT_OverclockCalculator setRecipeHeat(int recipeHeat) { + public OverclockCalculator setRecipeHeat(int recipeHeat) { this.recipeHeat = recipeHeat; return this; } @@ -242,7 +242,7 @@ public class GT_OverclockCalculator { * Sets the heat of the coils on the machine */ @Nonnull - public GT_OverclockCalculator setMachineHeat(int machineHeat) { + public OverclockCalculator setMachineHeat(int machineHeat) { this.machineHeat = machineHeat; return this; } @@ -251,7 +251,7 @@ public class GT_OverclockCalculator { * Sets an EUtDiscount. 0.9 is 10% less energy. 1.1 is 10% more energy */ @Nonnull - public GT_OverclockCalculator setEUtDiscount(float aEUtDiscount) { + public OverclockCalculator setEUtDiscount(float aEUtDiscount) { this.eutDiscount = aEUtDiscount; return this; } @@ -260,7 +260,7 @@ public class GT_OverclockCalculator { * Sets a Speed Boost for the multiblock. 0.9 is 10% faster. 1.1 is 10% slower */ @Nonnull - public GT_OverclockCalculator setSpeedBoost(float aSpeedBoost) { + public OverclockCalculator setSpeedBoost(float aSpeedBoost) { this.speedBoost = aSpeedBoost; return this; } @@ -269,7 +269,7 @@ public class GT_OverclockCalculator { * Sets the parallel that the multiblock uses */ @Nonnull - public GT_OverclockCalculator setParallel(int aParallel) { + public OverclockCalculator setParallel(int aParallel) { this.parallel = aParallel; return this; } @@ -279,7 +279,7 @@ public class GT_OverclockCalculator { * Discount */ @Nonnull - public GT_OverclockCalculator setHeatDiscountMultiplier(float heatDiscountExponent) { + public OverclockCalculator setHeatDiscountMultiplier(float heatDiscountExponent) { this.heatDiscountExponent = heatDiscountExponent; return this; } @@ -288,7 +288,7 @@ public class GT_OverclockCalculator { * Sets the Overclock that should be calculated when a heat OC is applied. */ @Nonnull - public GT_OverclockCalculator setHeatPerfectOC(double heatPerfectOC) { + public OverclockCalculator setHeatPerfectOC(double heatPerfectOC) { if (heatPerfectOC <= 0) throw new IllegalArgumentException("Heat OC can't be a negative number or zero"); this.durationDecreasePerHeatOC = heatPerfectOC; return this; @@ -299,7 +299,7 @@ public class GT_OverclockCalculator { * is also 1(ONE)! */ @Nonnull - public GT_OverclockCalculator setEUtIncreasePerOC(double eutIncreasePerOC) { + public OverclockCalculator setEUtIncreasePerOC(double eutIncreasePerOC) { if (eutIncreasePerOC <= 0) throw new IllegalArgumentException("EUt increase can't be a negative number or zero"); this.eutIncreasePerOC = eutIncreasePerOC; @@ -311,7 +311,7 @@ public class GT_OverclockCalculator { * also 1(ONE)! */ @Nonnull - public GT_OverclockCalculator setDurationDecreasePerOC(double durationDecreasePerOC) { + public OverclockCalculator setDurationDecreasePerOC(double durationDecreasePerOC) { if (durationDecreasePerOC <= 0) throw new IllegalArgumentException("Duration decrease can't be a negative number or zero"); this.durationDecreasePerOC = durationDecreasePerOC; @@ -322,7 +322,7 @@ public class GT_OverclockCalculator { * Set One Tick Discount on EUt based on Duration Decrease Per Overclock. This functions the same as single blocks. */ @Nonnull - public GT_OverclockCalculator setOneTickDiscount(boolean oneTickDiscount) { + public OverclockCalculator setOneTickDiscount(boolean oneTickDiscount) { this.oneTickDiscount = oneTickDiscount; return this; } @@ -332,14 +332,14 @@ public class GT_OverclockCalculator { * fusion reactors. */ @Nonnull - public GT_OverclockCalculator limitOverclockCount(int maxOverclocks) { + public OverclockCalculator limitOverclockCount(int maxOverclocks) { this.limitOverclocks = true; this.maxOverclocks = maxOverclocks; return this; } @Nonnull - public GT_OverclockCalculator setAmperageOC(boolean amperageOC) { + public OverclockCalculator setAmperageOC(boolean amperageOC) { this.amperageOC = amperageOC; return this; } @@ -348,7 +348,7 @@ public class GT_OverclockCalculator { * Set a supplier for calculating custom duration for when its needed under one tick */ @Nonnull - public GT_OverclockCalculator setDurationUnderOneTickSupplier(Supplier<Double> supplier) { + public OverclockCalculator setDurationUnderOneTickSupplier(Supplier<Double> supplier) { this.durationUnderOneTickSupplier = supplier; return this; } @@ -357,7 +357,7 @@ public class GT_OverclockCalculator { * Sets if we should do overclocking or not */ @Nonnull - public GT_OverclockCalculator setNoOverclock(boolean noOverclock) { + public OverclockCalculator setNoOverclock(boolean noOverclock) { this.noOverclock = noOverclock; return this; } @@ -365,7 +365,7 @@ public class GT_OverclockCalculator { /** * Set a supplier for calculating custom EUt increase multipliers for every overclock */ - public GT_OverclockCalculator setEutIncreasePerOCSupplier(Function<Integer, Double> eutIncreasePerOCSupplier) { + public OverclockCalculator setEutIncreasePerOCSupplier(Function<Integer, Double> eutIncreasePerOCSupplier) { this.eutIncreasePerOCSupplier = eutIncreasePerOCSupplier; this.hasAtLeastOneSupplierBeenSet = true; return this; @@ -374,7 +374,7 @@ public class GT_OverclockCalculator { /** * Set a supplier for calculating custom duration decrease multipliers for every overclock */ - public GT_OverclockCalculator setDurationDecreasePerOCSupplier( + public OverclockCalculator setDurationDecreasePerOCSupplier( Function<Integer, Double> durationDecreasePerOCSupplier) { this.durationDecreasePerOCSupplier = durationDecreasePerOCSupplier; this.hasAtLeastOneSupplierBeenSet = true; @@ -384,7 +384,7 @@ public class GT_OverclockCalculator { /** * Set actually performed parallel */ - public GT_OverclockCalculator setCurrentParallel(int currentParallel) { + public OverclockCalculator setCurrentParallel(int currentParallel) { this.currentParallel = currentParallel; // Sets parallel to the actually performed one if machine's parallel is underused. this.parallel = Math.min(parallel, currentParallel); @@ -397,7 +397,7 @@ public class GT_OverclockCalculator { * Call this when all values have been put it. */ @Nonnull - public GT_OverclockCalculator calculate() { + public OverclockCalculator calculate() { if (calculated) { throw new IllegalStateException("Tried to calculate overclocks twice"); } diff --git a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java b/src/main/java/gregtech/api/util/PCBFactoryManager.java index 990e9bd174..2d3efa29d4 100644 --- a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java +++ b/src/main/java/gregtech/api/util/PCBFactoryManager.java @@ -4,7 +4,7 @@ import com.google.common.collect.HashBiMap; import gregtech.api.enums.Materials; -public class GT_PCBFactoryManager { +public class PCBFactoryManager { private static final HashBiMap<Materials, Integer> mPlasticTiers = HashBiMap.create(); public static int mTiersOfPlastics = 0; diff --git a/src/main/java/gregtech/api/util/GT_ParallelHelper.java b/src/main/java/gregtech/api/util/ParallelHelper.java index 157488a8ca..0c995cba7d 100644 --- a/src/main/java/gregtech/api/util/GT_ParallelHelper.java +++ b/src/main/java/gregtech/api/util/ParallelHelper.java @@ -22,7 +22,7 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SingleRecipeCheck; @SuppressWarnings({ "unused", "UnusedReturnValue" }) -public class GT_ParallelHelper { +public class ParallelHelper { private static final double MAX_BATCH_MODE_TICK_TIME = 128; /** @@ -40,7 +40,7 @@ public class GT_ParallelHelper { /** * Recipe used when trying to calculate parallels */ - private GT_Recipe recipe; + private GTRecipe recipe; /** * EUt available to the multiblock (This should be the total eut available) */ @@ -133,16 +133,16 @@ public class GT_ParallelHelper { /** * Method for calculating max parallel from given inputs. */ - private MaxParallelCalculator maxParallelCalculator = GT_Recipe::maxParallelCalculatedByInputs; + private MaxParallelCalculator maxParallelCalculator = GTRecipe::maxParallelCalculatedByInputs; /** * Method for consuming inputs after determining how many parallels it can execute. */ - private InputConsumer inputConsumer = GT_Recipe::consumeInput; + private InputConsumer inputConsumer = GTRecipe::consumeInput; /** * Calculator to use for overclocking */ - private GT_OverclockCalculator calculator; + private OverclockCalculator calculator; @Nonnull private CheckRecipeResult result = CheckRecipeResultRegistry.NONE; @@ -156,13 +156,13 @@ public class GT_ParallelHelper { */ private boolean muteMode = false; - public GT_ParallelHelper() {} + public ParallelHelper() {} /** * Sets machine, with current configuration for void protection mode. */ @Nonnull - public GT_ParallelHelper setMachine(IVoidable machine) { + public ParallelHelper setMachine(IVoidable machine) { return setMachine(machine, machine.protectsExcessItem(), machine.protectsExcessFluid()); } @@ -170,7 +170,7 @@ public class GT_ParallelHelper { * Sets machine, with void protection mode forcibly. */ @Nonnull - public GT_ParallelHelper setMachine(IVoidable machine, boolean protectExcessItem, boolean protectExcessFluid) { + public ParallelHelper setMachine(IVoidable machine, boolean protectExcessItem, boolean protectExcessFluid) { this.protectExcessItem = protectExcessItem; this.protectExcessFluid = protectExcessFluid; this.machine = machine; @@ -181,13 +181,13 @@ public class GT_ParallelHelper { * Sets the recipe, which will be used for the parallel calculation */ @Nonnull - public GT_ParallelHelper setRecipe(@Nonnull GT_Recipe aRecipe) { + public ParallelHelper setRecipe(@Nonnull GTRecipe aRecipe) { recipe = Objects.requireNonNull(aRecipe); return this; } @Nonnull - public GT_ParallelHelper setRecipeLocked(IRecipeLockable singleRecipeMachine, boolean isRecipeLocked) { + public ParallelHelper setRecipeLocked(IRecipeLockable singleRecipeMachine, boolean isRecipeLocked) { this.singleRecipeMachine = singleRecipeMachine; this.isRecipeLocked = isRecipeLocked; return this; @@ -197,7 +197,7 @@ public class GT_ParallelHelper { * Sets the items available for the recipe check */ @Nonnull - public GT_ParallelHelper setItemInputs(ItemStack... aItemInputs) { + public ParallelHelper setItemInputs(ItemStack... aItemInputs) { this.itemInputs = aItemInputs; return this; } @@ -206,7 +206,7 @@ public class GT_ParallelHelper { * Sets the fluid inputs available for the recipe check */ @Nonnull - public GT_ParallelHelper setFluidInputs(FluidStack... aFluidInputs) { + public ParallelHelper setFluidInputs(FluidStack... aFluidInputs) { this.fluidInputs = aFluidInputs; return this; } @@ -215,7 +215,7 @@ public class GT_ParallelHelper { * Sets the available eut when trying for more parallels */ @Nonnull - public GT_ParallelHelper setAvailableEUt(long aAvailableEUt) { + public ParallelHelper setAvailableEUt(long aAvailableEUt) { this.availableEUt = aAvailableEUt; return this; } @@ -224,7 +224,7 @@ public class GT_ParallelHelper { * Sets the modifier for recipe eut. 1 does nothing 0.9 is 10% less. 1.1 is 10% more */ @Nonnull - public GT_ParallelHelper setEUtModifier(float aEUtModifier) { + public ParallelHelper setEUtModifier(float aEUtModifier) { this.eutModifier = aEUtModifier; return this; } @@ -234,7 +234,7 @@ public class GT_ParallelHelper { * Only useful for item outputs for sure. */ @Nonnull - public GT_ParallelHelper setChanceMultiplier(double chanceMultiplier) { + public ParallelHelper setChanceMultiplier(double chanceMultiplier) { this.chanceMultiplier = chanceMultiplier; return this; } @@ -243,13 +243,13 @@ public class GT_ParallelHelper { * Sets the item/fluid output multiplier. 1 does nothing. 2 doubles the item and fluid outputs. */ @Nonnull - public GT_ParallelHelper setOutputMultiplier(int outputMultiplier) { + public ParallelHelper setOutputMultiplier(int outputMultiplier) { this.outputMultiplier = outputMultiplier; return this; } @Nonnull - public GT_ParallelHelper setCalculator(GT_OverclockCalculator calculator) { + public ParallelHelper setCalculator(OverclockCalculator calculator) { this.calculator = calculator; return this; } @@ -260,7 +260,7 @@ public class GT_ParallelHelper { * @param consume Should we consume inputs */ @Nonnull - public GT_ParallelHelper setConsumption(boolean consume) { + public ParallelHelper setConsumption(boolean consume) { this.consume = consume; return this; } @@ -269,7 +269,7 @@ public class GT_ParallelHelper { * Sets the MaxParallel a multi can handle */ @Nonnull - public GT_ParallelHelper setMaxParallel(int maxParallel) { + public ParallelHelper setMaxParallel(int maxParallel) { this.maxParallel = maxParallel; return this; } @@ -279,7 +279,7 @@ public class GT_ParallelHelper { * modifier of 1 does nothing */ @Nonnull - public GT_ParallelHelper enableBatchMode(int batchModifier) { + public ParallelHelper enableBatchMode(int batchModifier) { this.batchMode = batchModifier > 1; this.batchModifier = batchModifier; return this; @@ -291,7 +291,7 @@ public class GT_ParallelHelper { * @param calculateOutputs Should we calculate outputs with the helper or not */ @Nonnull - public GT_ParallelHelper setOutputCalculation(boolean calculateOutputs) { + public ParallelHelper setOutputCalculation(boolean calculateOutputs) { this.calculateOutputs = calculateOutputs; return this; } @@ -301,7 +301,7 @@ public class GT_ParallelHelper { * array */ @Nonnull - public GT_ParallelHelper setCustomItemOutputCalculation(Function<Integer, ItemStack[]> custom) { + public ParallelHelper setCustomItemOutputCalculation(Function<Integer, ItemStack[]> custom) { customItemOutputCalculation = custom; return this; } @@ -311,25 +311,25 @@ public class GT_ParallelHelper { * array */ @Nonnull - public GT_ParallelHelper setCustomFluidOutputCalculation(Function<Integer, FluidStack[]> custom) { + public ParallelHelper setCustomFluidOutputCalculation(Function<Integer, FluidStack[]> custom) { customFluidOutputCalculation = custom; return this; } @Nonnull - public GT_ParallelHelper setMuTEMode(boolean muteMode) { + public ParallelHelper setMuTEMode(boolean muteMode) { this.muteMode = muteMode; return this; } @Nonnull - public GT_ParallelHelper setItemInputInventory(ItemInventoryLogic itemInputInventory) { + public ParallelHelper setItemInputInventory(ItemInventoryLogic itemInputInventory) { this.itemInputInventory = itemInputInventory; return this; } @Nonnull - public GT_ParallelHelper setFluidInputInventory(FluidInventoryLogic fluidInputInventory) { + public ParallelHelper setFluidInputInventory(FluidInventoryLogic fluidInputInventory) { this.fluidInputInventory = fluidInputInventory; return this; } @@ -337,7 +337,7 @@ public class GT_ParallelHelper { /** * Sets method for calculating max parallel from given inputs. */ - public GT_ParallelHelper setMaxParallelCalculator(MaxParallelCalculator maxParallelCalculator) { + public ParallelHelper setMaxParallelCalculator(MaxParallelCalculator maxParallelCalculator) { this.maxParallelCalculator = maxParallelCalculator; return this; } @@ -345,19 +345,19 @@ public class GT_ParallelHelper { /** * Sets method for consuming inputs after determining how many parallels it can execute. */ - public GT_ParallelHelper setInputConsumer(InputConsumer inputConsumer) { + public ParallelHelper setInputConsumer(InputConsumer inputConsumer) { this.inputConsumer = inputConsumer; return this; } @Nonnull - public GT_ParallelHelper setItemOutputInventory(ItemInventoryLogic itemOutputInventory) { + public ParallelHelper setItemOutputInventory(ItemInventoryLogic itemOutputInventory) { this.itemOutputInventory = itemOutputInventory; return this; } @Nonnull - public GT_ParallelHelper setFluidOutputInventory(FluidInventoryLogic fluidOutputInventory) { + public ParallelHelper setFluidOutputInventory(FluidInventoryLogic fluidOutputInventory) { this.fluidOutputInventory = fluidOutputInventory; return this; } @@ -366,7 +366,7 @@ public class GT_ParallelHelper { * Finishes the GT_ParallelHelper. Anything changed after this will not effect anything */ @Nonnull - public GT_ParallelHelper build() { + public ParallelHelper build() { if (built) { throw new IllegalStateException("Tried to build twice"); } @@ -455,7 +455,7 @@ public class GT_ParallelHelper { } if (calculator == null) { - calculator = new GT_OverclockCalculator().setEUt(availableEUt) + calculator = new OverclockCalculator().setEUt(availableEUt) .setRecipeEUt(recipe.mEUt) .setDuration(recipe.mDuration) .setEUtDiscount(eutModifier); @@ -472,12 +472,12 @@ public class GT_ParallelHelper { calculator.setParallel(originalMaxParallel); double tickTimeAfterOC = calculator.calculateDurationUnderOneTick(); if (tickTimeAfterOC < 1) { - maxParallel = GT_Utility.safeInt((long) (maxParallel / tickTimeAfterOC), 0); + maxParallel = GTUtility.safeInt((long) (maxParallel / tickTimeAfterOC), 0); } int maxParallelBeforeBatchMode = maxParallel; if (batchMode) { - maxParallel = GT_Utility.safeInt((long) maxParallel * batchModifier, 0); + maxParallel = GTUtility.safeInt((long) maxParallel * batchModifier, 0); } final ItemStack[] truncatedItemOutputs = recipe.mOutputs != null @@ -702,12 +702,12 @@ public class GT_ParallelHelper { @FunctionalInterface public interface MaxParallelCalculator { - double calculate(GT_Recipe recipe, int maxParallel, FluidStack[] fluids, ItemStack[] items); + double calculate(GTRecipe recipe, int maxParallel, FluidStack[] fluids, ItemStack[] items); } @FunctionalInterface public interface InputConsumer { - void consume(GT_Recipe recipe, int amountMultiplier, FluidStack[] aFluidInputs, ItemStack[] aInputs); + void consume(GTRecipe recipe, int amountMultiplier, FluidStack[] aFluidInputs, ItemStack[] aInputs); } } diff --git a/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java b/src/main/java/gregtech/api/util/ProcessingArrayManager.java index ead9393d0e..adbb8f76b8 100644 --- a/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java +++ b/src/main/java/gregtech/api/util/ProcessingArrayManager.java @@ -8,7 +8,7 @@ import gregtech.api.enums.SoundResource; import gregtech.api.recipe.RecipeMap; @Deprecated -public class GT_ProcessingArray_Manager { +public class ProcessingArrayManager { private static final HashMap<String, RecipeMap<?>> mRecipeSaves = new HashMap<>(); private static final HashMap<String, SoundResource> machineSounds = new HashMap<>(); diff --git a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java index aa983a5804..50cad72f9c 100644 --- a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java +++ b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; +import static gregtech.api.util.GTRecipeConstants.FUEL_VALUE; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.semiFluidFuels; import java.util.HashMap; @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMaps; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; @@ -23,9 +23,9 @@ public class SemiFluidFuelHandler { final FluidStack aHeavyOil = FluidUtils.getFluidStack("liquid_heavy_oil", 1000); final HashMap<Integer, Pair<FluidStack, Integer>> aFoundFluidsFromItems = new HashMap<>(); // Find Fluids From items - for (final GT_Recipe r : RecipeMaps.denseLiquidFuels.getAllRecipes()) { + for (final GTRecipe r : RecipeMaps.denseLiquidFuels.getAllRecipes()) { - GT_Recipe g = r.copy(); + GTRecipe g = r.copy(); if (g != null && g.mEnabled && g.mInputs.length > 0 && g.mInputs[0] != null) { for (ItemStack i : g.mInputs) { @@ -71,7 +71,7 @@ public class SemiFluidFuelHandler { if (aFuelValue <= (128 * 3)) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .fluidInputs(p.getKey()) .duration(0) .eut(0) diff --git a/src/main/java/gregtech/api/util/VoidProtectionHelper.java b/src/main/java/gregtech/api/util/VoidProtectionHelper.java index fdf47d06df..cf98e26b66 100644 --- a/src/main/java/gregtech/api/util/VoidProtectionHelper.java +++ b/src/main/java/gregtech/api/util/VoidProtectionHelper.java @@ -397,7 +397,7 @@ public class VoidProtectionHelper { int tSlotsFree = 0; int index = 0; for (ItemStack tItem : itemOutputs) { - // GT_RecipeBuilder doesn't handle null item output + // GTRecipeBuilder doesn't handle null item output if (tItem == null) continue; int itemStackSize = (int) (tItem.stackSize * outputMultiplier * Math.ceil(chanceMultiplier * chanceGetter.apply(index++) / 10000)); diff --git a/src/main/java/gregtech/api/util/item/ItemHolder.java b/src/main/java/gregtech/api/util/item/ItemHolder.java index 4675d0ba0e..51215c93cb 100644 --- a/src/main/java/gregtech/api/util/item/ItemHolder.java +++ b/src/main/java/gregtech/api/util/item/ItemHolder.java @@ -11,7 +11,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class ItemHolder { @@ -67,7 +67,7 @@ public class ItemHolder { @Override public int hashCode() { - return GT_Utility.stackToInt(toStack()); + return GTUtility.stackToInt(toStack()); } @Nonnull diff --git a/src/main/java/gregtech/api/util/recipe/RecipeInputRequirements.java b/src/main/java/gregtech/api/util/recipe/RecipeInputRequirements.java index 590c104101..485ee991c5 100644 --- a/src/main/java/gregtech/api/util/recipe/RecipeInputRequirements.java +++ b/src/main/java/gregtech/api/util/recipe/RecipeInputRequirements.java @@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.item.ItemHolder; public class RecipeInputRequirements { @@ -24,7 +24,7 @@ public class RecipeInputRequirements { protected Set<Fluid> fluidInputsMet = new HashSet<>(); protected boolean metAllFluid = false; - public RecipeInputRequirements(@Nonnull GT_Recipe recipe) { + public RecipeInputRequirements(@Nonnull GTRecipe recipe) { this(recipe.mInputs, recipe.mFluidInputs); } @@ -42,7 +42,7 @@ public class RecipeInputRequirements { } /** - * + * * @param itemInputs we have and want to fill this request * @return {@code true} when all item inputs are met */ @@ -59,7 +59,7 @@ public class RecipeInputRequirements { } /** - * + * * @param fluidInputs we have and want to fill this request * @return {@code true} when all fluid inputs are met */ diff --git a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfFluid.java b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfFluid.java index 0194afbc04..10684f5848 100644 --- a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfFluid.java +++ b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfFluid.java @@ -1,7 +1,7 @@ package gregtech.api.util.shutdown; -import static gregtech.api.util.GT_ModHandler.getWater; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTModHandler.getWater; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.Objects; diff --git a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfItem.java b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfItem.java index 8f51bd83b2..f512e2fa84 100644 --- a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfItem.java +++ b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfItem.java @@ -1,6 +1,6 @@ package gregtech.api.util.shutdown; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.Objects; diff --git a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfStuff.java b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfStuff.java index 72a75b062f..288c733a90 100644 --- a/src/main/java/gregtech/api/util/shutdown/ReasonOutOfStuff.java +++ b/src/main/java/gregtech/api/util/shutdown/ReasonOutOfStuff.java @@ -1,6 +1,6 @@ package gregtech.api.util.shutdown; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.Objects; diff --git a/src/main/java/gregtech/api/util/shutdown/ShutDownReasonRegistry.java b/src/main/java/gregtech/api/util/shutdown/ShutDownReasonRegistry.java index 298c5db237..1cdfb60ddb 100644 --- a/src/main/java/gregtech/api/util/shutdown/ShutDownReasonRegistry.java +++ b/src/main/java/gregtech/api/util/shutdown/ShutDownReasonRegistry.java @@ -1,6 +1,6 @@ package gregtech.api.util.shutdown; -import static gregtech.api.util.GT_ModHandler.getWater; +import static gregtech.api.util.GTModHandler.getWater; import java.util.HashMap; import java.util.Map; |