diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-02 23:17:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-02 23:17:17 +0200 |
commit | 1b820de08a05070909a267e17f033fcf58ac8710 (patch) | |
tree | 02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/gregtech/api | |
parent | afd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff) | |
download | GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2 GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip |
The Great Renaming (#3014)
* move kekztech to a single root dir
* move detrav to a single root dir
* move gtnh-lanthanides to a single root dir
* move tectech and delete some gross reflection in gt++
* remove more reflection inside gt5u
* delete more reflection in gt++
* fix imports
* move bartworks and bwcrossmod
* fix proxies
* move galactigreg and ggfab
* move gtneioreplugin
* try to fix gt++ bee loader
* apply the rename rules to BW
* apply rename rules to bwcrossmod
* apply rename rules to detrav scanner mod
* apply rename rules to galacticgreg
* apply rename rules to ggfab
* apply rename rules to goodgenerator
* apply rename rules to gtnh-lanthanides
* apply rename rules to gt++
* apply rename rules to kekztech
* apply rename rules to kubatech
* apply rename rules to tectech
* apply rename rules to gt
apply the rename rules to gt
* fix tt import
* fix mui hopefully
* fix coremod except intergalactic
* rename assline recipe class
* fix a class name i stumbled on
* rename StructureUtility to GTStructureUtility to prevent conflict with structurelib
* temporary rename of GTTooltipDataCache to old name
* fix gt client/server proxy names
Diffstat (limited to 'src/main/java/gregtech/api')
316 files changed, 5642 insertions, 5681 deletions
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTechAPI.java index 51bf250659..6cabb8e04c 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTechAPI.java @@ -1,6 +1,6 @@ package gregtech.api; -import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GTValues.B; import static gregtech.api.enums.Mods.IndustrialCraft2; import java.util.ArrayList; @@ -37,39 +37,40 @@ import com.google.common.collect.SetMultimap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IDamagableItem; import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.internal.IGT_RecipeAdder; +import gregtech.api.interfaces.internal.IGTRecipeAdder; import gregtech.api.interfaces.internal.IThaumcraftCompat; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; -import gregtech.api.items.GT_CoolantCellIC_Item; -import gregtech.api.items.GT_CoolantCell_Item; -import gregtech.api.items.GT_Tool_Item; +import gregtech.api.items.GTGenericItem; +import gregtech.api.items.ItemCoolantCell; +import gregtech.api.items.ItemCoolantCellIC; +import gregtech.api.items.ItemTool; import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.objects.GT_Cover_Default; -import gregtech.api.objects.GT_Cover_None; -import gregtech.api.objects.GT_HashSet; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.threads.GT_Runnable_Cable_Update; -import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; -import gregtech.api.util.GT_CircuitryBehavior; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_CreativeTab; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.GTCoverDefault; +import gregtech.api.objects.GTCoverNone; +import gregtech.api.objects.GTHashSet; +import gregtech.api.objects.GTItemStack; +import gregtech.api.threads.RunnableCableUpdate; +import gregtech.api.threads.RunnableMachineUpdate; +import gregtech.api.util.CircuitryBehavior; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTCreativeTab; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import gregtech.api.util.item.ItemHolder; -import gregtech.api.world.GT_Worldgen; -import gregtech.common.GT_DummyWorld; -import gregtech.common.items.GT_IntegratedCircuit_Item; +import gregtech.api.world.GTWorldgen; +import gregtech.common.GTDummyWorld; +import gregtech.common.items.ItemIntegratedCircuit; /** * Please do not include this File in your Mod-download as it ruins compatibility, like with the IC2-API You may just @@ -88,14 +89,14 @@ import gregtech.common.items.GT_IntegratedCircuit_Item; * @author Gregorius Techneticies */ @SuppressWarnings("unused") // API class has legitimately unused methods and members -public class GregTech_API { +public class GregTechAPI { /** * Fixes the HashMap Mappings for ItemStacks once the Server started * <br> * <br> * NOTE: We use wildcards generics for the key because it could be for example {@link ItemStack} or - * {@link GT_ItemStack} + * {@link GTItemStack} */ public static final Collection<Map<?, ?>> sItemStackMappings = new ArrayList<>(); public static final Collection<SetMultimap<? extends ItemHolder, ?>> itemStackMultiMaps = new ArrayList<>(); @@ -107,23 +108,23 @@ public class GregTech_API { /** * My Creative Tab */ - public static final CreativeTabs TAB_GREGTECH = new GT_CreativeTab("Main", "Main"), - TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"), - TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores"); + public static final CreativeTabs TAB_GREGTECH = new GTCreativeTab("Main", "Main"), + TAB_GREGTECH_MATERIALS = new GTCreativeTab("Materials", "Materials"), + TAB_GREGTECH_ORES = new GTCreativeTab("Ores", "Ores"); public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS]; /** * The Icon List for Covers */ - public static final Map<GT_ItemStack, ITexture> sCovers = new ConcurrentHashMap<>(); + public static final Map<GTItemStack, ITexture> sCovers = new ConcurrentHashMap<>(); /** * The List of Cover Behaviors for the Covers */ - public static final Map<GT_ItemStack, GT_CoverBehaviorBase<?>> sCoverBehaviors = new ConcurrentHashMap<>(); + public static final Map<GTItemStack, CoverBehaviorBase<?>> sCoverBehaviors = new ConcurrentHashMap<>(); /** * The List of Circuit Behaviors for the Redstone Circuit Block */ - public static final Map<Integer, GT_CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<>(); + public static final Map<Integer, CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<>(); /** * The List of Blocks, which can conduct Machine Block Updates */ @@ -155,18 +156,17 @@ public class GregTech_API { /** * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items */ - public static final GT_HashSet<GT_ItemStack> sToolList = new GT_HashSet<>(), sCrowbarList = new GT_HashSet<>(), - sScrewdriverList = new GT_HashSet<>(), sWrenchList = new GT_HashSet<>(), sSoftHammerList = new GT_HashSet<>(), - sHardHammerList = new GT_HashSet<>(), sWireCutterList = new GT_HashSet<>(), - sSolderingToolList = new GT_HashSet<>(), sSolderingMetalList = new GT_HashSet<>(), - sJackhammerList = new GT_HashSet<>(); + public static final GTHashSet<GTItemStack> sToolList = new GTHashSet<>(), sCrowbarList = new GTHashSet<>(), + sScrewdriverList = new GTHashSet<>(), sWrenchList = new GTHashSet<>(), sSoftHammerList = new GTHashSet<>(), + sHardHammerList = new GTHashSet<>(), sWireCutterList = new GTHashSet<>(), + sSolderingToolList = new GTHashSet<>(), sSolderingMetalList = new GTHashSet<>(), + sJackhammerList = new GTHashSet<>(); /** * The List of Hazmat Armors */ - public static final GT_HashSet<GT_ItemStack> sGasHazmatList = new GT_HashSet<>(), - sBioHazmatList = new GT_HashSet<>(), sFrostHazmatList = new GT_HashSet<>(), - sHeatHazmatList = new GT_HashSet<>(), sRadioHazmatList = new GT_HashSet<>(), - sElectroHazmatList = new GT_HashSet<>(); + public static final GTHashSet<GTItemStack> sGasHazmatList = new GTHashSet<>(), sBioHazmatList = new GTHashSet<>(), + sFrostHazmatList = new GTHashSet<>(), sHeatHazmatList = new GTHashSet<>(), sRadioHazmatList = new GTHashSet<>(), + sElectroHazmatList = new GTHashSet<>(); private static final Multimap<Integer, ItemStack> sRealConfigurationList = Multimaps .newListMultimap(new TreeMap<>(), ArrayList::new); @@ -184,7 +184,7 @@ public class GregTech_API { /** * Lists of all the active World generation Features, these are getting Initialized in Postload! */ - public static final List<GT_Worldgen> sWorldgenList = new ArrayList<>(); + public static final List<GTWorldgen> sWorldgenList = new ArrayList<>(); /** * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items. */ @@ -192,18 +192,18 @@ public class GregTech_API { /** * This is the generic Cover behavior. Used for the default Covers, which have no Behavior. */ - public static final GT_CoverBehavior sDefaultBehavior = new GT_Cover_Default(), sNoBehavior = new GT_Cover_None(); + public static final CoverBehavior sDefaultBehavior = new GTCoverDefault(), sNoBehavior = new GTCoverNone(); /** * For the API Version check */ public static volatile int VERSION = 509; /** - * @deprecated Use {@link GT_Values#RA} + * @deprecated Use {@link GTValues#RA} */ @SuppressWarnings("DeprecatedIsStillUsed") // Still need be initialized for backward compat @Deprecated - public static IGT_RecipeAdder sRecipeAdder; + public static IGTRecipeAdder sRecipeAdder; /** * Registers Aspects to Thaumcraft. This Object might be {@code null} if Thaumcraft isn't installed. */ @@ -229,7 +229,7 @@ public class GregTech_API { /** * The Configuration Objects */ - public static GT_Config NEIClientFIle; + public static GTConfig NEIClientFIle; public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100; /** @@ -288,12 +288,12 @@ public class GregTech_API { sItemStackMappings.add(sCovers); sItemStackMappings.add(sCoverBehaviors); - dummyWorlds.add(GT_DummyWorld.class); + dummyWorlds.add(GTDummyWorld.class); tryAddDummyWorld("blockrenderer6343.client.world.DummyWorld"); } private static void tryAddDummyWorld(String className) { - ClassLoader cl = GregTech_API.class.getClassLoader(); + ClassLoader cl = GregTechAPI.class.getClassLoader(); Class<?> clazz; try { clazz = Class.forName(className, false, cl); @@ -332,12 +332,12 @@ public class GregTech_API { * Null-Pointer into it. */ public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) { - if (!GregTech_API.sPreloadFinished) GT_Log.err.println( - "GregTech_API ERROR: " + aOreStack.getItem() + if (!GregTechAPI.sPreloadFinished) GTLog.err.println( + "GregTechAPI ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase."); - return GT_OreDictUnificator.get(true, aOreStack); + return GTOreDictUnificator.get(true, aOreStack); } /** @@ -351,7 +351,7 @@ public class GregTech_API { */ public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) { if (aWorld != null && !aWorld.isRemote && !isDummyWorld(aWorld)) { // World might be null during World-gen - GT_Runnable_MachineBlockUpdate.setMachineUpdateValues(aWorld, aX, aY, aZ); + RunnableMachineUpdate.setMachineUpdateValues(aWorld, aX, aY, aZ); return true; } return false; @@ -362,7 +362,7 @@ public class GregTech_API { if (aWorld == null || aWorld.isRemote || isDummyWorld(aWorld)) { return false; } // World might be null during World-gen - GT_Runnable_Cable_Update.setCableUpdateValues(aWorld, aX, aY, aZ); + RunnableCableUpdate.setCableUpdateValues(aWorld, aX, aY, aZ); return true; } @@ -377,8 +377,8 @@ public class GregTech_API { @SuppressWarnings("UnusedReturnValue") // Retains API method signature public static boolean registerMachineBlock(Block aBlock, int aMeta) { if (aBlock == null) return false; - if (GregTech_API.sThaumcraftCompat != null) - GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); + if (GregTechAPI.sThaumcraftCompat != null) + GregTechAPI.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); sMachineIDs.put(aBlock, aMeta); return true; } @@ -388,8 +388,8 @@ public class GregTech_API { */ public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) { if (aBlock == null || aMeta == null || aMeta.length == 0) return false; - if (GregTech_API.sThaumcraftCompat != null) - GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); + if (GregTechAPI.sThaumcraftCompat != null) + GregTechAPI.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); int rMeta = 0; for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i]; sMachineIDs.put(aBlock, rMeta); @@ -412,19 +412,16 @@ public class GregTech_API { */ public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) { try { - return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore); + return new ItemCoolantCellIC(aUnlocalized, aEnglish, aMaxStore); } catch (Throwable e) { /* Do nothing */ } try { - return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore); + return new ItemCoolantCell(aUnlocalized, aEnglish, aMaxStore); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug"); + return new GTGenericItem(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug"); } /** @@ -467,10 +464,7 @@ public class GregTech_API { } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug"); + return new GTGenericItem(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug"); } /** @@ -490,24 +484,21 @@ public class GregTech_API { } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug"); + return new GTGenericItem(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug"); } /** * Creates a new Hard Hammer Item */ - public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_HardHammer_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -519,21 +510,21 @@ public class GregTech_API { /** * Creates a new Crowbar Item */ - public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_Crowbar_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -545,15 +536,15 @@ public class GregTech_API { /** * Creates a new Wrench Item */ - public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aDisChargedGTID) { + public static ItemTool constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, + int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_Wrench_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -565,15 +556,15 @@ public class GregTech_API { /** * Creates a new electric Screwdriver Item */ - public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -585,15 +576,15 @@ public class GregTech_API { /** * Creates a new electric Wrench Item */ - public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -605,11 +596,11 @@ public class GregTech_API { /** * Creates a new electric Saw Item */ - public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_SawIC_Item") .getConstructors()[0].newInstance( aUnlocalized, aEnglish, @@ -622,7 +613,7 @@ public class GregTech_API { } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -634,11 +625,11 @@ public class GregTech_API { /** * Creates a new electric Drill Item */ - public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_DrillIC_Item") .getConstructors()[0].newInstance( aUnlocalized, aEnglish, @@ -651,7 +642,7 @@ public class GregTech_API { } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -663,15 +654,15 @@ public class GregTech_API { /** * Creates a new electric Soldering Tool */ - public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( + return new ItemTool( aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", @@ -683,21 +674,15 @@ public class GregTech_API { /** * Creates a new empty electric Tool */ - public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, + public static ItemTool constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) { try { - return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item") + return (ItemTool) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item") .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID); } catch (Throwable e) { /* Do nothing */ } - return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - 0, - false); + return new ItemTool(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, false); } /** @@ -716,8 +701,8 @@ public class GregTech_API { return sBaseMetaTileEntityClass.getDeclaredConstructor() .newInstance(); } catch (Throwable e) { - GT_Log.err.println("GT_Mod: Fatal Error occurred while initializing TileEntities, crashing Minecraft."); - e.printStackTrace(GT_Log.err); + GTLog.err.println("GTMod: Fatal Error occurred while initializing TileEntities, crashing Minecraft."); + e.printStackTrace(GTLog.err); throw new RuntimeException(e); } } @@ -736,10 +721,10 @@ public class GregTech_API { * available in LV+ single blocks, GT++ breakthrough circuit is offered in HV+ single blocks */ public static void registerConfigurationCircuit(ItemStack aStack, int minTier) { - if (GT_Utility.isStackInvalid(aStack)) return; + if (GTUtility.isStackInvalid(aStack)) return; for (ItemStack tRegistered : sRealConfigurationList.values()) - if (GT_Utility.areStacksEqual(tRegistered, aStack)) return; - ItemStack stack = GT_Utility.copyAmount(0, aStack); + if (GTUtility.areStacksEqual(tRegistered, aStack)) return; + ItemStack stack = GTUtility.copyAmount(0, aStack); sRealConfigurationList.put(minTier, stack); for (Map.Entry<Integer, List<ItemStack>> e : sConfigurationLists.entrySet()) { if (e.getKey() >= minTier) { @@ -771,13 +756,13 @@ public class GregTech_API { } public static Comparator<ItemStack> getConfigurationCircuitsComparator() { - return Comparator.comparingInt((ItemStack is) -> is.getItem() instanceof GT_IntegratedCircuit_Item ? 0 : 1) + return Comparator.comparingInt((ItemStack is) -> is.getItem() instanceof ItemIntegratedCircuit ? 0 : 1) .thenComparing(ItemStack::getUnlocalizedName) .thenComparing(ItemStack::getItemDamage); } public static void registerCircuitProgrammer(ItemStack stack, boolean ignoreNBT, boolean useContainer) { - registerCircuitProgrammer(rhs -> GT_Utility.areStacksEqual(stack, rhs, ignoreNBT), useContainer); + registerCircuitProgrammer(rhs -> GTUtility.areStacksEqual(stack, rhs, ignoreNBT), useContainer); } public static void registerCircuitProgrammer(Predicate<ItemStack> predicate, boolean useContainer) { @@ -792,23 +777,23 @@ public class GregTech_API { sRealCircuitProgrammerList.put(predicate, doDamage); } - public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) { - registerCover(aStack, aCover, (GT_CoverBehaviorBase<?>) aBehavior); + public static void registerCover(ItemStack aStack, ITexture aCover, CoverBehavior aBehavior) { + registerCover(aStack, aCover, (CoverBehaviorBase<?>) aBehavior); } - public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehaviorBase<?> aBehavior) { - if (!sCovers.containsKey(new GT_ItemStack(aStack))) sCovers.put( - new GT_ItemStack(aStack), + public static void registerCover(ItemStack aStack, ITexture aCover, CoverBehaviorBase<?> aBehavior) { + if (!sCovers.containsKey(new GTItemStack(aStack))) sCovers.put( + new GTItemStack(aStack), aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover); - if (aBehavior != null) sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior); + if (aBehavior != null) sCoverBehaviors.put(new GTItemStack(aStack), aBehavior); } - public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) { - registerCoverBehavior(aStack, (GT_CoverBehaviorBase<?>) aBehavior); + public static void registerCoverBehavior(ItemStack aStack, CoverBehavior aBehavior) { + registerCoverBehavior(aStack, (CoverBehaviorBase<?>) aBehavior); } - public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehaviorBase<?> aBehavior) { - sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior); + public static void registerCoverBehavior(ItemStack aStack, CoverBehaviorBase<?> aBehavior) { + sCoverBehaviors.put(new GTItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior); } /** @@ -816,8 +801,8 @@ public class GregTech_API { * * @param aBehavior can be null */ - public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, GT_CoverBehavior aBehavior) { - registerCover(aStackList, aCover, (GT_CoverBehaviorBase<?>) aBehavior); + public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, CoverBehavior aBehavior) { + registerCover(aStackList, aCover, (CoverBehaviorBase<?>) aBehavior); } /** @@ -826,9 +811,8 @@ public class GregTech_API { * @param aBehavior can be null */ public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, - GT_CoverBehaviorBase<?> aBehavior) { - if (aCover.isValidTexture()) - aStackList.forEach(tStack -> GregTech_API.registerCover(tStack, aCover, aBehavior)); + CoverBehaviorBase<?> aBehavior) { + if (aCover.isValidTexture()) aStackList.forEach(tStack -> GregTechAPI.registerCover(tStack, aCover, aBehavior)); } /** @@ -836,11 +820,11 @@ public class GregTech_API { * * @return The Cover behavior */ - public static GT_CoverBehaviorBase<?> getCoverBehaviorNew(ItemStack aStack) { + public static CoverBehaviorBase<?> getCoverBehaviorNew(ItemStack aStack) { if (aStack == null || aStack.getItem() == null) return sNoBehavior; - GT_CoverBehaviorBase<?> rCover = sCoverBehaviors.get(new GT_ItemStack(aStack)); + CoverBehaviorBase<?> rCover = sCoverBehaviors.get(new GTItemStack(aStack)); if (rCover != null) return rCover; - rCover = sCoverBehaviors.get(new GT_ItemStack(aStack, true)); + rCover = sCoverBehaviors.get(new GTItemStack(aStack, true)); if (rCover != null) return rCover; return sDefaultBehavior; } @@ -848,9 +832,9 @@ public class GregTech_API { /** * returns a Cover behavior, guaranteed to not return null */ - public static GT_CoverBehaviorBase<?> getCoverBehaviorNew(int aStack) { + public static CoverBehaviorBase<?> getCoverBehaviorNew(int aStack) { if (aStack == 0) return sNoBehavior; - return getCoverBehaviorNew(GT_Utility.intToStack(aStack)); + return getCoverBehaviorNew(GTUtility.intToStack(aStack)); } /** @@ -953,14 +937,13 @@ public class GregTech_API { * Generic Function to add Tools to the Lists. Contains all sanity Checks for Tools, like preventing one Tool from * being registered for multiple purposes as controls would override each other. */ - public static boolean registerTool(ItemStack aTool, Collection<GT_ItemStack> aToolList) { - if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) + public static boolean registerTool(ItemStack aTool, Collection<GTItemStack> aToolList) { + if (aTool == null || GTUtility.isStackInList(aTool, sToolList) || (!aTool.getItem() - .isDamageable() && !GT_ModHandler.isElectricItem(aTool) - && !(aTool.getItem() instanceof IDamagableItem))) + .isDamageable() && !GTModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem))) return false; - aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); - sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); + aToolList.add(new GTItemStack(GTUtility.copyAmount(1, aTool))); + sToolList.add(new GTItemStack(GTUtility.copyAmount(1, aTool))); return true; } @@ -981,7 +964,7 @@ public class GregTech_API { */ @SideOnly(Side.CLIENT) public static void setItemIconRegister(IIconRegister aIconRegister) { - GregTech_API.sItemIcons = aIconRegister; + GregTechAPI.sItemIcons = aIconRegister; } public static void registerTileEntityConstructor(int meta, IntFunction<TileEntity> constructor) { @@ -992,7 +975,7 @@ public class GregTech_API { } public static TileEntity createTileEntity(int meta) { - meta = GT_Utility.clamp(meta, 0, 15); + meta = GTUtility.clamp(meta, 0, 15); if (teCreators[meta] == null) return null; return teCreators[meta].apply(meta); } diff --git a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java b/src/main/java/gregtech/api/damagesources/GTDamageSources.java index 65a2519001..44b80a57c9 100644 --- a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java +++ b/src/main/java/gregtech/api/damagesources/GTDamageSources.java @@ -10,7 +10,7 @@ import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_DamageSources { +public class GTDamageSources { public static DamageSource getElectricDamage() { return ic2.api.info.Info.DMG_ELECTRIC; diff --git a/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java b/src/main/java/gregtech/api/enchants/EnchantmentEnderDamage.java index 07c13b3509..6c26a54976 100644 --- a/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java +++ b/src/main/java/gregtech/api/enchants/EnchantmentEnderDamage.java @@ -10,16 +10,16 @@ import net.minecraft.potion.PotionEffect; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTLanguageManager; -public class Enchantment_EnderDamage extends EnchantmentDamage { +public class EnchantmentEnderDamage extends EnchantmentDamage { - public static Enchantment_EnderDamage INSTANCE; + public static EnchantmentEnderDamage INSTANCE; - public Enchantment_EnderDamage() { - super(GT_Config.addIDConfig(ConfigCategories.IDs.enchantments, "Disjunction", 15), 2, -1); - GT_LanguageManager.addStringLocalization(getName(), "Disjunction"); + public EnchantmentEnderDamage() { + super(GTConfig.addIDConfig(ConfigCategories.IDs.enchantments, "Disjunction", 15), 2, -1); + GTLanguageManager.addStringLocalization(getName(), "Disjunction"); Materials.Silver.setEnchantmentForTools(this, 2); Materials.Mercury.setEnchantmentForTools(this, 3); Materials.Electrum.setEnchantmentForTools(this, 3); diff --git a/src/main/java/gregtech/api/enchants/Enchantment_Hazmat.java b/src/main/java/gregtech/api/enchants/EnchantmentHazmat.java index ecbe654698..bbac780b71 100644 --- a/src/main/java/gregtech/api/enchants/Enchantment_Hazmat.java +++ b/src/main/java/gregtech/api/enchants/EnchantmentHazmat.java @@ -6,16 +6,16 @@ import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import gregtech.api.enums.ConfigCategories; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTLanguageManager; -public class Enchantment_Hazmat extends Enchantment { +public class EnchantmentHazmat extends Enchantment { - public static Enchantment_Hazmat INSTANCE; + public static EnchantmentHazmat INSTANCE; - public Enchantment_Hazmat() { - super(GT_Config.addIDConfig(ConfigCategories.IDs.enchantments, "Hazmat", 13), 0, EnumEnchantmentType.armor); - GT_LanguageManager.addStringLocalization(getName(), "Hazmat"); + public EnchantmentHazmat() { + super(GTConfig.addIDConfig(ConfigCategories.IDs.enchantments, "Hazmat", 13), 0, EnumEnchantmentType.armor); + GTLanguageManager.addStringLocalization(getName(), "Hazmat"); INSTANCE = this; } diff --git a/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java b/src/main/java/gregtech/api/enchants/EnchantmentRadioactivity.java index e68e55cd6a..77e6f52702 100644 --- a/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java +++ b/src/main/java/gregtech/api/enchants/EnchantmentRadioactivity.java @@ -7,17 +7,17 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTUtility; -public class Enchantment_Radioactivity extends EnchantmentDamage { +public class EnchantmentRadioactivity extends EnchantmentDamage { - public static Enchantment_Radioactivity INSTANCE; + public static EnchantmentRadioactivity INSTANCE; - public Enchantment_Radioactivity() { - super(GT_Config.addIDConfig(ConfigCategories.IDs.enchantments, "Radioactivity", 14), 0, -1); - GT_LanguageManager.addStringLocalization(getName(), "Radioactivity"); + public EnchantmentRadioactivity() { + super(GTConfig.addIDConfig(ConfigCategories.IDs.enchantments, "Radioactivity", 14), 0, -1); + GTLanguageManager.addStringLocalization(getName(), "Radioactivity"); Materials.Plutonium.setEnchantmentForTools(this, 1) .setEnchantmentForArmors(this, 1); Materials.Uranium235.setEnchantmentForTools(this, 2) @@ -58,7 +58,7 @@ public class Enchantment_Radioactivity extends EnchantmentDamage { @Override public void func_151367_b(EntityLivingBase aHurtEntity, Entity aDamagingEntity, int aLevel) { - GT_Utility.applyRadioactivity(aHurtEntity, aLevel, 1); + GTUtility.applyRadioactivity(aHurtEntity, aLevel, 1); } @Override diff --git a/src/main/java/gregtech/api/enums/Dyes.java b/src/main/java/gregtech/api/enums/Dyes.java index 3f1bc31c21..1dedcb6af0 100644 --- a/src/main/java/gregtech/api/enums/Dyes.java +++ b/src/main/java/gregtech/api/enums/Dyes.java @@ -7,8 +7,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import gregtech.api.interfaces.IColorModulationContainer; -import gregtech.api.objects.GT_ArrayList; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.GTArrayList; +import gregtech.api.util.GTUtility; public enum Dyes implements IColorModulationContainer { @@ -50,7 +50,7 @@ public enum Dyes implements IColorModulationContainer { public final short[] mRGBa; public final short[] mOriginalRGBa; public final EnumChatFormatting formatting; - private final ArrayList<Fluid> mFluidDyes = new GT_ArrayList<>(false, 1); + private final ArrayList<Fluid> mFluidDyes = new GTArrayList<>(false, 1); Dyes(int aIndex, int aR, int aG, int aB, String aName) { this(aIndex, aR, aG, aB, aName, EnumChatFormatting.GRAY); @@ -75,7 +75,7 @@ public enum Dyes implements IColorModulationContainer { } public static Dyes get(String aColor) { - Object tObject = GT_Utility.getFieldContent(Dyes.class, aColor, false, false); + Object tObject = GTUtility.getFieldContent(Dyes.class, aColor, false, false); if (tObject instanceof Dyes) return (Dyes) tObject; return _NULL; } diff --git a/src/main/java/gregtech/api/enums/GTStones.java b/src/main/java/gregtech/api/enums/GTStones.java index 82d7cb90ce..af14301a5d 100644 --- a/src/main/java/gregtech/api/enums/GTStones.java +++ b/src/main/java/gregtech/api/enums/GTStones.java @@ -1,14 +1,14 @@ package gregtech.api.enums; -import gregtech.api.GregTech_API; -import gregtech.common.GT_Worldgen_Stone; +import gregtech.api.GregTechAPI; import gregtech.common.StoneBuilder; +import gregtech.common.WorldgenStone; public enum GTStones { NetherBlackgraniteTiny(new StoneBuilder().name("nether.stone.blackgranite.tiny") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(-1) .size(50) @@ -18,7 +18,7 @@ public enum GTStones { NetherBlackgraniteSmall(new StoneBuilder().name("nether.stone.blackgranite.small") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(-1) .size(100) @@ -28,7 +28,7 @@ public enum GTStones { NetherBlackgraniteMedium(new StoneBuilder().name("nether.stone.blackgranite.medium") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(-1) .size(200) @@ -38,7 +38,7 @@ public enum GTStones { NetherBlackgraniteLarge(new StoneBuilder().name("nether.stone.blackgranite.large") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(-1) .size(300) @@ -48,7 +48,7 @@ public enum GTStones { NetherBlackgraniteHuge(new StoneBuilder().name("nether.stone.blackgranite.huge") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(-1) .size(400) @@ -58,7 +58,7 @@ public enum GTStones { NetherRedgraniteTiny(new StoneBuilder().name("nether.stone.redgranite.tiny") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(-1) .size(50) @@ -68,7 +68,7 @@ public enum GTStones { NetherRedgraniteSmall(new StoneBuilder().name("nether.stone.redgranite.small") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(-1) .size(100) @@ -78,7 +78,7 @@ public enum GTStones { NetherRedgraniteMedium(new StoneBuilder().name("nether.stone.redgranite.medium") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(-1) .size(200) @@ -88,7 +88,7 @@ public enum GTStones { NetherRedgraniteLarge(new StoneBuilder().name("nether.stone.redgranite.large") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(-1) .size(300) @@ -98,7 +98,7 @@ public enum GTStones { NetherRedgraniteHuge(new StoneBuilder().name("nether.stone.redgranite.huge") .disabledByDefault() - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(-1) .size(400) @@ -108,7 +108,7 @@ public enum GTStones { NetherMarbleTiny(new StoneBuilder().name("nether.stone.marble.tiny") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(-1) .size(50) @@ -118,7 +118,7 @@ public enum GTStones { NetherMarbleSmall(new StoneBuilder().name("nether.stone.marble.small") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(-1) .size(100) @@ -128,7 +128,7 @@ public enum GTStones { NetherMarbleMedium(new StoneBuilder().name("nether.stone.marble.medium") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(-1) .size(200) @@ -138,7 +138,7 @@ public enum GTStones { NetherMarbleLarge(new StoneBuilder().name("nether.stone.marble.large") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(-1) .size(300) @@ -148,7 +148,7 @@ public enum GTStones { NetherMarbleHuge(new StoneBuilder().name("nether.stone.marble.huge") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(-1) .size(400) @@ -158,7 +158,7 @@ public enum GTStones { NetherBasaltTiny(new StoneBuilder().name("nether.stone.basalt.tiny") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(-1) .size(50) @@ -168,7 +168,7 @@ public enum GTStones { NetherBasaltSmall(new StoneBuilder().name("nether.stone.basalt.small") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(-1) .size(100) @@ -178,7 +178,7 @@ public enum GTStones { NetherBasaltMedium(new StoneBuilder().name("nether.stone.basalt.medium") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(-1) .size(200) @@ -188,7 +188,7 @@ public enum GTStones { NetherBasaltLarge(new StoneBuilder().name("nether.stone.basalt.large") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(-1) .size(300) @@ -198,7 +198,7 @@ public enum GTStones { NetherBasaltHuge(new StoneBuilder().name("nether.stone.basalt.huge") .disabledByDefault() - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(-1) .size(400) @@ -206,7 +206,7 @@ public enum GTStones { .heightRange(0, 120) .generationInVoidEnabled(false)), OverworldBlackgraniteTiny(new StoneBuilder().name("overworld.stone.blackgranite.tiny") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(0) .size(75) @@ -215,7 +215,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBlackgraniteSmall(new StoneBuilder().name("overworld.stone.blackgranite.small") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(0) .size(100) @@ -224,7 +224,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBlackgraniteMedium(new StoneBuilder().name("overworld.stone.blackgranite.medium") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(0) .size(200) @@ -233,7 +233,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBlackgraniteLarge(new StoneBuilder().name("overworld.stone.blackgranite.large") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(0) .size(300) @@ -242,7 +242,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBlackgraniteHuge(new StoneBuilder().name("overworld.stone.blackgranite.huge") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(0) .dimension(0) .size(400) @@ -251,7 +251,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldRedgraniteTiny(new StoneBuilder().name("overworld.stone.redgranite.tiny") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(0) .size(75) @@ -260,7 +260,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldRedgraniteSmall(new StoneBuilder().name("overworld.stone.redgranite.small") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(0) .size(100) @@ -269,7 +269,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldRedgraniteMedium(new StoneBuilder().name("overworld.stone.redgranite.medium") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(0) .size(200) @@ -278,7 +278,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldRedgraniteLarge(new StoneBuilder().name("overworld.stone.redgranite.large") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(0) .size(300) @@ -287,7 +287,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldRedgraniteHuge(new StoneBuilder().name("overworld.stone.redgranite.huge") - .block(GregTech_API.sBlockGranites) + .block(GregTechAPI.sBlockGranites) .blockMeta(8) .dimension(0) .size(400) @@ -296,7 +296,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldMarbleTiny(new StoneBuilder().name("overworld.stone.marble.tiny") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(0) .size(75) @@ -305,7 +305,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldMarbleSmall(new StoneBuilder().name("overworld.stone.marble.small") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(0) .size(100) @@ -314,7 +314,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldMarbleMedium(new StoneBuilder().name("overworld.stone.marble.medium") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(0) .size(200) @@ -323,7 +323,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldMarbleLarge(new StoneBuilder().name("overworld.stone.marble.large") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(0) .size(300) @@ -332,7 +332,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldMarbleHuge(new StoneBuilder().name("overworld.stone.marble.huge") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(0) .dimension(0) .size(400) @@ -341,7 +341,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBasaltTiny(new StoneBuilder().name("overworld.stone.basalt.tiny") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(0) .size(75) @@ -350,7 +350,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBasaltSmall(new StoneBuilder().name("overworld.stone.basalt.small") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(0) .size(100) @@ -359,7 +359,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBasaltMedium(new StoneBuilder().name("overworld.stone.basalt.medium") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(0) .size(200) @@ -368,7 +368,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBasaltLarge(new StoneBuilder().name("overworld.stone.basalt.large") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(0) .size(300) @@ -377,7 +377,7 @@ public enum GTStones { .generationInVoidEnabled(false)), OverworldBasaltHuge(new StoneBuilder().name("overworld.stone.basalt.huge") - .block(GregTech_API.sBlockStones) + .block(GregTechAPI.sBlockStones) .blockMeta(8) .dimension(0) .size(400) @@ -391,8 +391,8 @@ public enum GTStones { this.stone = stone; } - public GT_Worldgen_Stone addGTStone() { - return new GT_Worldgen_Stone(this.stone); + public WorldgenStone addGTStone() { + return new WorldgenStone(this.stone); } } diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GTValues.java index 88972e45fc..eaca14b3ee 100644 --- a/src/main/java/gregtech/api/enums/GT_Values.java +++ b/src/main/java/gregtech/api/enums/GTValues.java @@ -27,11 +27,12 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidTank; import net.minecraftforge.oredict.OreDictionary; -import gregtech.api.fluid.FluidTankGT; +import gregtech.api.fluid.GTFluidTank; import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.internal.IGT_Mod; -import gregtech.api.interfaces.internal.IGT_RecipeAdder; +import gregtech.api.interfaces.internal.IGTMod; +import gregtech.api.interfaces.internal.IGTRecipeAdder; import gregtech.api.net.IGT_NetworkHandler; +import gregtech.api.util.GTChunkAssociatedData; /** * Made for static imports, this Class is just a Helper. @@ -43,7 +44,7 @@ import gregtech.api.net.IGT_NetworkHandler; * such as this one as AutoCompleteable. */ @SuppressWarnings("unused") // API Legitimately has unused fields and methods -public class GT_Values { +public class GTValues { // unused: A, C, D, G, H, I, J, K, N, O, Q, R, S, T // TODO: Rename Material Units to 'U' @@ -354,13 +355,13 @@ public class GT_Values { { 0, 1, 2, 3, 4, 5, 6 } }; /** - * The Mod Object itself. That is the GT_Mod-Object. It's needed to open GUI's and similar. + * The Mod Object itself. That is the GTMod-Object. It's needed to open GUI's and similar. */ - public static IGT_Mod GT; + public static IGTMod GT; /** * Use this Object to add Recipes. (Recipe Adder) */ - public static IGT_RecipeAdder RA; + public static IGTRecipeAdder RA; /** * For Internal Usage (Network) */ @@ -431,7 +432,7 @@ public class GT_Values { */ public static boolean debugEntityCramming = false; /** - * Debug parameter for {@link gregtech.api.util.GT_ChunkAssociatedData} + * Debug parameter for {@link GTChunkAssociatedData} */ public static boolean debugWorldData = false; /** @@ -540,7 +541,7 @@ public class GT_Values { public static final int[] emptyIntArray = new int[0]; public static final IFluidTank[] emptyFluidTank = new IFluidTank[0]; - public static final FluidTankGT[] emptyFluidTankGT = new FluidTankGT[0]; + public static final GTFluidTank[] emptyFluidTankGT = new GTFluidTank[0]; public static final FluidTankInfo[] emptyFluidTankInfo = new FluidTankInfo[0]; public static final FluidStack[] emptyFluidStack = new FluidStack[0]; public static final ItemStack[] emptyItemStackArray = new ItemStack[0]; diff --git a/src/main/java/gregtech/api/enums/GT_HatchElement.java b/src/main/java/gregtech/api/enums/GT_HatchElement.java deleted file mode 100644 index 3a21d5a2eb..0000000000 --- a/src/main/java/gregtech/api/enums/GT_HatchElement.java +++ /dev/null @@ -1,112 +0,0 @@ -package gregtech.api.enums; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import gregtech.api.interfaces.IHatchElement; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -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_Maintenance; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_ExoticEnergyInputHelper; -import gregtech.api.util.IGT_HatchAdder; - -public enum GT_HatchElement implements IHatchElement<GT_MetaTileEntity_MultiBlockBase> { - - Muffler(GT_MetaTileEntity_MultiBlockBase::addMufflerToMachineList, GT_MetaTileEntity_Hatch_Muffler.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mMufflerHatches.size(); - } - }, - Maintenance(GT_MetaTileEntity_MultiBlockBase::addMaintenanceToMachineList, - GT_MetaTileEntity_Hatch_Maintenance.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mMaintenanceHatches.size(); - } - }, - InputHatch(GT_MetaTileEntity_MultiBlockBase::addInputHatchToMachineList, GT_MetaTileEntity_Hatch_Input.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mInputHatches.size(); - } - }, - InputBus(GT_MetaTileEntity_MultiBlockBase::addInputBusToMachineList, GT_MetaTileEntity_Hatch_InputBus.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mInputBusses.size(); - } - }, - OutputHatch(GT_MetaTileEntity_MultiBlockBase::addOutputHatchToMachineList, GT_MetaTileEntity_Hatch_Output.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mOutputHatches.size(); - } - }, - OutputBus(GT_MetaTileEntity_MultiBlockBase::addOutputBusToMachineList, GT_MetaTileEntity_Hatch_OutputBus.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mOutputBusses.size(); - } - }, - Energy(GT_MetaTileEntity_MultiBlockBase::addEnergyInputToMachineList, GT_MetaTileEntity_Hatch_Energy.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mEnergyHatches.size(); - } - }, - Dynamo(GT_MetaTileEntity_MultiBlockBase::addDynamoToMachineList, GT_MetaTileEntity_Hatch_Dynamo.class) { - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.mDynamoHatches.size(); - } - }, - ExoticEnergy(GT_MetaTileEntity_MultiBlockBase::addExoticEnergyInputToMachineList) { - - @Override - public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { - return GT_ExoticEnergyInputHelper.getAllClasses(); - } - - @Override - public long count(GT_MetaTileEntity_MultiBlockBase t) { - return t.getExoticEnergyHatches() - .size(); - } - },; - - private final List<Class<? extends IMetaTileEntity>> mteClasses; - private final IGT_HatchAdder<GT_MetaTileEntity_MultiBlockBase> adder; - - @SafeVarargs - GT_HatchElement(IGT_HatchAdder<GT_MetaTileEntity_MultiBlockBase> adder, - Class<? extends IMetaTileEntity>... mteClasses) { - this.mteClasses = Collections.unmodifiableList(Arrays.asList(mteClasses)); - this.adder = adder; - } - - @Override - public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { - return mteClasses; - } - - public IGT_HatchAdder<? super GT_MetaTileEntity_MultiBlockBase> adder() { - return adder; - } -} diff --git a/src/main/java/gregtech/api/enums/HatchElement.java b/src/main/java/gregtech/api/enums/HatchElement.java new file mode 100644 index 0000000000..ae38d2a2ff --- /dev/null +++ b/src/main/java/gregtech/api/enums/HatchElement.java @@ -0,0 +1,110 @@ +package gregtech.api.enums; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import gregtech.api.interfaces.IHatchElement; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatchDynamo; +import gregtech.api.metatileentity.implementations.MTEHatchEnergy; +import gregtech.api.metatileentity.implementations.MTEHatchInput; +import gregtech.api.metatileentity.implementations.MTEHatchInputBus; +import gregtech.api.metatileentity.implementations.MTEHatchMaintenance; +import gregtech.api.metatileentity.implementations.MTEHatchMuffler; +import gregtech.api.metatileentity.implementations.MTEHatchOutput; +import gregtech.api.metatileentity.implementations.MTEHatchOutputBus; +import gregtech.api.metatileentity.implementations.MTEMultiBlockBase; +import gregtech.api.util.ExoticEnergyInputHelper; +import gregtech.api.util.IGTHatchAdder; + +public enum HatchElement implements IHatchElement<MTEMultiBlockBase> { + + Muffler(MTEMultiBlockBase::addMufflerToMachineList, MTEHatchMuffler.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mMufflerHatches.size(); + } + }, + Maintenance(MTEMultiBlockBase::addMaintenanceToMachineList, MTEHatchMaintenance.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mMaintenanceHatches.size(); + } + }, + InputHatch(MTEMultiBlockBase::addInputHatchToMachineList, MTEHatchInput.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mInputHatches.size(); + } + }, + InputBus(MTEMultiBlockBase::addInputBusToMachineList, MTEHatchInputBus.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mInputBusses.size(); + } + }, + OutputHatch(MTEMultiBlockBase::addOutputHatchToMachineList, MTEHatchOutput.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mOutputHatches.size(); + } + }, + OutputBus(MTEMultiBlockBase::addOutputBusToMachineList, MTEHatchOutputBus.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mOutputBusses.size(); + } + }, + Energy(MTEMultiBlockBase::addEnergyInputToMachineList, MTEHatchEnergy.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mEnergyHatches.size(); + } + }, + Dynamo(MTEMultiBlockBase::addDynamoToMachineList, MTEHatchDynamo.class) { + + @Override + public long count(MTEMultiBlockBase t) { + return t.mDynamoHatches.size(); + } + }, + ExoticEnergy(MTEMultiBlockBase::addExoticEnergyInputToMachineList) { + + @Override + public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { + return ExoticEnergyInputHelper.getAllClasses(); + } + + @Override + public long count(MTEMultiBlockBase t) { + return t.getExoticEnergyHatches() + .size(); + } + },; + + private final List<Class<? extends IMetaTileEntity>> mteClasses; + private final IGTHatchAdder<MTEMultiBlockBase> adder; + + @SafeVarargs + HatchElement(IGTHatchAdder<MTEMultiBlockBase> adder, Class<? extends IMetaTileEntity>... mteClasses) { + this.mteClasses = Collections.unmodifiableList(Arrays.asList(mteClasses)); + this.adder = adder; + } + + @Override + public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { + return mteClasses; + } + + public IGTHatchAdder<? super MTEMultiBlockBase> adder() { + return adder; + } +} diff --git a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java index f281695d5a..4d770710cc 100644 --- a/src/main/java/gregtech/api/enums/HeatingCoilLevel.java +++ b/src/main/java/gregtech/api/enums/HeatingCoilLevel.java @@ -79,14 +79,14 @@ public enum HeatingCoilLevel { if (heatLevel.getHeat() >= heat) { String name = heatLevel.getName(); if (applyColor) { - name = GT_Values.TIER_COLORS[heatLevel.getTier() + 1] + name; + name = GTValues.TIER_COLORS[heatLevel.getTier() + 1] + name; } return name; } } String name = HeatingCoilLevel.MAX.getName() + "+"; if (applyColor) { - name = GT_Values.TIER_COLORS[HeatingCoilLevel.MAX.getTier() + 1] + name; + name = GTValues.TIER_COLORS[HeatingCoilLevel.MAX.getTier() + 1] + name; } return name; } diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 74f169681c..dba8f510b9 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -1,7 +1,7 @@ package gregtech.api.enums; -import static gregtech.api.enums.GT_Values.NI; -import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.GTValues.NI; +import static gregtech.api.enums.GTValues.W; import java.util.Locale; @@ -11,11 +11,11 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import gregtech.api.interfaces.IItemContainer; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; /** * Class containing all non-OreDict Items of GregTech. @@ -2615,14 +2615,14 @@ public enum ItemList implements IItemContainer { mHasNotBeenSet = false; if (aItem == null) return this; ItemStack aStack = new ItemStack(aItem, 1, 0); - mStack = GT_Utility.copyAmount(1, aStack); + mStack = GTUtility.copyAmount(1, aStack); return this; } @Override public IItemContainer set(ItemStack aStack) { mHasNotBeenSet = false; - mStack = GT_Utility.copyAmount(1, aStack); + mStack = GTUtility.copyAmount(1, aStack); return this; } @@ -2635,14 +2635,14 @@ public enum ItemList implements IItemContainer { @Override public Item getItem() { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) return null; + if (GTUtility.isStackInvalid(mStack)) return null; return mStack.getItem(); } @Override public Block getBlock() { sanityCheck(); - return GT_Utility.getBlockFromItem(getItem()); + return GTUtility.getBlockFromItem(getItem()); } @Override @@ -2658,50 +2658,50 @@ public enum ItemList implements IItemContainer { @Override public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { if (mDeprecated && !mWarned) { - new Exception(this + " is now deprecated").printStackTrace(GT_Log.err); + new Exception(this + " is now deprecated").printStackTrace(GTLog.err); // warn only once mWarned = true; } - if (GT_Utility.isStackInvalid(aStack)) return false; - return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); + if (GTUtility.isStackInvalid(aStack)) return false; + return GTUtility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); } @Override public ItemStack get(long aAmount, Object... aReplacements) { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) { - GT_Log.out.println("Object in the ItemList is null at:"); - new NullPointerException().printStackTrace(GT_Log.out); - return GT_Utility.copyAmount(aAmount, aReplacements); + if (GTUtility.isStackInvalid(mStack)) { + GTLog.out.println("Object in the ItemList is null at:"); + new NullPointerException().printStackTrace(GTLog.out); + return GTUtility.copyAmount(aAmount, aReplacements); } - return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); + return GTUtility.copyAmount(aAmount, GTOreDictUnificator.get(mStack)); } @Override public ItemStack getWildcard(long aAmount, Object... aReplacements) { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); + if (GTUtility.isStackInvalid(mStack)) return GTUtility.copyAmount(aAmount, aReplacements); + return GTUtility.copyAmountAndMetaData(aAmount, W, GTOreDictUnificator.get(mStack)); } @Override public ItemStack getUndamaged(long aAmount, Object... aReplacements) { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); + if (GTUtility.isStackInvalid(mStack)) return GTUtility.copyAmount(aAmount, aReplacements); + return GTUtility.copyAmountAndMetaData(aAmount, 0, GTOreDictUnificator.get(mStack)); } @Override public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack)); + if (GTUtility.isStackInvalid(mStack)) return GTUtility.copyAmount(aAmount, aReplacements); + return GTUtility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GTOreDictUnificator.get(mStack)); } @Override public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { ItemStack rStack = get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) return NI; + if (GTUtility.isStackInvalid(rStack)) return NI; // CamelCase alphanumeric words from aDisplayName StringBuilder tCamelCasedDisplayNameBuilder = new StringBuilder(); @@ -2722,36 +2722,36 @@ public enum ItemList implements IItemContainer { // Construct a translation key from UnlocalizedName and CamelCased DisplayName final String tKey = rStack.getUnlocalizedName() + ".with." + tCamelCasedDisplayNameBuilder + ".name"; - rStack.setStackDisplayName(GT_LanguageManager.addStringLocalization(tKey, aDisplayName)); - return GT_Utility.copyAmount(aAmount, rStack); + rStack.setStackDisplayName(GTLanguageManager.addStringLocalization(tKey, aDisplayName)); + return GTUtility.copyAmount(aAmount, rStack); } @Override public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { ItemStack rStack = get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) return null; - GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); - return GT_Utility.copyAmount(aAmount, rStack); + if (GTUtility.isStackInvalid(rStack)) return null; + GTModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); + return GTUtility.copyAmount(aAmount, rStack); } @Override public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { sanityCheck(); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); + if (GTUtility.isStackInvalid(mStack)) return GTUtility.copyAmount(aAmount, aReplacements); + return GTUtility.copyAmountAndMetaData(aAmount, aMetaValue, GTOreDictUnificator.get(mStack)); } @Override public IItemContainer registerOre(Object... aOreNames) { sanityCheck(); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + for (Object tOreName : aOreNames) GTOreDictUnificator.registerOre(tOreName, get(1)); return this; } @Override public IItemContainer registerWildcardAsOre(Object... aOreNames) { sanityCheck(); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + for (Object tOreName : aOreNames) GTOreDictUnificator.registerOre(tOreName, getWildcard(1)); return this; } @@ -2767,7 +2767,7 @@ public enum ItemList implements IItemContainer { if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); if (mDeprecated && !mWarned) { - new Exception(this + " is now deprecated").printStackTrace(GT_Log.err); + new Exception(this + " is now deprecated").printStackTrace(GTLog.err); // warn only once mWarned = true; } diff --git a/src/main/java/gregtech/api/enums/MaterialBuilder.java b/src/main/java/gregtech/api/enums/MaterialBuilder.java index 98ed5fa3f7..89104d6e96 100644 --- a/src/main/java/gregtech/api/enums/MaterialBuilder.java +++ b/src/main/java/gregtech/api/enums/MaterialBuilder.java @@ -31,7 +31,7 @@ public class MaterialBuilder { private Dyes color = Dyes._NULL; private int extraData = 0; private List<MaterialStack> materialList = new ArrayList<>(); - private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<>(); + private List<TCAspects.TC_AspectStack> aspects = new ArrayList<>(); private boolean hasCorrespondingFluid = false; private boolean hasCorrespondingGas = false; private boolean canBeCracked = false; @@ -242,7 +242,7 @@ public class MaterialBuilder { return this; } - public MaterialBuilder setAspects(List<TC_Aspects.TC_AspectStack> aspects) { + public MaterialBuilder setAspects(List<TCAspects.TC_AspectStack> aspects) { this.aspects = aspects; return this; } diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 3d314c4742..3a963ca322 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -1,7 +1,7 @@ package gregtech.api.enums; import static gregtech.api.enums.FluidState.GAS; -import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GTValues.M; import static gregtech.api.enums.Mods.Thaumcraft; import java.util.ArrayList; @@ -24,20 +24,20 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; -import gregtech.api.fluid.GT_FluidFactory; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.TCAspects.TC_AspectStack; +import gregtech.api.fluid.GTFluidFactory; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.IMaterialHandler; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import gregtech.common.config.gregtech.ConfigHarvestLevel; import gregtech.common.render.items.CosmicNeutroniumRenderer; -import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; import gregtech.common.render.items.GaiaSpiritRenderer; +import gregtech.common.render.items.GeneratedMaterialRenderer; import gregtech.common.render.items.GlitchEffectRenderer; import gregtech.common.render.items.InfinityRenderer; import gregtech.common.render.items.TranscendentMetalRenderer; @@ -67,7 +67,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { // Spotless breaks the table below into many, many lines // spotless:off - public static Materials _NULL = new Materials(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Collections.singletonList(new TC_AspectStack(TC_Aspects.VACUOS, 1))); + public static Materials _NULL = new Materials(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Collections.singletonList(new TC_AspectStack(TCAspects.VACUOS, 1))); /** * Direct Elements */ @@ -352,37 +352,37 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public static Materials Vyroxeres; public static Materials Yellorium; public static Materials Zectium; - public static Materials Ultimate = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Ultimate" , "Ultimate" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 8))); - public static Materials Advanced = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Advanced" , "Advanced" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 4))); + public static Materials Ultimate = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Ultimate" , "Ultimate" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 8))); + public static Materials Advanced = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Advanced" , "Advanced" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 4))); /** * Tiered materials, primarily Circuitry, Batteries and other Technical things */ - public static Materials ULV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Primitive" , "Primitive" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 1))); - public static Materials LV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Basic" , "Basic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 2))); - public static Materials MV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Good" , "Good" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 3))); - public static Materials HV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Advanced" , "Advanced" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 4))); - public static Materials EV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Data" , "Data" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 5))); - public static Materials IV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Elite" , "Elite" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 6))); - public static Materials LuV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Master" , "Master" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 7))); - public static Materials ZPM = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Ultimate" , "Ultimate" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 8))); - public static Materials UV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Superconductor" , "Superconductor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.MACHINA, 9))); - public static Materials UHV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Infinite" , "Infinite" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 10))); - public static Materials UEV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Bio" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 11))); - public static Materials UIV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Optical" , "Optical" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 12))); - public static Materials UMV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Exotic" , "Exotic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 13))); - public static Materials UXV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Cosmic" , "Cosmic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 14))); - public static Materials MAX = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Transcendent" , "Transcendent" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 15))); - - public static Materials Resistor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Resistor" , "Resistor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 1))); - public static Materials Diode = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Diode" , "Diode" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 1))); - public static Materials Transistor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Transistor" , "Transistor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 1))); - public static Materials Capacitor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Capacitor" , "Capacitor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 1))); - public static Materials Inductor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Inductor" , "Inductor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 1))); - - public static Materials Nano = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Nano" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 11))); - public static Materials Piko = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Piko" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 12))); - public static Materials Quantum = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Quantum" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TC_Aspects.ELECTRUM, 13))); + public static Materials ULV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Primitive" , "Primitive" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 1))); + public static Materials LV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Basic" , "Basic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 2))); + public static Materials MV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Good" , "Good" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 3))); + public static Materials HV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Advanced" , "Advanced" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 4))); + public static Materials EV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Data" , "Data" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 5))); + public static Materials IV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Elite" , "Elite" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 6))); + public static Materials LuV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Master" , "Master" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 7))); + public static Materials ZPM = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Ultimate" , "Ultimate" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 8))); + public static Materials UV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Superconductor" , "Superconductor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.MACHINA, 9))); + public static Materials UHV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Infinite" , "Infinite" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 10))); + public static Materials UEV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Bio" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 11))); + public static Materials UIV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Optical" , "Optical" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 12))); + public static Materials UMV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Exotic" , "Exotic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 13))); + public static Materials UXV = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Cosmic" , "Cosmic" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 14))); + public static Materials MAX = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Transcendent" , "Transcendent" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 15))); + + public static Materials Resistor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Resistor" , "Resistor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 1))); + public static Materials Diode = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Diode" , "Diode" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 1))); + public static Materials Transistor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Transistor" , "Transistor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 1))); + public static Materials Capacitor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Capacitor" , "Capacitor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 1))); + public static Materials Inductor = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Inductor" , "Inductor" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 1))); + + public static Materials Nano = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Nano" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 11))); + public static Materials Piko = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Piko" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 12))); + public static Materials Quantum = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Quantum" , "Bio" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray , Collections.singletonList(new TC_AspectStack(TCAspects.ELECTRUM, 13))); /** @@ -1029,10 +1029,10 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public final short[] mRGBa = new short[] { 255, 255, 255, 0 }, mMoltenRGBa = new short[] { 255, 255, 255, 0 }; public TextureSet mIconSet; - public GT_GeneratedMaterial_Renderer renderer; + public GeneratedMaterialRenderer renderer; public List<MaterialStack> mMaterialList = new ArrayList<>(); public List<Materials> mOreByProducts = new ArrayList<>(), mOreReRegistrations = new ArrayList<>(); - public List<TC_Aspects.TC_AspectStack> mAspects = new ArrayList<>(); + public List<TCAspects.TC_AspectStack> mAspects = new ArrayList<>(); public ArrayList<ItemStack> mMaterialItems = new ArrayList<>(); public Collection<SubTag> mSubTags = new LinkedHashSet<>(); public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null; @@ -1256,7 +1256,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - List<TC_Aspects.TC_AspectStack> aAspects) { + List<TCAspects.TC_AspectStack> aAspects) { this( aMetaItemSubID, aIconSet, @@ -1287,7 +1287,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, - List<TC_Aspects.TC_AspectStack> aAspects) { + List<TCAspects.TC_AspectStack> aAspects) { this( aMetaItemSubID, aIconSet, @@ -1359,7 +1359,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, - List<MaterialStack> aMaterialList, List<TC_Aspects.TC_AspectStack> aAspects) { + List<MaterialStack> aMaterialList, List<TCAspects.TC_AspectStack> aAspects) { this( aMetaItemSubID, aIconSet, @@ -1397,15 +1397,15 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { tAmountOfComponents += tMaterial.mAmount; if (tMaterial.mMaterial.mMeltingPoint > 0) tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount; - if (aAspects == null) for (TC_Aspects.TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) - tAspect.addToAspectList(mAspects); + if (aAspects == null) + for (TCAspects.TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects); } if (mMeltingPoint < 0) mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents); tAmountOfComponents *= aDensityMultiplier; tAmountOfComponents /= aDensityDivider; - if (aAspects == null) for (TC_Aspects.TC_AspectStack tAspect : mAspects) + if (aAspects == null) for (TCAspects.TC_AspectStack tAspect : mAspects) tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents)); else mAspects.addAll(aAspects); } @@ -2478,7 +2478,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public static void init() { new ProcessingConfig(); - if (!GT_Mod.gregtechproxy.mEnableAllMaterials) new ProcessingModSupport(); + if (!GTMod.gregtechproxy.mEnableAllMaterials) new ProcessingModSupport(); mMaterialHandlers.forEach(IMaterialHandler::onMaterialsInit); // This is where addon mods can add/manipulate // materials initMaterialProperties(); // No more material addition or manipulation should be done past this point! @@ -2538,8 +2538,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { if (aMaterial.mMetaItemSubID >= 0) { if (aMaterial.mMetaItemSubID < 1000) { if (aMaterial.mHasParentMod) { - if (GregTech_API.sGeneratedMaterials[aMaterial.mMetaItemSubID] == null) { - GregTech_API.sGeneratedMaterials[aMaterial.mMetaItemSubID] = aMaterial; + if (GregTechAPI.sGeneratedMaterials[aMaterial.mMetaItemSubID] == null) { + GregTechAPI.sGeneratedMaterials[aMaterial.mMetaItemSubID] = aMaterial; } else throw new IllegalArgumentException( "The Material Index " + aMaterial.mMetaItemSubID + " for " @@ -2556,7 +2556,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } private static void addToolValues(Materials aMaterial) { - // Moved from GT_Proxy? (Not sure) + // Moved from GTProxy? (Not sure) aMaterial.mHandleMaterial = (aMaterial == Desh ? aMaterial.mHandleMaterial : aMaterial == Diamond || aMaterial == Thaumium ? Wood : aMaterial.contains(SubTag.BURNING) ? Blaze @@ -2596,10 +2596,10 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } if (aMaterial.mHasPlasma) { - GT_Mod.gregtechproxy.addAutogeneratedPlasmaFluid(aMaterial); + GTMod.gregtechproxy.addAutogeneratedPlasmaFluid(aMaterial); } if (aMaterial.mHasGas) { - GT_FluidFactory + GTFluidFactory .of(aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName, aMaterial, GAS, aMaterial.mGasTemp); } } @@ -2610,18 +2610,18 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } private static void addHarvestLevelNerfs(Materials aMaterial) { - /* Moved the harvest level changes from GT_Mod to have fewer things iterating over MATERIALS_ARRAY */ - if (GT_Mod.gregtechproxy.mChangeHarvestLevels && aMaterial.mToolQuality > 0 - && aMaterial.mMetaItemSubID < GT_Mod.gregtechproxy.mHarvestLevel.length + /* Moved the harvest level changes from GTMod to have fewer things iterating over MATERIALS_ARRAY */ + if (GTMod.gregtechproxy.mChangeHarvestLevels && aMaterial.mToolQuality > 0 + && aMaterial.mMetaItemSubID < GTMod.gregtechproxy.mHarvestLevel.length && aMaterial.mMetaItemSubID >= 0) { - GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = aMaterial.mToolQuality; + GTMod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = aMaterial.mToolQuality; } } private static void addHarvestLevels() { - GT_Mod.gregtechproxy.mChangeHarvestLevels = ConfigHarvestLevel.activateHarvestLevelChange; - GT_Mod.gregtechproxy.mMaxHarvestLevel = Math.min(15, ConfigHarvestLevel.maxHarvestLevel); - GT_Mod.gregtechproxy.mGraniteHavestLevel = ConfigHarvestLevel.graniteHarvestLevel; + GTMod.gregtechproxy.mChangeHarvestLevels = ConfigHarvestLevel.activateHarvestLevelChange; + GTMod.gregtechproxy.mMaxHarvestLevel = Math.min(15, ConfigHarvestLevel.maxHarvestLevel); + GTMod.gregtechproxy.mGraniteHavestLevel = ConfigHarvestLevel.graniteHarvestLevel; } public static void initMaterialProperties() { @@ -2690,7 +2690,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public static String getLocalizedNameForItem(String aFormat, int aMaterialID) { if (aMaterialID >= 0 && aMaterialID < 1000) { - Materials aMaterial = GregTech_API.sGeneratedMaterials[aMaterialID]; + Materials aMaterial = GregTechAPI.sGeneratedMaterials[aMaterialID]; if (aMaterial != null) return aMaterial.getLocalizedNameForItem(aFormat); } return aFormat; @@ -2814,7 +2814,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { return mMaterialItems.stream() .anyMatch( tStack -> Arrays.stream(aStacks) - .anyMatch(aStack -> GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound()))); + .anyMatch(aStack -> GTUtility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound()))); } /** @@ -2824,7 +2824,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { if (aStack == null) return false; boolean temp = false; int mMaterialItems_sS = mMaterialItems.size(); - for (int i = 0; i < mMaterialItems_sS; i++) if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) { + for (int i = 0; i < mMaterialItems_sS; i++) if (GTUtility.areStacksEqual(aStack, mMaterialItems.get(i))) { mMaterialItems.remove(i--); temp = true; } @@ -3136,43 +3136,43 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { */ public boolean isProperSolderingFluid() { return mStandardMoltenFluid != null && contains(SubTag.SOLDERING_MATERIAL) - && !(GregTech_API.mUseOnlyGoodSolderingMaterials && !contains(SubTag.SOLDERING_MATERIAL_GOOD)); + && !(GregTechAPI.mUseOnlyGoodSolderingMaterials && !contains(SubTag.SOLDERING_MATERIAL_GOOD)); } public ItemStack getCells(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.cell, this, amount); + return GTOreDictUnificator.get(OrePrefixes.cell, this, amount); } public ItemStack getDust(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.dust, this, amount); + return GTOreDictUnificator.get(OrePrefixes.dust, this, amount); } public ItemStack getDustSmall(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.dustSmall, this, amount); + return GTOreDictUnificator.get(OrePrefixes.dustSmall, this, amount); } public ItemStack getDustTiny(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.dustTiny, this, amount); + return GTOreDictUnificator.get(OrePrefixes.dustTiny, this, amount); } public ItemStack getGems(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.gem, this, amount); + return GTOreDictUnificator.get(OrePrefixes.gem, this, amount); } public ItemStack getIngots(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.ingot, this, amount); + return GTOreDictUnificator.get(OrePrefixes.ingot, this, amount); } public ItemStack getNuggets(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.nugget, this, amount); + return GTOreDictUnificator.get(OrePrefixes.nugget, this, amount); } public ItemStack getBlocks(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.block, this, amount); + return GTOreDictUnificator.get(OrePrefixes.block, this, amount); } public ItemStack getPlates(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.plate, this, amount); + return GTOreDictUnificator.get(OrePrefixes.plate, this, amount); } public static Materials getGtMaterialFromFluid(Fluid fluid) { @@ -3180,6 +3180,6 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } public ItemStack getNanite(int amount) { - return GT_OreDictUnificator.get(OrePrefixes.nanite, this, amount); + return GTOreDictUnificator.get(OrePrefixes.nanite, this, amount); } } diff --git a/src/main/java/gregtech/api/enums/MaterialsBotania.java b/src/main/java/gregtech/api/enums/MaterialsBotania.java index 6fe538a0bc..6373595e91 100644 --- a/src/main/java/gregtech/api/enums/MaterialsBotania.java +++ b/src/main/java/gregtech/api/enums/MaterialsBotania.java @@ -9,7 +9,7 @@ import static gregtech.api.enums.OrePrefixes.rotor; import java.util.Arrays; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.TCAspects.TC_AspectStack; public class MaterialsBotania { @@ -28,7 +28,7 @@ public class MaterialsBotania { .setBlastFurnaceTemp(1500) .setBlastFurnaceRequired(true) .setAspects( - Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3), new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + Arrays.asList(new TC_AspectStack(TCAspects.METALLUM, 3), new TC_AspectStack(TCAspects.PRAECANTATIO, 1))) .constructMaterial(); public static Materials Terrasteel = new MaterialBuilder(202, TextureSet.SET_METALLIC, "Terrasteel") .setName("Terrasteel") @@ -45,9 +45,9 @@ public class MaterialsBotania { .setBlastFurnaceRequired(true) .setAspects( Arrays.asList( - new TC_AspectStack(TC_Aspects.METALLUM, 2), - new TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + new TC_AspectStack(TCAspects.METALLUM, 2), + new TC_AspectStack(TCAspects.TERRA, 1), + new TC_AspectStack(TCAspects.PRAECANTATIO, 1))) .constructMaterial(); public static Materials ElvenElementium = new MaterialBuilder(203, TextureSet.SET_METALLIC, "Elven Elementium") .setName("ElvenElementium") @@ -64,9 +64,9 @@ public class MaterialsBotania { .setBlastFurnaceRequired(true) .setAspects( Arrays.asList( - new TC_AspectStack(TC_Aspects.METALLUM, 3), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 2), - new TC_AspectStack(TC_Aspects.AURAM, 1))) + new TC_AspectStack(TCAspects.METALLUM, 3), + new TC_AspectStack(TCAspects.PRAECANTATIO, 2), + new TC_AspectStack(TCAspects.AURAM, 1))) .constructMaterial(); public static Materials Livingrock = new MaterialBuilder(204, new TextureSet("Livingrock", true), "Livingrock") .setName("Livingrock") @@ -79,7 +79,7 @@ public class MaterialsBotania { .setOreValue(3) .setDensityMultiplier(1) .setDensityDivider(1) - .setAspects(Arrays.asList(new TC_AspectStack(TC_Aspects.TERRA, 2), new TC_AspectStack(TC_Aspects.VICTUS, 2))) + .setAspects(Arrays.asList(new TC_AspectStack(TCAspects.TERRA, 2), new TC_AspectStack(TCAspects.VICTUS, 2))) .constructMaterial(); public static Materials GaiaSpirit = new Materials( 205, @@ -105,10 +105,10 @@ public class MaterialsBotania { 1, Dyes._NULL, Arrays.asList( - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 27), - new TC_AspectStack(TC_Aspects.AURAM, 24), - new TC_AspectStack(TC_Aspects.VICTUS, 24), - new TC_AspectStack(TC_Aspects.METALLUM, 1))); + new TC_AspectStack(TCAspects.PRAECANTATIO, 27), + new TC_AspectStack(TCAspects.AURAM, 24), + new TC_AspectStack(TCAspects.VICTUS, 24), + new TC_AspectStack(TCAspects.METALLUM, 1))); public static Materials Livingwood = new MaterialBuilder(206, new TextureSet("Livingwood", true), "Livingwood") .setName("Livingwood") .addDustItems() @@ -121,7 +121,7 @@ public class MaterialsBotania { .setOreValue(3) .setDensityMultiplier(1) .setDensityDivider(1) - .setAspects(Arrays.asList(new TC_AspectStack(TC_Aspects.ARBOR, 4), new TC_AspectStack(TC_Aspects.VICTUS, 2))) + .setAspects(Arrays.asList(new TC_AspectStack(TCAspects.ARBOR, 4), new TC_AspectStack(TCAspects.VICTUS, 2))) .constructMaterial(); public static Materials Dreamwood = new MaterialBuilder(207, new TextureSet("Dreamwood", true), "Dreamwood") .setName("Dreamwood") @@ -137,9 +137,9 @@ public class MaterialsBotania { .setDensityDivider(1) .setAspects( Arrays.asList( - new TC_AspectStack(TC_Aspects.ARBOR, 4), - new TC_AspectStack(TC_Aspects.AURAM, 2), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + new TC_AspectStack(TCAspects.ARBOR, 4), + new TC_AspectStack(TCAspects.AURAM, 2), + new TC_AspectStack(TCAspects.PRAECANTATIO, 1))) .constructMaterial(); public static Materials ManaDiamond = new Materials( 208, @@ -165,9 +165,9 @@ public class MaterialsBotania { 1, Dyes._NULL, Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 4))); + new TCAspects.TC_AspectStack(TCAspects.PRAECANTATIO, 4), + new TCAspects.TC_AspectStack(TCAspects.VITREUS, 4), + new TCAspects.TC_AspectStack(TCAspects.LUCRUM, 4))); public static Materials BotaniaDragonstone = new Materials( 209, TextureSet.SET_DIAMOND, @@ -192,9 +192,9 @@ public class MaterialsBotania { 1, Dyes._NULL, Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 6), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6), - new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 4))); + new TCAspects.TC_AspectStack(TCAspects.PRAECANTATIO, 6), + new TCAspects.TC_AspectStack(TCAspects.VITREUS, 6), + new TCAspects.TC_AspectStack(TCAspects.AURAM, 4))); public static void init() { GaiaSpirit.mChemicalFormula = "Gs"; diff --git a/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java b/src/main/java/gregtech/api/enums/MaterialsGTNH.java index b65ac53499..12a53f6b86 100644 --- a/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java +++ b/src/main/java/gregtech/api/enums/MaterialsGTNH.java @@ -1,12 +1,12 @@ package gregtech.api.enums; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import gregtech.api.interfaces.IMaterialHandler; -public class GTNH_ExtraMaterials implements IMaterialHandler { +public class MaterialsGTNH implements IMaterialHandler { - public GTNH_ExtraMaterials() { + public MaterialsGTNH() { GT_FML_LOGGER.info("Registering GTNH-Materials (post Java 64kb limit)"); Materials.add(this); } diff --git a/src/main/java/gregtech/api/enums/MaterialsKevlar.java b/src/main/java/gregtech/api/enums/MaterialsKevlar.java index 6612bc8b65..bea0c0d244 100644 --- a/src/main/java/gregtech/api/enums/MaterialsKevlar.java +++ b/src/main/java/gregtech/api/enums/MaterialsKevlar.java @@ -21,8 +21,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.VENENUM, 1))) .constructMaterial(); // C15H10N2O2 public static Materials DiaminodiphenylmethanMixture = new MaterialBuilder( 795, @@ -39,8 +39,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Nitrogen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.VENENUM, 1))) .constructMaterial(); // C13H14N2 public static Materials DiphenylmethaneDiisocyanateMixture = new MaterialBuilder( 794, @@ -58,8 +58,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.VENENUM, 1))) .constructMaterial(); // C15H10N2O2 public static Materials Butyraldehyde = new MaterialBuilder(793, TextureSet.SET_FLUID, "Butyraldehyde") .setName("Butyraldehyde") @@ -74,8 +74,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 1)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.IGNIS, 1))) .constructMaterial(); // C4H8O public static Materials Isobutyraldehyde = new MaterialBuilder(792, TextureSet.SET_FLUID, "Isobutyraldehyde") .setName("Isobutyraldehyde") @@ -91,8 +91,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 1)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.IGNIS, 1))) .constructMaterial(); // C4H8O public static Materials NickelTetracarbonyl = new MaterialBuilder(791, TextureSet.SET_FLUID, "Nickel Tetracarbonyl") .setName("NickelTetracarbonyl") @@ -107,8 +107,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 4)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.METALLUM, 1))) .constructMaterial(); // C4NiO4 public static Materials KevlarCatalyst = new MaterialBuilder(790, TextureSet.SET_DULL, "Polyurethane Catalyst A") .setName("PolyurethaneCatalystADust") @@ -118,8 +118,8 @@ public class MaterialsKevlar { .setMeltingPoint(300) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.LUCRUM, 1))) .constructMaterial(); public static Materials EthyleneOxide = new MaterialBuilder(789, TextureSet.SET_FLUID, "Ethylene Oxide") .setName("EthyleneOxide") @@ -134,8 +134,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 1)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.IGNIS, 1))) .constructMaterial(); // C2H4O public static Materials SiliconOil = new MaterialBuilder(788, TextureSet.SET_FLUID, "Silicon Oil") .setName("SiliconOil") @@ -146,8 +146,8 @@ public class MaterialsKevlar { .setMeltingPoint(473) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.MACHINA, 1))) .constructMaterial(); public static Materials Ethyleneglycol = new MaterialBuilder(787, TextureSet.SET_FLUID, "Ethylene Glycol") .setName("EthyleneGlycol") @@ -162,8 +162,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.IGNIS, 1))) .constructMaterial(); // C2H6O2 public static Materials Acetaldehyde = new MaterialBuilder(786, TextureSet.SET_FLUID, "Acetaldehyde") .setName("Acetaldehyde") @@ -178,8 +178,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 1)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + new TCAspects.TC_AspectStack(TCAspects.AQUA, 1), + new TCAspects.TC_AspectStack(TCAspects.IGNIS, 1))) .constructMaterial(); // C2H4O public static Materials Pentaerythritol = new MaterialBuilder(785, TextureSet.SET_DULL, "Pentaerythritol") .setName("Pentaerythritol") @@ -193,8 +193,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 4)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.LUCRUM, 1))) .constructMaterial(); // C5H12O4 public static Materials PolyurethaneResin = new MaterialBuilder(784, TextureSet.SET_FLUID, "Polyurethane Resin") .setName("PolyurethaneResin") @@ -219,8 +219,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 1)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.VENENUM, 1))) .constructMaterial(); // C5H9NO public static Materials TerephthaloylChloride = new MaterialBuilder( 782, @@ -237,8 +237,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.VITREUS, 1))) .constructMaterial(); // C8H4Cl2O2 public static Materials Acetylene = new MaterialBuilder(781, TextureSet.SET_FLUID, "Acetylene").setName("Acetylene") .addCell() @@ -274,8 +274,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Oxygen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.VITREUS, 1))) .constructMaterial(); // C6H6N2O2 public static Materials ParaPhenylenediamine = new MaterialBuilder( 779, @@ -291,8 +291,8 @@ public class MaterialsKevlar { new MaterialStack(Materials.Nitrogen, 2)) .setAspects( Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + new TCAspects.TC_AspectStack(TCAspects.TERRA, 1), + new TCAspects.TC_AspectStack(TCAspects.VITREUS, 1))) .constructMaterial(); // C6H6N2 public static Materials Methylamine = new MaterialBuilder(778, TextureSet.SET_FLUID, "Methylamine") .setName("Methylamine") diff --git a/src/main/java/gregtech/api/enums/MaterialsUEVplus.java b/src/main/java/gregtech/api/enums/MaterialsUEVplus.java index 7542e1f600..49ab432c5f 100644 --- a/src/main/java/gregtech/api/enums/MaterialsUEVplus.java +++ b/src/main/java/gregtech/api/enums/MaterialsUEVplus.java @@ -283,7 +283,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .setProcessingMaterialTierEU(TierEU.RECIPE_UEV) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe(); @@ -310,7 +310,7 @@ public class MaterialsUEVplus { 1000, 1000, Dyes.dyeBlack, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe() .setProcessingMaterialTierEU(TierEU.RECIPE_UHV); @@ -337,7 +337,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .setProcessingMaterialTierEU(TierEU.RECIPE_UIV); public static Materials RawStarMatter = new Materials( 584, @@ -485,7 +485,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .setProcessingMaterialTierEU(TierEU.RECIPE_UMV); public static Materials Eternity = new Materials( @@ -511,7 +511,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe() .setProcessingMaterialTierEU(TierEU.RECIPE_UMV); @@ -563,7 +563,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.AQUA, 1))) .setProcessingMaterialTierEU(TierEU.RECIPE_UMV); public static Materials QuarkGluonPlasma = new Materials( @@ -661,7 +661,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.ITER, 1))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe() .setProcessingMaterialTierEU(TierEU.RECIPE_UEV); @@ -689,7 +689,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.SENSUS, 1))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe() .setProcessingMaterialTierEU(TierEU.RECIPE_UEV); @@ -717,7 +717,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.SENSUS, 1))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe() .setProcessingMaterialTierEU(TierEU.RECIPE_UEV) @@ -746,7 +746,7 @@ public class MaterialsUEVplus { 1, 1, Dyes._NULL, - Collections.singletonList(new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 150))) + Collections.singletonList(new TCAspects.TC_AspectStack(TCAspects.VACUOS, 150))) .disableAutoGeneratedBlastFurnaceRecipes() .disableAutoGeneratedVacuumFreezerRecipe(); diff --git a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java index 04a61c713e..4d11475ac4 100644 --- a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java +++ b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java @@ -560,10 +560,10 @@ public enum MetaTileEntityIDs { GT_Dehydrator_IV(814), GT_Dehydrator_LuV(815), GT_Dehydrator_ZPM(816), - GT_FluidTank_ULV(817), - GT_FluidTank_LV(818), - GT_FluidTank_MV(819), - GT_FluidTank_HV(820), + GTFluidTank_ULV(817), + GTFluidTank_LV(818), + GTFluidTank_MV(819), + GTFluidTank_HV(820), COMET_Cyclotron(828), Industrial_FishingPond(829), Geothermal_Engine_EV(830), diff --git a/src/main/java/gregtech/api/enums/OreMixes.java b/src/main/java/gregtech/api/enums/OreMixes.java index c5c306baab..0a4b2fbc4e 100644 --- a/src/main/java/gregtech/api/enums/OreMixes.java +++ b/src/main/java/gregtech/api/enums/OreMixes.java @@ -1,15 +1,15 @@ package gregtech.api.enums; -import static bloodasp.galacticgreg.api.enums.DimensionDef.*; +import static galacticgreg.api.enums.DimensionDef.*; import static gregtech.common.OreMixBuilder.NETHER; import static gregtech.common.OreMixBuilder.OW; import static gregtech.common.OreMixBuilder.THE_END; import static gregtech.common.OreMixBuilder.TWILIGHT_FOREST; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; -import bloodasp.galacticgreg.api.enums.DimensionDef; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import galacticgreg.WorldgenOreLayerSpace; +import galacticgreg.api.enums.DimensionDef; import gregtech.common.OreMixBuilder; +import gregtech.common.WorldgenGTOreLayer; public enum OreMixes { @@ -972,11 +972,11 @@ public enum OreMixes { this.oreMixBuilder = oreMixBuilder; } - public GT_Worldgen_GT_Ore_Layer addGTOreLayer() { - return new GT_Worldgen_GT_Ore_Layer(this.oreMixBuilder); + public WorldgenGTOreLayer addGTOreLayer() { + return new WorldgenGTOreLayer(this.oreMixBuilder); } - public GT_Worldgen_GT_Ore_Layer_Space addGaGregOreLayer() { - return new GT_Worldgen_GT_Ore_Layer_Space(this.oreMixBuilder); + public WorldgenOreLayerSpace addGaGregOreLayer() { + return new WorldgenOreLayerSpace(this.oreMixBuilder); } } diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 7beaea9254..5f1ca97e83 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -1,8 +1,8 @@ package gregtech.api.enums; -import static gregtech.api.enums.GT_Values.B; -import static gregtech.api.enums.GT_Values.D2; -import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GTValues.B; +import static gregtech.api.enums.GTValues.D2; +import static gregtech.api.enums.GTValues.M; import java.util.ArrayList; import java.util.Arrays; @@ -15,16 +15,16 @@ import net.minecraft.item.ItemStack; import com.google.common.collect.ImmutableList; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.TCAspects.TC_AspectStack; import gregtech.api.interfaces.ICondition; import gregtech.api.interfaces.IOreRecipeRegistrator; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.objects.GT_ArrayList; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTArrayList; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtility; import gregtech.loaders.materialprocessing.ProcessingModSupport; import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; import it.unimi.dsi.fastutil.objects.ObjectSet; @@ -932,7 +932,7 @@ public enum OrePrefixes { bulletGtLarge.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 3); } - public final ArrayList<ItemStack> mPrefixedItems = new GT_ArrayList<>(false, 16); + public final ArrayList<ItemStack> mPrefixedItems = new GTArrayList<>(false, 16); public final short mTextureIndex; public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, @@ -957,7 +957,7 @@ public enum OrePrefixes { private final ObjectSet<ItemStack> mContainsTestCache = new ObjectOpenCustomHashSet<>( 512, 0.5f, - GT_ItemStack.ITEMSTACK_HASH_STRATEGY2); + GTItemStack.ITEMSTACK_HASH_STRATEGY2); public static final List<OrePrefixes> mPreventableComponents = new LinkedList<>( Arrays.asList( OrePrefixes.gem, @@ -1037,36 +1037,36 @@ public enum OrePrefixes { mTextureIndex = (short) aTextureindex; if (name().startsWith("ore")) { - new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.TERRA, 1).addToAspectList(mAspects); } else if (name().startsWith("wire") || name().startsWith("cable")) { - new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.ELECTRUM, 1).addToAspectList(mAspects); } else if (name().startsWith("dust")) { - new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.PERDITIO, 1).addToAspectList(mAspects); } else if (name().startsWith("crushed")) { - new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.PERFODIO, 1).addToAspectList(mAspects); } else if (name().startsWith("ingot") || name().startsWith("nugget")) { - new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.METALLUM, 1).addToAspectList(mAspects); } else if (name().startsWith("armor")) { - new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.TUTAMEN, 1).addToAspectList(mAspects); } else if (name().startsWith("stone")) { - new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.TERRA, 1).addToAspectList(mAspects); } else if (name().startsWith("pipe")) { - new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.ITER, 1).addToAspectList(mAspects); } else if (name().startsWith("gear")) { - new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects); - new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.MOTUS, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.MACHINA, 1).addToAspectList(mAspects); } else if (name().startsWith("frame") || name().startsWith("plate")) { - new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.FABRICO, 1).addToAspectList(mAspects); } else if (name().startsWith("tool")) { - new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.INSTRUMENTUM, 2).addToAspectList(mAspects); } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) { - new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.VITREUS, 1).addToAspectList(mAspects); } else if (name().startsWith("circuit")) { - new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.COGNITIO, 1).addToAspectList(mAspects); } else if (name().startsWith("computer")) { - new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.COGNITIO, 4).addToAspectList(mAspects); } else if (name().startsWith("battery")) { - new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + new TC_AspectStack(TCAspects.ELECTRUM, 1).addToAspectList(mAspects); } } @@ -1113,7 +1113,7 @@ public enum OrePrefixes { } public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) { - Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false); + Object tObject = GTUtility.getFieldContent(OrePrefixes.class, aPrefixName, false, false); if (tObject instanceof OrePrefixes) return (OrePrefixes) tObject; return aReplacement; } @@ -1145,13 +1145,13 @@ public enum OrePrefixes { } public boolean contains(ItemStack aStack) { - return !GT_Utility.isStackInvalid(aStack) && mContainsTestCache.contains(aStack); + return !GTUtility.isStackInvalid(aStack) && mContainsTestCache.contains(aStack); } public boolean containsUnCached(ItemStack aStack) { // In case someone needs this for (ItemStack tStack : mPrefixedItems) { - if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) { + if (GTUtility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) { return true; } } @@ -1197,20 +1197,20 @@ public enum OrePrefixes { } if (!((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) - && GT_Utility.isStackValid(aStack))) { + && GTUtility.isStackValid(aStack))) { return; } for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { - if (D2) GT_Log.ore.println( + if (D2) GTLog.ore.println( "Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.mName + "' at " - + GT_Utility.getClassName(tRegistrator)); - tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); + + GTUtility.getClassName(tRegistrator)); + tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GTUtility.copyAmount(1, aStack)); } } diff --git a/src/main/java/gregtech/api/enums/SmallOres.java b/src/main/java/gregtech/api/enums/SmallOres.java index 6de67bc3b9..3cd15b5f86 100644 --- a/src/main/java/gregtech/api/enums/SmallOres.java +++ b/src/main/java/gregtech/api/enums/SmallOres.java @@ -1,43 +1,43 @@ package gregtech.api.enums; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Anubis; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Asteroids; -import static bloodasp.galacticgreg.api.enums.DimensionDef.BarnardE; -import static bloodasp.galacticgreg.api.enums.DimensionDef.BarnardF; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Callisto; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Ceres; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Deimos; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Enceladus; -import static bloodasp.galacticgreg.api.enums.DimensionDef.EndAsteroids; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Ganymede; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Haumea; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Horus; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Io; -import static bloodasp.galacticgreg.api.enums.DimensionDef.KuiperBelt; -import static bloodasp.galacticgreg.api.enums.DimensionDef.MakeMake; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Mars; -import static bloodasp.galacticgreg.api.enums.DimensionDef.MehenBelt; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Mercury; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Miranda; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Moon; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Oberon; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Phobos; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Pluto; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Proteus; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Seth; -import static bloodasp.galacticgreg.api.enums.DimensionDef.TcetiE; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Titan; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Triton; -import static bloodasp.galacticgreg.api.enums.DimensionDef.VegaB; -import static bloodasp.galacticgreg.api.enums.DimensionDef.Venus; +import static galacticgreg.api.enums.DimensionDef.Anubis; +import static galacticgreg.api.enums.DimensionDef.Asteroids; +import static galacticgreg.api.enums.DimensionDef.BarnardE; +import static galacticgreg.api.enums.DimensionDef.BarnardF; +import static galacticgreg.api.enums.DimensionDef.Callisto; +import static galacticgreg.api.enums.DimensionDef.Ceres; +import static galacticgreg.api.enums.DimensionDef.Deimos; +import static galacticgreg.api.enums.DimensionDef.Enceladus; +import static galacticgreg.api.enums.DimensionDef.EndAsteroids; +import static galacticgreg.api.enums.DimensionDef.Ganymede; +import static galacticgreg.api.enums.DimensionDef.Haumea; +import static galacticgreg.api.enums.DimensionDef.Horus; +import static galacticgreg.api.enums.DimensionDef.Io; +import static galacticgreg.api.enums.DimensionDef.KuiperBelt; +import static galacticgreg.api.enums.DimensionDef.MakeMake; +import static galacticgreg.api.enums.DimensionDef.Mars; +import static galacticgreg.api.enums.DimensionDef.MehenBelt; +import static galacticgreg.api.enums.DimensionDef.Mercury; +import static galacticgreg.api.enums.DimensionDef.Miranda; +import static galacticgreg.api.enums.DimensionDef.Moon; +import static galacticgreg.api.enums.DimensionDef.Oberon; +import static galacticgreg.api.enums.DimensionDef.Phobos; +import static galacticgreg.api.enums.DimensionDef.Pluto; +import static galacticgreg.api.enums.DimensionDef.Proteus; +import static galacticgreg.api.enums.DimensionDef.Seth; +import static galacticgreg.api.enums.DimensionDef.TcetiE; +import static galacticgreg.api.enums.DimensionDef.Titan; +import static galacticgreg.api.enums.DimensionDef.Triton; +import static galacticgreg.api.enums.DimensionDef.VegaB; +import static galacticgreg.api.enums.DimensionDef.Venus; import static gregtech.common.SmallOreBuilder.NETHER; import static gregtech.common.SmallOreBuilder.OW; import static gregtech.common.SmallOreBuilder.THE_END; import static gregtech.common.SmallOreBuilder.TWILIGHT_FOREST; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; -import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import galacticgreg.WorldgenOreSmallSpace; import gregtech.common.SmallOreBuilder; +import gregtech.common.WorldgenGTOreSmallPieces; public enum SmallOres { @@ -545,11 +545,11 @@ public enum SmallOres { this.smallOreBuilder = smallOreBuilder; } - public GT_Worldgen_GT_Ore_SmallPieces addGTSmallOre() { - return new GT_Worldgen_GT_Ore_SmallPieces(this.smallOreBuilder); + public WorldgenGTOreSmallPieces addGTSmallOre() { + return new WorldgenGTOreSmallPieces(this.smallOreBuilder); } - public GT_Worldgen_GT_Ore_SmallPieces_Space addGaGregSmallOre() { - return new GT_Worldgen_GT_Ore_SmallPieces_Space(this.smallOreBuilder); + public WorldgenOreSmallSpace addGaGregSmallOre() { + return new WorldgenOreSmallSpace(this.smallOreBuilder); } } diff --git a/src/main/java/gregtech/api/enums/SoundResource.java b/src/main/java/gregtech/api/enums/SoundResource.java index 712c1b5016..e2a6b2630a 100644 --- a/src/main/java/gregtech/api/enums/SoundResource.java +++ b/src/main/java/gregtech/api/enums/SoundResource.java @@ -12,6 +12,8 @@ import net.minecraft.util.ResourceLocation; import com.google.common.collect.Maps; +import gregtech.api.GregTechAPI; + /** * Enumerates known sounds with id and resource-location * @@ -361,7 +363,7 @@ public enum SoundResource { /** * Provides a backward-compatible Sounds {@code Map<Integer, String>} sound list * - * @return The map for the deprecated {@link gregtech.api.GregTech_API#sSoundList} + * @return The map for the deprecated {@link GregTechAPI#sSoundList} * @deprecated This method is planned for removal. * <p> * Use this {@link SoundResource} enum instead. diff --git a/src/main/java/gregtech/api/enums/TAE.java b/src/main/java/gregtech/api/enums/TAE.java index 246b2006ea..79d3037a5a 100644 --- a/src/main/java/gregtech/api/enums/TAE.java +++ b/src/main/java/gregtech/api/enums/TAE.java @@ -8,9 +8,9 @@ import gregtech.api.interfaces.ITexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; +import gtPlusPlus.xmod.gregtech.api.objects.GTPPCopiedBlockTexture; public class TAE { @@ -19,7 +19,7 @@ public class TAE { public static int gtPPLastUsedIndex = 64; public static int secondaryIndex = 0; - public static HashMap<Integer, GTPP_CopiedBlockTexture> mTAE = new HashMap<>(); + public static HashMap<Integer, GTPPCopiedBlockTexture> mTAE = new HashMap<>(); private static final HashSet<Integer> mFreeSlots = new HashSet<>(64); static { @@ -31,23 +31,23 @@ public class TAE { /** * - * @param aPage - The Texture page (0-3) - * @param aID - The ID on the specified page (0-15) - * @param GTPP_CopiedBlockTexture - The Texture to register + * @param aPage - The Texture page (0-3) + * @param aID - The ID on the specified page (0-15) + * @param GTPPCopiedBlockTexture - The Texture to register * @return - Did it register correctly? */ - public static boolean registerTexture(int aPage, int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { + public static boolean registerTexture(int aPage, int aID, GTPPCopiedBlockTexture GTPPCopiedBlockTexture) { int aRealID = aID + (aPage * 16); - return registerTexture(64 + aRealID, GTPP_CopiedBlockTexture); + return registerTexture(64 + aRealID, GTPPCopiedBlockTexture); } - public static boolean registerTexture(int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { + public static boolean registerTexture(int aID, GTPPCopiedBlockTexture GTPPCopiedBlockTexture) { if (mFreeSlots.contains(aID)) { mFreeSlots.remove(aID); - mTAE.put(aID, GTPP_CopiedBlockTexture); + mTAE.put(aID, GTPPCopiedBlockTexture); return true; } else { - CORE.crash("Tried to register texture with ID " + aID + " to TAE, but it is already in use."); + GTPPCore.crash("Tried to register texture with ID " + aID + " to TAE, but it is already in use."); return false; // Dead Code } } @@ -69,7 +69,7 @@ public class TAE { Logger.INFO("Free Page slots within TAE: " + aPageAndSlotFree); Logger.INFO("Filling them with ERROR textures."); for (int aFreeSlot : aTemp.values()) { - registerTexture(aFreeSlot, new GTPP_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); + registerTexture(aFreeSlot, new GTPPCopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); } Logger.INFO("Finalising TAE."); for (int aKeyTae : mTAE.keySet()) { @@ -78,7 +78,7 @@ public class TAE { Logger.INFO("Finalised TAE."); } - private static boolean registerTextures(GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { + private static boolean registerTextures(GTPPCopiedBlockTexture GTPPCopiedBlockTexture) { try { // Handle page 2. Logger.INFO("[TAE} Registering Texture, Last used casing ID is " + gtPPLastUsedIndex + "."); @@ -87,7 +87,7 @@ public class TAE { if (x != null) { ITexture[][] h = (ITexture[][]) x.get(null); if (h != null) { - h[64][secondaryIndex++] = GTPP_CopiedBlockTexture; + h[64][secondaryIndex++] = GTPPCopiedBlockTexture; x.set(null, h); Logger .INFO("[TAE} Registered Texture with ID " + (secondaryIndex - 1) + " in secondary index."); @@ -98,7 +98,7 @@ public class TAE { // set to page 1. else { - Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPP_CopiedBlockTexture); + Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPPCopiedBlockTexture); Logger.INFO("[TAE} Registered Texture with ID " + (gtPPLastUsedIndex) + " in main index."); gtPPLastUsedIndex++; return true; diff --git a/src/main/java/gregtech/api/enums/TC_Aspects.java b/src/main/java/gregtech/api/enums/TCAspects.java index 24d19b0b73..31ec9c0bc8 100644 --- a/src/main/java/gregtech/api/enums/TC_Aspects.java +++ b/src/main/java/gregtech/api/enums/TCAspects.java @@ -2,7 +2,7 @@ package gregtech.api.enums; import java.util.List; -public enum TC_Aspects { +public enum TCAspects { AER(1), ALIENIS(20), @@ -66,16 +66,16 @@ public enum TC_Aspects { public final int mValue; - TC_Aspects(int aValue) { + TCAspects(int aValue) { mValue = aValue; } public static class TC_AspectStack { - public TC_Aspects mAspect; + public TCAspects mAspect; public long mAmount; - public TC_AspectStack(TC_Aspects aAspect, long aAmount) { + public TC_AspectStack(TCAspects aAspect, long aAmount) { mAspect = aAspect; mAmount = aAmount; } diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 7caa8f41e5..7e5aedbcea 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -9,11 +9,11 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class Textures { @@ -1762,17 +1762,17 @@ public class Textures { Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa)); casingTexturePages[0] = new ITexture[128]; // adds some known pages, modders also can do it... - GT_Utility.addTexturePage((byte) 1); - GT_Utility.addTexturePage((byte) 2); - GT_Utility.addTexturePage((byte) 8); - GT_Utility.addTexturePage((byte) 16); + GTUtility.addTexturePage((byte) 1); + GTUtility.addTexturePage((byte) 2); + GTUtility.addTexturePage((byte) 8); + GTUtility.addTexturePage((byte) 16); setCasingTextureForId(ERROR_TEXTURE_INDEX, ERROR_RENDERING[0]); } IIcon mIcon; BlockIcons() { - GregTech_API.sGTBlockIconload.add(this); + GregTechAPI.sGTBlockIconload.add(this); } public static ITexture getCasingTextureForId(int id) { @@ -1813,7 +1813,7 @@ public class Textures { @Override public void run() { - mIcon = GregTech_API.sBlockIcons.registerIcon(GregTech.getResourcePath("iconsets", this.toString())); + mIcon = GregTechAPI.sBlockIcons.registerIcon(GregTech.getResourcePath("iconsets", this.toString())); } public static class CustomIcon implements IIconContainer, Runnable { @@ -1823,12 +1823,12 @@ public class Textures { public CustomIcon(String aIconName) { mIconName = !aIconName.contains(":") ? GregTech.getResourcePath(aIconName) : aIconName; - GregTech_API.sGTBlockIconload.add(this); + GregTechAPI.sGTBlockIconload.add(this); } @Override public void run() { - mIcon = GregTech_API.sBlockIcons.registerIcon(mIconName); + mIcon = GregTechAPI.sBlockIcons.registerIcon(mIconName); } @Override @@ -1918,7 +1918,7 @@ public class Textures { IIcon mIcon, mOverlay; ItemIcons() { - GregTech_API.sGTItemIconload.add(this); + GregTechAPI.sGTItemIconload.add(this); } @Override @@ -1938,8 +1938,8 @@ public class Textures { @Override public void run() { - mIcon = GregTech_API.sItemIcons.registerIcon(GregTech.getResourcePath("iconsets", this.toString())); - mOverlay = GregTech_API.sItemIcons.registerIcon(GregTech.getResourcePath("iconsets", this + "_OVERLAY")); + mIcon = GregTechAPI.sItemIcons.registerIcon(GregTech.getResourcePath("iconsets", this.toString())); + mOverlay = GregTechAPI.sItemIcons.registerIcon(GregTech.getResourcePath("iconsets", this + "_OVERLAY")); } public static class CustomIcon implements IIconContainer, Runnable { @@ -1949,7 +1949,7 @@ public class Textures { public CustomIcon(String aIconName) { mIconName = aIconName; - GregTech_API.sGTItemIconload.add(this); + GregTechAPI.sGTItemIconload.add(this); } @Override @@ -1969,8 +1969,8 @@ public class Textures { @Override public void run() { - mIcon = GregTech_API.sItemIcons.registerIcon(GregTech.getResourcePath(mIconName)); - mOverlay = GregTech_API.sItemIcons.registerIcon(GregTech.getResourcePath(mIconName + "_OVERLAY")); + mIcon = GregTechAPI.sItemIcons.registerIcon(GregTech.getResourcePath(mIconName)); + mOverlay = GregTechAPI.sItemIcons.registerIcon(GregTech.getResourcePath(mIconName + "_OVERLAY")); } } } diff --git a/src/main/java/gregtech/api/enums/Tier.java b/src/main/java/gregtech/api/enums/Tier.java index 2d64444283..572f2e8b2a 100644 --- a/src/main/java/gregtech/api/enums/Tier.java +++ b/src/main/java/gregtech/api/enums/Tier.java @@ -1,6 +1,6 @@ package gregtech.api.enums; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; /** * Experimental Class for later diff --git a/src/main/java/gregtech/api/enums/TierEU.java b/src/main/java/gregtech/api/enums/TierEU.java index 26b6393115..713f48b3ff 100644 --- a/src/main/java/gregtech/api/enums/TierEU.java +++ b/src/main/java/gregtech/api/enums/TierEU.java @@ -1,40 +1,40 @@ package gregtech.api.enums; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; public class TierEU { // Do NOT use these for crafting recipes as they are exactly 1A! Use RECIPE_ULV etc. - public static final long ULV = V[GTVoltageIndex.ULV]; - public static final long LV = V[GTVoltageIndex.LV]; - public static final long MV = V[GTVoltageIndex.MV]; - public static final long HV = V[GTVoltageIndex.HV]; - public static final long EV = V[GTVoltageIndex.EV]; - public static final long IV = V[GTVoltageIndex.IV]; - public static final long LuV = V[GTVoltageIndex.LuV]; - public static final long ZPM = V[GTVoltageIndex.ZPM]; - public static final long UV = V[GTVoltageIndex.UV]; - public static final long UHV = V[GTVoltageIndex.UHV]; - public static final long UEV = V[GTVoltageIndex.UEV]; - public static final long UIV = V[GTVoltageIndex.UIV]; - public static final long UMV = V[GTVoltageIndex.UMV]; - public static final long UXV = V[GTVoltageIndex.UXV]; - public static final long MAX = V[GTVoltageIndex.MAX]; + public static final long ULV = V[VoltageIndex.ULV]; + public static final long LV = V[VoltageIndex.LV]; + public static final long MV = V[VoltageIndex.MV]; + public static final long HV = V[VoltageIndex.HV]; + public static final long EV = V[VoltageIndex.EV]; + public static final long IV = V[VoltageIndex.IV]; + public static final long LuV = V[VoltageIndex.LuV]; + public static final long ZPM = V[VoltageIndex.ZPM]; + public static final long UV = V[VoltageIndex.UV]; + public static final long UHV = V[VoltageIndex.UHV]; + public static final long UEV = V[VoltageIndex.UEV]; + public static final long UIV = V[VoltageIndex.UIV]; + public static final long UMV = V[VoltageIndex.UMV]; + public static final long UXV = V[VoltageIndex.UXV]; + public static final long MAX = V[VoltageIndex.MAX]; // Use me for recipes. - public static final long RECIPE_ULV = GT_Values.VP[GTVoltageIndex.ULV]; - public static final long RECIPE_LV = GT_Values.VP[GTVoltageIndex.LV]; - public static final long RECIPE_MV = GT_Values.VP[GTVoltageIndex.MV]; - public static final long RECIPE_HV = GT_Values.VP[GTVoltageIndex.HV]; - public static final long RECIPE_EV = GT_Values.VP[GTVoltageIndex.EV]; - public static final long RECIPE_IV = GT_Values.VP[GTVoltageIndex.IV]; - public static final long RECIPE_LuV = GT_Values.VP[GTVoltageIndex.LuV]; - public static final long RECIPE_ZPM = GT_Values.VP[GTVoltageIndex.ZPM]; - public static final long RECIPE_UV = GT_Values.VP[GTVoltageIndex.UV]; - public static final long RECIPE_UHV = GT_Values.VP[GTVoltageIndex.UHV]; - public static final long RECIPE_UEV = GT_Values.VP[GTVoltageIndex.UEV]; - public static final long RECIPE_UIV = GT_Values.VP[GTVoltageIndex.UIV]; - public static final long RECIPE_UMV = GT_Values.VP[GTVoltageIndex.UMV]; - public static final long RECIPE_UXV = GT_Values.VP[GTVoltageIndex.UXV]; - public static final long RECIPE_MAX = GT_Values.VP[GTVoltageIndex.MAX]; + public static final long RECIPE_ULV = GTValues.VP[VoltageIndex.ULV]; + public static final long RECIPE_LV = GTValues.VP[VoltageIndex.LV]; + public static final long RECIPE_MV = GTValues.VP[VoltageIndex.MV]; + public static final long RECIPE_HV = GTValues.VP[VoltageIndex.HV]; + public static final long RECIPE_EV = GTValues.VP[VoltageIndex.EV]; + public static final long RECIPE_IV = GTValues.VP[VoltageIndex.IV]; + public static final long RECIPE_LuV = GTValues.VP[VoltageIndex.LuV]; + public static final long RECIPE_ZPM = GTValues.VP[VoltageIndex.ZPM]; + public static final long RECIPE_UV = GTValues.VP[VoltageIndex.UV]; + public static final long RECIPE_UHV = GTValues.VP[VoltageIndex.UHV]; + public static final long RECIPE_UEV = GTValues.VP[VoltageIndex.UEV]; + public static final long RECIPE_UIV = GTValues.VP[VoltageIndex.UIV]; + public static final long RECIPE_UMV = GTValues.VP[VoltageIndex.UMV]; + public static final long RECIPE_UXV = GTValues.VP[VoltageIndex.UXV]; + public static final long RECIPE_MAX = GTValues.VP[VoltageIndex.MAX]; } diff --git a/src/main/java/gregtech/api/enums/VoidingMode.java b/src/main/java/gregtech/api/enums/VoidingMode.java index 8ae9dda57d..c41236c8ab 100644 --- a/src/main/java/gregtech/api/enums/VoidingMode.java +++ b/src/main/java/gregtech/api/enums/VoidingMode.java @@ -8,28 +8,27 @@ import javax.annotation.Nonnull; import com.gtnewhorizons.modularui.api.drawable.UITexture; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; public enum VoidingMode { /** * Voids nothing, protects both item and fluid */ - VOID_NONE(true, true, GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_NONE, "none"), + VOID_NONE(true, true, GTUITextures.BUTTON_STANDARD, GTUITextures.OVERLAY_BUTTON_VOID_EXCESS_NONE, "none"), /** * Voids item, protects fluid */ - VOID_ITEM(false, true, GT_UITextures.BUTTON_STANDARD_PRESSED, GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ITEM, - "item"), + VOID_ITEM(false, true, GTUITextures.BUTTON_STANDARD_PRESSED, GTUITextures.OVERLAY_BUTTON_VOID_EXCESS_ITEM, "item"), /** * Voids fluid, protects item */ - VOID_FLUID(true, false, GT_UITextures.BUTTON_STANDARD_PRESSED, GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_FLUID, + VOID_FLUID(true, false, GTUITextures.BUTTON_STANDARD_PRESSED, GTUITextures.OVERLAY_BUTTON_VOID_EXCESS_FLUID, "fluid"), /** * Voids all, protects nothing */ - VOID_ALL(false, false, GT_UITextures.BUTTON_STANDARD_PRESSED, GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ALL, "all"); + VOID_ALL(false, false, GTUITextures.BUTTON_STANDARD_PRESSED, GTUITextures.OVERLAY_BUTTON_VOID_EXCESS_ALL, "all"); /** * Default set of voiding mode you will probably support. diff --git a/src/main/java/gregtech/api/enums/GTVoltageIndex.java b/src/main/java/gregtech/api/enums/VoltageIndex.java index c5c2c215b0..f0303b27b0 100644 --- a/src/main/java/gregtech/api/enums/GTVoltageIndex.java +++ b/src/main/java/gregtech/api/enums/VoltageIndex.java @@ -1,6 +1,6 @@ package gregtech.api.enums; -public class GTVoltageIndex { +public class VoltageIndex { public final static int ULV = 0; public final static int LV = 1; @@ -18,5 +18,5 @@ public class GTVoltageIndex { public final static int UXV = 13; public final static int MAX = 14; - private GTVoltageIndex() {} + private VoltageIndex() {} } diff --git a/src/main/java/gregtech/api/fluid/GT_FluidFactory.java b/src/main/java/gregtech/api/fluid/GTFluidFactory.java index 7c65956c69..291cdf3384 100644 --- a/src/main/java/gregtech/api/fluid/GT_FluidFactory.java +++ b/src/main/java/gregtech/api/fluid/GTFluidFactory.java @@ -6,9 +6,9 @@ import net.minecraftforge.fluids.FluidRegistry; import gregtech.api.enums.FluidState; import gregtech.api.enums.Materials; -import gregtech.api.interfaces.fluid.IGT_Fluid; -import gregtech.api.interfaces.fluid.IGT_FluidBuilder; -import gregtech.common.fluid.GT_FluidBuilder; +import gregtech.api.interfaces.fluid.IGTFluid; +import gregtech.api.interfaces.fluid.IGTFluidBuilder; +import gregtech.common.fluid.GTFluidBuilder; /** * <p> @@ -17,12 +17,12 @@ import gregtech.common.fluid.GT_FluidBuilder; * <ol> * <li> * <p> - * Build {@link IGT_Fluid} instances. + * Build {@link IGTFluid} instances. * </p> * </li> * <li> * <p> - * Register the corresponding {@link Fluid}, built from an {@link IGT_Fluid}, to the {@link FluidRegistry}: + * Register the corresponding {@link Fluid}, built from an {@link IGTFluid}, to the {@link FluidRegistry}: * </p> * <ul> * <li> @@ -40,15 +40,15 @@ import gregtech.common.fluid.GT_FluidBuilder; * </ol> */ @SuppressWarnings("unused") // API might legitimately expose unused methods within this local project's scope -public class GT_FluidFactory { +public class GTFluidFactory { /** * Helper for quick fluid creation and registration * * @param fluidName The name key of the {@link Fluid} to register in the {@link FluidRegistry} - * @param localizedName The localized name of this {@link IGT_Fluid} - * @param material The {@link Materials} of this {@link IGT_Fluid} - * @param state The {@link FluidState} of this {@link IGT_Fluid} + * @param localizedName The localized name of this {@link IGTFluid} + * @param material The {@link Materials} of this {@link IGTFluid} + * @param state The {@link FluidState} of this {@link IGTFluid} * @param temperature The fluid temperature in Kelvin * @return the registered {@link Fluid} */ @@ -65,8 +65,8 @@ public class GT_FluidFactory { * Helper for quick fluid creation and registration * * @param fluidName The name key of the {@link Fluid} to register in the {@link FluidRegistry} - * @param localizedName The localized name of this {@link IGT_Fluid} - * @param state The {@link FluidState} of this {@link IGT_Fluid} + * @param localizedName The localized name of this {@link IGTFluid} + * @param state The {@link FluidState} of this {@link IGTFluid} * @param temperature The fluid temperature in Kelvin * @return the registered {@link Fluid} */ @@ -79,12 +79,12 @@ public class GT_FluidFactory { } /** - * Gets an {@link IGT_Fluid} builder instance + * Gets an {@link IGTFluid} builder instance * * @param fluidName The name key of the {@link Fluid} to register in the {@link FluidRegistry} - * @return the {@link IGT_FluidBuilder} instance + * @return the {@link IGTFluidBuilder} instance */ - public static IGT_FluidBuilder builder(final String fluidName) { - return new GT_FluidBuilder(fluidName); + public static IGTFluidBuilder builder(final String fluidName) { + return new GTFluidBuilder(fluidName); } } diff --git a/src/main/java/gregtech/api/fluid/FluidTankGT.java b/src/main/java/gregtech/api/fluid/GTFluidTank.java index 0c224985e6..46fc098000 100644 --- a/src/main/java/gregtech/api/fluid/FluidTankGT.java +++ b/src/main/java/gregtech/api/fluid/GTFluidTank.java @@ -15,11 +15,11 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidTank; import gregtech.api.interfaces.fluid.IFluidStore; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; -public class FluidTankGT implements IFluidTank, IFluidStore { +public class GTFluidTank implements IFluidTank, IFluidStore { - public final FluidTankGT[] AS_ARRAY = new FluidTankGT[] { this }; + public final GTFluidTank[] AS_ARRAY = new GTFluidTank[] { this }; private FluidStack mFluid; private long mCapacity = 0, mAmount = 0; private boolean mPreventDraining = false, mVoidExcess = false, mChangedFluids = false; @@ -30,15 +30,15 @@ public class FluidTankGT implements IFluidTank, IFluidStore { /** Gives you a Tank Index in case there is multiple Tanks on a TileEntity that cares. */ public int mIndex = 0; - public FluidTankGT() { + public GTFluidTank() { mCapacity = Long.MAX_VALUE; } - public FluidTankGT(long aCapacity) { + public GTFluidTank(long aCapacity) { mCapacity = aCapacity; } - public FluidTankGT(FluidStack aFluid) { + public GTFluidTank(FluidStack aFluid) { mFluid = aFluid; if (aFluid != null) { mCapacity = aFluid.amount; @@ -46,33 +46,33 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } } - public FluidTankGT(FluidStack aFluid, long aCapacity) { + public GTFluidTank(FluidStack aFluid, long aCapacity) { mFluid = aFluid; mCapacity = aCapacity; mAmount = (aFluid == null ? 0 : aFluid.amount); } - public FluidTankGT(FluidStack aFluid, long aAmount, long aCapacity) { + public GTFluidTank(FluidStack aFluid, long aAmount, long aCapacity) { mFluid = aFluid; mCapacity = aCapacity; mAmount = (aFluid == null ? 0 : aAmount); } - public FluidTankGT(Fluid aFluid, long aAmount) { + public GTFluidTank(Fluid aFluid, long aAmount) { this(new FluidStack(aFluid, saturatedCast(aAmount))); mAmount = aAmount; } - public FluidTankGT(Fluid aFluid, long aAmount, long aCapacity) { + public GTFluidTank(Fluid aFluid, long aAmount, long aCapacity) { this(new FluidStack(aFluid, saturatedCast(aAmount)), aCapacity); mAmount = aAmount; } - public FluidTankGT(NBTTagCompound aNBT, String aKey, long aCapacity) { + public GTFluidTank(NBTTagCompound aNBT, String aKey, long aCapacity) { this(aNBT.hasKey(aKey) ? aNBT.getCompoundTag(aKey) : null, aCapacity); } - public FluidTankGT(NBTTagCompound aNBT, long aCapacity) { + public GTFluidTank(NBTTagCompound aNBT, long aCapacity) { mCapacity = aCapacity; if (aNBT != null && !aNBT.hasNoTags()) { mFluid = FluidStack.loadFluidStackFromNBT(aNBT); @@ -80,7 +80,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } } - public FluidTankGT readFromNBT(NBTTagCompound aNBT, String aKey) { + public GTFluidTank readFromNBT(NBTTagCompound aNBT, String aKey) { if (aNBT.hasKey(aKey)) { aNBT = aNBT.getCompoundTag(aKey); if (aNBT != null && !aNBT.hasNoTags()) { @@ -269,7 +269,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } /** Resets Tank Contents entirely */ - public FluidTankGT setEmpty() { + public GTFluidTank setEmpty() { mFluid = null; mChangedFluids = true; mAmount = 0; @@ -277,7 +277,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } /** Sets Fluid Content, taking Amount from the Fluid Parameter */ - public FluidTankGT setFluid(FluidStack aFluid) { + public GTFluidTank setFluid(FluidStack aFluid) { mFluid = aFluid; mChangedFluids = true; mAmount = (aFluid == null ? 0 : aFluid.amount); @@ -285,7 +285,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } /** Sets Fluid Content and Amount */ - public FluidTankGT setFluid(FluidStack aFluid, long aAmount) { + public GTFluidTank setFluid(FluidStack aFluid, long aAmount) { mFluid = aFluid; mChangedFluids = true; mAmount = (aFluid == null ? 0 : aAmount); @@ -293,7 +293,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } /** Sets Fluid Content, taking Amount from the Tank Parameter */ - public FluidTankGT setFluid(FluidTankGT aTank) { + public GTFluidTank setFluid(GTFluidTank aTank) { mFluid = new FluidStack(aTank.mFluid, saturatedCast(aTank.mAmount)); mChangedFluids = true; mAmount = aTank.mAmount; @@ -301,48 +301,48 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } /** Sets the Tank Index for easier Reverse Mapping. */ - public FluidTankGT setIndex(int aIndex) { + public GTFluidTank setIndex(int aIndex) { mIndex = aIndex; return this; } /** Sets the Capacity */ - public FluidTankGT setCapacity(long aCapacity) { + public GTFluidTank setCapacity(long aCapacity) { if (aCapacity >= 0) mCapacity = aCapacity; return this; } /** Sets the Capacity Multiplier */ - public FluidTankGT setCapacityMultiplier(long aCapacityMultiplier) { + public GTFluidTank setCapacityMultiplier(long aCapacityMultiplier) { if (aCapacityMultiplier >= 0) mAdjustableMultiplier = aCapacityMultiplier; return this; } /** Sets Tank capacity Map, should it be needed. */ - public FluidTankGT setCapacity(Map<String, Long> aMap, long aCapacityMultiplier) { + public GTFluidTank setCapacity(Map<String, Long> aMap, long aCapacityMultiplier) { mAdjustableCapacity = aMap; mAdjustableMultiplier = aCapacityMultiplier; return this; } /** Always keeps at least 0 Liters of Fluid instead of setting it to null */ - public FluidTankGT setPreventDraining() { + public GTFluidTank setPreventDraining() { return setPreventDraining(true); } /** Always keeps at least 0 Liters of Fluid instead of setting it to null */ - public FluidTankGT setPreventDraining(boolean aPrevent) { + public GTFluidTank setPreventDraining(boolean aPrevent) { mPreventDraining = aPrevent; return this; } /** Voids any Overlow */ - public FluidTankGT setVoidExcess() { + public GTFluidTank setVoidExcess() { return setVoidExcess(true); } /** Voids any Overlow */ - public FluidTankGT setVoidExcess(boolean aVoidExcess) { + public GTFluidTank setVoidExcess(boolean aVoidExcess) { mVoidExcess = aVoidExcess; return this; } @@ -382,7 +382,7 @@ public class FluidTankGT implements IFluidTank, IFluidStore { } public boolean contains(FluidStack aFluid) { - return GT_Utility.areFluidsEqual(mFluid, aFluid); + return GTUtility.areFluidsEqual(mFluid, aFluid); } public boolean has(long aAmount) { @@ -460,12 +460,12 @@ public class FluidTankGT implements IFluidTank, IFluidStore { return new FluidTankInfo(isEmpty() ? null : mFluid.copy(), saturatedCast(capacity())); } - public static FluidStack[] getFluidsFromTanks(FluidTankGT[] tanks) { + public static FluidStack[] getFluidsFromTanks(GTFluidTank[] tanks) { if (tanks == null) { return null; } List<FluidStack> fluidStacks = new ArrayList<>(); - for (FluidTankGT tank : tanks) { + for (GTFluidTank tank : tanks) { if (tank.getFluid() != null) { fluidStacks.add(tank.getFluid()); } @@ -480,6 +480,6 @@ public class FluidTankGT implements IFluidTank, IFluidStore { @Override public boolean canStoreFluid(@Nonnull FluidStack fluidStack) { - return GT_Utility.areFluidsEqual(mFluid, fluidStack); + return GTUtility.areFluidsEqual(mFluid, fluidStack); } } diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java index 7289f0faad..7eb8382e87 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java @@ -1,6 +1,6 @@ package gregtech.api.graphs; -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; +import static gregtech.api.enums.GTValues.ALL_VALID_SIDES; import java.util.ArrayList; import java.util.HashSet; diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java index 95f9aee32d..4203bbdc0a 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java @@ -7,7 +7,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import cofh.api.energy.IEnergyReceiver; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.graphs.consumers.ConsumerNode; import gregtech.api.graphs.consumers.EmptyPowerConsumer; import gregtech.api.graphs.consumers.NodeEnergyConnected; @@ -20,7 +20,7 @@ import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.metatileentity.implementations.MTECable; import ic2.api.energy.tile.IEnergySink; // node map generator for power distribution @@ -32,8 +32,7 @@ public class GenerateNodeMapPower extends GenerateNodeMap { @Override protected boolean isPipe(TileEntity aTileEntity) { - return super.isPipe(aTileEntity) - && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable; + return super.isPipe(aTileEntity) && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof MTECable; } @Override @@ -74,7 +73,7 @@ public class GenerateNodeMapPower extends GenerateNodeMap { aConsumers.add(tConsumerNode); return true; } - } else if (GregTech_API.mOutputRF && aTileEntity instanceof IEnergyReceiver receiver) { + } else if (GregTechAPI.mOutputRF && aTileEntity instanceof IEnergyReceiver receiver) { ConsumerNode tConsumerNode = new NodeEnergyReceiver(aNodeValue, receiver, side, aConsumers); aConsumers.add(tConsumerNode); return true; diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java index 4f35922029..e9364f922b 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java @@ -8,13 +8,13 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import cofh.api.energy.IEnergyReceiver; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.SoundResource; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.GT_Pollution; +import gregtech.common.Pollution; // consumer for RF machines public class NodeEnergyReceiver extends ConsumerNode { @@ -29,7 +29,7 @@ public class NodeEnergyReceiver extends ConsumerNode { @Override public int injectEnergy(long aVoltage, long aMaxAmps) { ForgeDirection tDirection = mSide; - int rfOut = GT_Utility.safeInt(aVoltage * GregTech_API.mEUtoRF / 100); + int rfOut = GTUtility.safeInt(aVoltage * GregTechAPI.mEUtoRF / 100); int ampsUsed = 0; if (mRestRF < rfOut) { mRestRF += rfOut; @@ -40,7 +40,7 @@ public class NodeEnergyReceiver extends ConsumerNode { mRestRF -= consumed; return ampsUsed; } - if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions + if (GregTechAPI.mRFExplosions && GregTechAPI.sMachineExplosions && ((IEnergyReceiver) mTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) { explode(rfOut); } @@ -49,14 +49,14 @@ public class NodeEnergyReceiver extends ConsumerNode { // copied from IEnergyConnected private void explode(int aRfOut) { - if (aRfOut > 32L * GregTech_API.mEUtoRF / 100L) { - float tStrength = GT_Values.getExplosionPowerForVoltage(aRfOut); + if (aRfOut > 32L * GregTechAPI.mEUtoRF / 100L) { + float tStrength = GTValues.getExplosionPowerForVoltage(aRfOut); int tX = mTileEntity.xCoord, tY = mTileEntity.yCoord, tZ = mTileEntity.zCoord; World tWorld = mTileEntity.getWorldObj(); - GT_Utility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ); + GTUtility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) GT_Pollution - .addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), GT_Mod.gregtechproxy.mPollutionOnExplosion); + if (GregTechAPI.sMachineExplosions) if (GTMod.gregtechproxy.mPollution) Pollution + .addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), GTMod.gregtechproxy.mPollutionOnExplosion); new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setStrength(tStrength) .setSmoking(true) diff --git a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java index d09cf059e9..e9421056af 100644 --- a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java +++ b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java @@ -5,7 +5,7 @@ import net.minecraft.server.MinecraftServer; import gregtech.api.enums.TickTime; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.metatileentity.implementations.MTECable; import gregtech.api.util.AveragePerTickCounter; // path for cables @@ -49,7 +49,7 @@ public class PowerNodePath extends NodePath { if (aVoltage > mMaxVoltage) { lock.addTileEntity(null); for (MetaPipeEntity tCable : mPipes) { - if (((GT_MetaPipeEntity_Cable) tCable).mVoltage < this.mVoltage) { + if (((MTECable) tCable).mVoltage < this.mVoltage) { BaseMetaPipeEntity tBaseCable = (BaseMetaPipeEntity) tCable.getBaseMetaTileEntity(); if (tBaseCable != null) { tBaseCable.setToFire(); @@ -75,7 +75,7 @@ public class PowerNodePath extends NodePath { if (this.mAmps > mMaxAmps * 40) { lock.addTileEntity(null); for (MetaPipeEntity tCable : mPipes) { - if (((GT_MetaPipeEntity_Cable) tCable).mAmperage * 40 < this.mAmps) { + if (((MTECable) tCable).mAmperage * 40 < this.mAmps) { BaseMetaPipeEntity tBaseCable = (BaseMetaPipeEntity) tCable.getBaseMetaTileEntity(); if (tBaseCable != null) { tBaseCable.setToFire(); @@ -107,10 +107,10 @@ public class PowerNodePath extends NodePath { mMaxAmps = Integer.MAX_VALUE; mMaxVoltage = Integer.MAX_VALUE; for (MetaPipeEntity tCable : mPipes) { - if (tCable instanceof GT_MetaPipeEntity_Cable) { - mMaxAmps = Math.min(((GT_MetaPipeEntity_Cable) tCable).mAmperage, mMaxAmps); - mLoss += ((GT_MetaPipeEntity_Cable) tCable).mCableLossPerMeter; - mMaxVoltage = Math.min(((GT_MetaPipeEntity_Cable) tCable).mVoltage, mMaxVoltage); + if (tCable instanceof MTECable) { + mMaxAmps = Math.min(((MTECable) tCable).mAmperage, mMaxAmps); + mLoss += ((MTECable) tCable).mCableLossPerMeter; + mMaxVoltage = Math.min(((MTECable) tCable).mVoltage, mMaxVoltage); } } } diff --git a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java b/src/main/java/gregtech/api/gui/GUIColorOverride.java index 6ade7b030d..aa796d2b63 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java +++ b/src/main/java/gregtech/api/gui/GUIColorOverride.java @@ -15,11 +15,11 @@ import com.google.common.util.concurrent.UncheckedExecutionException; import cpw.mods.fml.relauncher.FMLLaunchHandler; import cpw.mods.fml.relauncher.Side; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.util.ColorsMetadataSection; @SuppressWarnings("UnstableApiUsage") -public class GT_GUIColorOverride { +public class GUIColorOverride { private static final Object NOT_FOUND = new Object(); private static final LoadingCache<ResourceLocation, Object> cache = CacheBuilder.newBuilder() @@ -39,29 +39,29 @@ public class GT_GUIColorOverride { return NOT_FOUND; } }); - private static final GT_GUIColorOverride FALLBACK = new GT_GUIColorOverride(); + private static final GUIColorOverride FALLBACK = new GUIColorOverride(); private ColorsMetadataSection cmSection; - public static GT_GUIColorOverride get(String fullLocation) { + public static GUIColorOverride get(String fullLocation) { // see other get for more info if (FMLLaunchHandler.side() != Side.CLIENT) return FALLBACK; - return new GT_GUIColorOverride(new ResourceLocation(fullLocation)); + return new GUIColorOverride(new ResourceLocation(fullLocation)); } - public static GT_GUIColorOverride get(ResourceLocation path) { + public static GUIColorOverride get(ResourceLocation path) { // use dummy fallback if there isn't such thing as a resource pack. // #side() usually has two possible return value, but since this might be called by test code, it might // also return null when in test env. Using #isClient will cause a NPE. A plain inequality test won't. // FMLCommonHandler's #getSide() might trigger a NPE when in test env, so no. if (FMLLaunchHandler.side() != Side.CLIENT) return FALLBACK; - return new GT_GUIColorOverride(path); + return new GUIColorOverride(path); } - private GT_GUIColorOverride() { + private GUIColorOverride() { cmSection = null; } - private GT_GUIColorOverride(ResourceLocation resourceLocation) { + private GUIColorOverride(ResourceLocation resourceLocation) { try { Object metadata = cache.get(resourceLocation); if (metadata != NOT_FOUND) cmSection = (ColorsMetadataSection) metadata; @@ -80,7 +80,7 @@ public class GT_GUIColorOverride { } public boolean sGuiTintingEnabled() { - return sLoaded() ? cmSection.sGuiTintingEnabled() : GregTech_API.sColoredGUI; + return sLoaded() ? cmSection.sGuiTintingEnabled() : GregTechAPI.sColoredGUI; } public boolean sLoaded() { diff --git a/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java b/src/main/java/gregtech/api/gui/modularui/CoverUIBuildContext.java index f98d6099fc..2bf8795c5c 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java +++ b/src/main/java/gregtech/api/gui/modularui/CoverUIBuildContext.java @@ -7,7 +7,7 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_CoverUIBuildContext extends UIBuildContext { +public class CoverUIBuildContext extends UIBuildContext { // cover data is not synced to client, while ID is private final int coverID; @@ -24,7 +24,7 @@ public class GT_CoverUIBuildContext extends UIBuildContext { * @param anotherWindow If cover UI is shown on top of another window * @param guiColorization The color used to render machine's GUI */ - public GT_CoverUIBuildContext(EntityPlayer player, int coverID, ForgeDirection side, ICoverable tile, + public CoverUIBuildContext(EntityPlayer player, int coverID, ForgeDirection side, ICoverable tile, boolean anotherWindow, int guiColorization) { super(player); this.coverID = coverID; @@ -41,7 +41,7 @@ public class GT_CoverUIBuildContext extends UIBuildContext { * @param tile Tile this cover is attached to * @param anotherWindow If cover GUI is shown in opened on top of another window */ - public GT_CoverUIBuildContext(EntityPlayer player, int coverID, ForgeDirection side, ICoverable tile, + public CoverUIBuildContext(EntityPlayer player, int coverID, ForgeDirection side, ICoverable tile, boolean anotherWindow) { this(player, coverID, side, tile, anotherWindow, tile.getGUIColorization()); } diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java b/src/main/java/gregtech/api/gui/modularui/GTUIInfos.java index ea9a39bdf8..ede4b54e08 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java +++ b/src/main/java/gregtech/api/gui/modularui/GTUIInfos.java @@ -23,13 +23,13 @@ import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.net.GT_Packet_SendCoverData; -import gregtech.api.util.GT_CoverBehaviorBase; +import gregtech.api.net.GTPacketSendCoverData; +import gregtech.api.util.CoverBehaviorBase; -public class GT_UIInfos { +public class GTUIInfos { public static void init() {} @@ -70,7 +70,7 @@ public class GT_UIInfos { .container((player, world, x, y, z) -> { final TileEntity te = world.getTileEntity(x, y, z); if (!(te instanceof ICoverable gtTileEntity)) return null; - final GT_CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); + final CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); return createCoverContainer( player, cover::createWindow, @@ -83,7 +83,7 @@ public class GT_UIInfos { if (!world.isRemote) return null; final TileEntity te = world.getTileEntity(x, y, z); if (!(te instanceof ICoverable gtTileEntity)) return null; - final GT_CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); + final CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); return createCoverGuiContainer( player, cover::createWindow, @@ -109,13 +109,13 @@ public class GT_UIInfos { } /** - * Opens cover UI, created by {@link GT_CoverBehaviorBase#createWindow}. + * Opens cover UI, created by {@link CoverBehaviorBase#createWindow}. */ public static void openCoverUI(ICoverable tileEntity, EntityPlayer player, ForgeDirection side) { if (tileEntity.isClientSide()) return; - GT_Values.NW.sendToPlayer( - new GT_Packet_SendCoverData( + GTValues.NW.sendToPlayer( + new GTPacketSendCoverData( side, tileEntity.getCoverIDAtSide(side), tileEntity.getComplexCoverDataAtSide(side), @@ -162,9 +162,9 @@ public class GT_UIInfos { } private static ModularUIContainer createCoverContainer(EntityPlayer player, - Function<GT_CoverUIBuildContext, ModularWindow> windowCreator, Runnable onWidgetUpdate, int coverID, + Function<CoverUIBuildContext, ModularWindow> windowCreator, Runnable onWidgetUpdate, int coverID, ForgeDirection side, ICoverable tile) { - final GT_CoverUIBuildContext buildContext = new GT_CoverUIBuildContext(player, coverID, side, tile, false); + final CoverUIBuildContext buildContext = new CoverUIBuildContext(player, coverID, side, tile, false); final ModularWindow window = windowCreator.apply(buildContext); if (window == null) return null; return new ModularUIContainer(new ModularUIContext(buildContext, onWidgetUpdate), window); @@ -172,8 +172,7 @@ public class GT_UIInfos { @SideOnly(Side.CLIENT) private static ModularGui createCoverGuiContainer(EntityPlayer player, - Function<GT_CoverUIBuildContext, ModularWindow> windowCreator, int coverID, ForgeDirection side, - ICoverable tile) { + Function<CoverUIBuildContext, ModularWindow> windowCreator, int coverID, ForgeDirection side, ICoverable tile) { final ModularUIContainer container = createCoverContainer(player, windowCreator, null, coverID, side, tile); if (container == null) { return null; diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java b/src/main/java/gregtech/api/gui/modularui/GTUITextures.java index 6031399c06..125e1640b0 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java +++ b/src/main/java/gregtech/api/gui/modularui/GTUITextures.java @@ -10,7 +10,7 @@ import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture; import com.gtnewhorizons.modularui.api.drawable.UITexture; -public class GT_UITextures { +public class GTUITextures { public static final UITexture TRANSPARENT = UITexture.fullImage(GregTech.ID, "gui/picture/transparent"); diff --git a/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java b/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java index 18d7741421..0063d59346 100644 --- a/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java +++ b/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java @@ -30,29 +30,26 @@ public class GUITextureSet { private UITexture gregtechLogo; public static final GUITextureSet DEFAULT = new GUITextureSet() - .setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) + .setMainBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) .setItemSlot(ModularUITextures.ITEM_SLOT) .setFluidSlot(ModularUITextures.FLUID_SLOT) - .setCoverTab( - GT_UITextures.TAB_COVER_NORMAL, - GT_UITextures.TAB_COVER_HIGHLIGHT, - GT_UITextures.TAB_COVER_DISABLED) - .setTitleTab(GT_UITextures.TAB_TITLE, GT_UITextures.TAB_TITLE_DARK, GT_UITextures.TAB_TITLE_ANGULAR) - .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); + .setCoverTab(GTUITextures.TAB_COVER_NORMAL, GTUITextures.TAB_COVER_HIGHLIGHT, GTUITextures.TAB_COVER_DISABLED) + .setTitleTab(GTUITextures.TAB_TITLE, GTUITextures.TAB_TITLE_DARK, GTUITextures.TAB_TITLE_ANGULAR) + .setGregTechLogo(GTUITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); public static final Function<SteamVariant, GUITextureSet> STEAM = steamVariant -> new GUITextureSet() - .setMainBackground(GT_UITextures.BACKGROUND_STEAM.get(steamVariant)) - .setItemSlot(GT_UITextures.SLOT_ITEM_STEAM.get(steamVariant)) - .setFluidSlot(GT_UITextures.SLOT_FLUID_STEAM.get(steamVariant)) + .setMainBackground(GTUITextures.BACKGROUND_STEAM.get(steamVariant)) + .setItemSlot(GTUITextures.SLOT_ITEM_STEAM.get(steamVariant)) + .setFluidSlot(GTUITextures.SLOT_FLUID_STEAM.get(steamVariant)) .setCoverTab( - GT_UITextures.TAB_COVER_STEAM_NORMAL.get(steamVariant), - GT_UITextures.TAB_COVER_STEAM_HIGHLIGHT.get(steamVariant), - GT_UITextures.TAB_COVER_STEAM_DISABLED.get(steamVariant)) + GTUITextures.TAB_COVER_STEAM_NORMAL.get(steamVariant), + GTUITextures.TAB_COVER_STEAM_HIGHLIGHT.get(steamVariant), + GTUITextures.TAB_COVER_STEAM_DISABLED.get(steamVariant)) .setTitleTab( - GT_UITextures.TAB_TITLE_STEAM.getAdaptable(steamVariant), - GT_UITextures.TAB_TITLE_DARK_STEAM.getAdaptable(steamVariant), - GT_UITextures.TAB_TITLE_ANGULAR_STEAM.getAdaptable(steamVariant)) - .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM.get(steamVariant)); + GTUITextures.TAB_TITLE_STEAM.getAdaptable(steamVariant), + GTUITextures.TAB_TITLE_DARK_STEAM.getAdaptable(steamVariant), + GTUITextures.TAB_TITLE_ANGULAR_STEAM.getAdaptable(steamVariant)) + .setGregTechLogo(GTUITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM.get(steamVariant)); public GUITextureSet() {} diff --git a/src/main/java/gregtech/api/gui/widgets/GT_CoverTickRateButton.java b/src/main/java/gregtech/api/gui/widgets/CoverTickRateButton.java index 883ffb4079..ab05a98925 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_CoverTickRateButton.java +++ b/src/main/java/gregtech/api/gui/widgets/CoverTickRateButton.java @@ -1,6 +1,6 @@ package gregtech.api.gui.widgets; -import static gregtech.api.gui.modularui.GT_UITextures.OVERLAY_BUTTON_HOURGLASS; +import static gregtech.api.gui.modularui.GTUITextures.OVERLAY_BUTTON_HOURGLASS; import static gregtech.common.covers.CoverInfo.MAX_TICK_RATE_ADDITION; import java.util.List; @@ -16,18 +16,18 @@ import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.common.covers.CoverInfo; -public class GT_CoverTickRateButton extends ButtonWidget { +public class CoverTickRateButton extends ButtonWidget { - private static final UITexture BACKGROUND = GT_UITextures.BUTTON_COVER_NORMAL.getSubArea(0, 0, 1, 0.5f); + private static final UITexture BACKGROUND = GTUITextures.BUTTON_COVER_NORMAL.getSubArea(0, 0, 1, 0.5f); private final CoverInfo coverInfo; private int clientTickRate; private int tickRateAddition; - public GT_CoverTickRateButton(@NotNull CoverInfo coverInfo, @NotNull IWidgetBuilder<?> builder) { + public CoverTickRateButton(@NotNull CoverInfo coverInfo, @NotNull IWidgetBuilder<?> builder) { this.coverInfo = coverInfo; this.clientTickRate = coverInfo.getTickRate(); this.tickRateAddition = coverInfo.getTickRateAddition(); diff --git a/src/main/java/gregtech/api/gui/widgets/GT_LockedWhileActiveButton.java b/src/main/java/gregtech/api/gui/widgets/LockedWhileActiveButton.java index 9a93a8fadf..0e793372c5 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_LockedWhileActiveButton.java +++ b/src/main/java/gregtech/api/gui/widgets/LockedWhileActiveButton.java @@ -16,15 +16,15 @@ import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.tileentity.IMachineProgress; -public class GT_LockedWhileActiveButton extends ButtonWidget { +public class LockedWhileActiveButton extends ButtonWidget { @NotNull private final IMachineProgress machine; - public GT_LockedWhileActiveButton(@NotNull IMachineProgress machine, @NotNull ModularWindow.Builder builder) { + public LockedWhileActiveButton(@NotNull IMachineProgress machine, @NotNull ModularWindow.Builder builder) { super(); this.machine = machine; @@ -74,7 +74,7 @@ public class GT_LockedWhileActiveButton extends ButtonWidget { private IDrawable[] appendLockedOverlay(@NotNull IDrawable[] drawables) { if (machine.isActive()) { final IDrawable[] copy = Arrays.copyOf(drawables, drawables.length + 1); - copy[drawables.length] = GT_UITextures.OVERLAY_BUTTON_LOCKED; + copy[drawables.length] = GTUITextures.OVERLAY_BUTTON_LOCKED; return copy; } return drawables; diff --git a/src/main/java/gregtech/api/gui/widgets/GT_PhantomItemButton.java b/src/main/java/gregtech/api/gui/widgets/PhantomItemButton.java index 4e2d144aa7..e13266b33f 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_PhantomItemButton.java +++ b/src/main/java/gregtech/api/gui/widgets/PhantomItemButton.java @@ -16,18 +16,18 @@ import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.metatileentity.IItemLockable; /** * Creates a phantom item in a GUI. Useful for filtering. */ -public class GT_PhantomItemButton extends SlotWidget { +public class PhantomItemButton extends SlotWidget { public static final IDrawable[] FILTER_BACKGROUND = { ModularUITextures.ITEM_SLOT, - GT_UITextures.OVERLAY_SLOT_FILTER }; + GTUITextures.OVERLAY_SLOT_FILTER }; - public GT_PhantomItemButton(final IItemLockable delegate) { + public PhantomItemButton(final IItemLockable delegate) { super(BaseSlot.phantom(new PhantomItemDelegate(delegate), 0)); controlsAmount = false; } diff --git a/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java b/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java index b0d42f9aec..b26c7035c7 100644 --- a/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java +++ b/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java @@ -4,9 +4,11 @@ import javax.annotation.Nullable; import net.minecraft.tileentity.TileEntity; +import gregtech.common.Pollution; + /** * Implement this interface for TileEntities that can have association to cleanroom. - * Calling {@link gregtech.common.GT_Pollution#addPollution(TileEntity, int)} from this machine + * Calling {@link Pollution#addPollution(TileEntity, int)} from this machine * will pollute associated cleanroom. */ public interface ICleanroomReceiver { diff --git a/src/main/java/gregtech/api/interfaces/IConfigurationCircuitSupport.java b/src/main/java/gregtech/api/interfaces/IConfigurationCircuitSupport.java index 8dde8163c8..5f225b0b4f 100644 --- a/src/main/java/gregtech/api/interfaces/IConfigurationCircuitSupport.java +++ b/src/main/java/gregtech/api/interfaces/IConfigurationCircuitSupport.java @@ -4,7 +4,7 @@ import java.util.List; import net.minecraft.item.ItemStack; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; /** * Implement this interface if your tileentity (or metatileentity) supports configuration circuits to resolve recipe @@ -24,7 +24,7 @@ public interface IConfigurationCircuitSupport { * This list is unmodifiable. Its elements are not supposed to be modified in any way! */ default List<ItemStack> getConfigurationCircuits() { - return GregTech_API.getConfigurationCircuitList(100); + return GregTechAPI.getConfigurationCircuitList(100); } /** diff --git a/src/main/java/gregtech/api/interfaces/IFoodStat.java b/src/main/java/gregtech/api/interfaces/IFoodStat.java index c768c5ca1c..4b1bd121e9 100644 --- a/src/main/java/gregtech/api/interfaces/IFoodStat.java +++ b/src/main/java/gregtech/api/interfaces/IFoodStat.java @@ -4,34 +4,34 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; -import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.MetaBaseItem; public interface IFoodStat { /** * Warning the "aPlayer" Parameter may be null! */ - int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + int getFoodLevel(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + float getSaturation(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + boolean alwaysEdible(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + boolean isRotten(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); + EnumAction getFoodAction(MetaBaseItem aItem, ItemStack aStack); - void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + void onEaten(MetaBaseItem aItem, ItemStack aStack, EntityPlayer aPlayer); } diff --git a/src/main/java/gregtech/api/interfaces/IGT_ItemWithMaterialRenderer.java b/src/main/java/gregtech/api/interfaces/IGT_ItemWithMaterialRenderer.java index 4bf0311544..1dc460f3de 100644 --- a/src/main/java/gregtech/api/interfaces/IGT_ItemWithMaterialRenderer.java +++ b/src/main/java/gregtech/api/interfaces/IGT_ItemWithMaterialRenderer.java @@ -6,22 +6,24 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; +import gregtech.common.render.items.GeneratedItemRenderer; +import gregtech.common.render.items.GeneratedMaterialRenderer; +import gregtech.common.render.items.MetaGeneratedItemRenderer; public interface IGT_ItemWithMaterialRenderer { /** - * @return If allow using {@link gregtech.common.render.items.GT_MetaGenerated_Item_Renderer} to render item + * @return If allow using {@link MetaGeneratedItemRenderer} to render item */ boolean shouldUseCustomRenderer(int aMetaData); /** * @return Custom renderer of the Material with offset < 32000 */ - GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData); + GeneratedMaterialRenderer getMaterialRenderer(int aMetaData); /** - * If this returns false, renderer falls back to {@link gregtech.common.render.items.GT_GeneratedItem_Renderer} + * If this returns false, renderer falls back to {@link GeneratedItemRenderer} */ boolean allowMaterialRenderer(int aMetaData); diff --git a/src/main/java/gregtech/api/interfaces/IHatchElement.java b/src/main/java/gregtech/api/interfaces/IHatchElement.java index 482b7899ab..9618c1ee1b 100644 --- a/src/main/java/gregtech/api/interfaces/IHatchElement.java +++ b/src/main/java/gregtech/api/interfaces/IHatchElement.java @@ -11,18 +11,17 @@ import net.minecraftforge.common.util.ForgeDirection; import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.StructureUtility; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_StructureUtility; -import gregtech.api.util.IGT_HatchAdder; +import gregtech.api.util.GTStructureUtility; +import gregtech.api.util.IGTHatchAdder; public interface IHatchElement<T> { List<? extends Class<? extends IMetaTileEntity>> mteClasses(); - IGT_HatchAdder<? super T> adder(); + IGTHatchAdder<? super T> adder(); String name(); @@ -44,7 +43,7 @@ public interface IHatchElement<T> { return new HatchElement<>(aClasses, null, null, null, this); } - default <T2 extends T> IHatchElement<T2> withAdder(IGT_HatchAdder<T2> aAdder) { + default <T2 extends T> IHatchElement<T2> withAdder(IGTHatchAdder<T2> aAdder) { if (aAdder == null) throw new IllegalArgumentException(); return new HatchElement<>(null, aAdder, null, null, this); } @@ -61,7 +60,7 @@ public interface IHatchElement<T> { default <T2 extends T> IStructureElement<T2> newAny(int aCasingIndex, int aDot) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); - return GT_StructureUtility.<T2>buildHatchAdder() + return GTStructureUtility.<T2>buildHatchAdder() .anyOf(this) .casingIndex(aCasingIndex) .dot(aDot) @@ -73,17 +72,17 @@ public interface IHatchElement<T> { default <T2 extends T> IStructureElement<T2> newAnyOrCasing(int aCasingIndex, int aDot, Block casingBlock, int casingMeta) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); - return GT_StructureUtility.<T2>buildHatchAdder() + return GTStructureUtility.<T2>buildHatchAdder() .anyOf(this) .casingIndex(aCasingIndex) .dot(aDot) .continueIfSuccess() - .buildAndChain(StructureUtility.ofBlock(casingBlock, casingMeta)); + .buildAndChain(com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock(casingBlock, casingMeta)); } default <T2 extends T> IStructureElement<T2> newAny(int aCasingIndex, int aDot, ForgeDirection... allowedFacings) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); - return GT_StructureUtility.<T2>buildHatchAdder() + return GTStructureUtility.<T2>buildHatchAdder() .anyOf(this) .casingIndex(aCasingIndex) .dot(aDot) @@ -96,7 +95,7 @@ public interface IHatchElement<T> { default <T2 extends T> IStructureElement<T2> newAny(int aCasingIndex, int aDot, BiPredicate<? super T2, ? super IGregTechTileEntity> aShouldSkip) { if (aCasingIndex < 0 || aDot < 0 || aShouldSkip == null) throw new IllegalArgumentException(); - return GT_StructureUtility.<T2>buildHatchAdder() + return GTStructureUtility.<T2>buildHatchAdder() .anyOf(this) .casingIndex(aCasingIndex) .dot(aDot) @@ -131,7 +130,7 @@ class HatchElementEither<T> implements IHatchElement<T> { } @Override - public IGT_HatchAdder<? super T> adder() { + public IGTHatchAdder<? super T> adder() { return ((t, te, i) -> first.adder() .apply(t, te, i) || second.adder() @@ -153,12 +152,12 @@ class HatchElementEither<T> implements IHatchElement<T> { class HatchElement<T> implements IHatchElement<T> { private final List<Class<? extends IMetaTileEntity>> mClasses; - private final IGT_HatchAdder<? super T> mAdder; + private final IGTHatchAdder<? super T> mAdder; private final String mName; private final IHatchElement<? super T> mBacking; private final ToLongFunction<? super T> mCount; - public HatchElement(List<Class<? extends IMetaTileEntity>> aMteClasses, IGT_HatchAdder<? super T> aAdder, + public HatchElement(List<Class<? extends IMetaTileEntity>> aMteClasses, IGTHatchAdder<? super T> aAdder, String aName, ToLongFunction<? super T> aCount, IHatchElement<? super T> aBacking) { this.mClasses = aMteClasses; this.mAdder = aAdder; @@ -173,7 +172,7 @@ class HatchElement<T> implements IHatchElement<T> { } @Override - public IGT_HatchAdder<? super T> adder() { + public IGTHatchAdder<? super T> adder() { return mAdder == null ? mBacking.adder() : mAdder; } @@ -194,7 +193,7 @@ class HatchElement<T> implements IHatchElement<T> { } @Override - public <T2 extends T> IHatchElement<T2> withAdder(IGT_HatchAdder<T2> aAdder) { + public <T2 extends T> IHatchElement<T2> withAdder(IGTHatchAdder<T2> aAdder) { if (aAdder == null) throw new IllegalArgumentException(); return new HatchElement<>(mClasses, aAdder, mName, mCount, mBacking); } diff --git a/src/main/java/gregtech/api/interfaces/IIconContainer.java b/src/main/java/gregtech/api/interfaces/IIconContainer.java index 525721bb5c..319615b58d 100644 --- a/src/main/java/gregtech/api/interfaces/IIconContainer.java +++ b/src/main/java/gregtech/api/interfaces/IIconContainer.java @@ -1,6 +1,6 @@ package gregtech.api.interfaces; -import static gregtech.api.enums.GT_Values.UNCOLORED_RGBA; +import static gregtech.api.enums.GTValues.UNCOLORED_RGBA; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java index 67bb505c6b..d9f8706824 100644 --- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -13,7 +13,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.SubTag; -import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.MetaBaseItem; public interface IItemBehaviour<E extends Item> { @@ -37,7 +37,7 @@ public interface IItemBehaviour<E extends Item> { ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack); - boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack); + boolean hasProjectile(MetaBaseItem aItem, SubTag aProjectileType, ItemStack aStack); EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); diff --git a/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java b/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java index 1dd36d9998..4af8ec232c 100644 --- a/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java +++ b/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java @@ -4,8 +4,10 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import gregtech.api.net.GTPacketUpdateItem; + /** - * Together with {@link gregtech.api.net.GT_Packet_UpdateItem} you can request server side to update item in hand with a + * Together with {@link GTPacketUpdateItem} you can request server side to update item in hand with a * NBT tag. * <p> * Usual NBT tag size limit applies. diff --git a/src/main/java/gregtech/api/interfaces/IRecipeMap.java b/src/main/java/gregtech/api/interfaces/IRecipeMap.java index ce48b29927..c6184bee34 100644 --- a/src/main/java/gregtech/api/interfaces/IRecipeMap.java +++ b/src/main/java/gregtech/api/interfaces/IRecipeMap.java @@ -7,9 +7,9 @@ import java.util.function.Function; import javax.annotation.Nonnull; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTUtility; /** * Represents the target of a recipe adding action, usually, but not necessarily, is a recipe map itself. @@ -33,7 +33,7 @@ public interface IRecipeMap { * Actually add the recipe represented by the builder. CAN modify the builder's internal states!!! */ @Nonnull - Collection<GT_Recipe> doAdd(GT_RecipeBuilder builder); + Collection<GTRecipe> doAdd(GTRecipeBuilder builder); /** * Return a variant of this recipe map that will perform a deep copy on input recipe builder before doing anything @@ -45,7 +45,7 @@ public interface IRecipeMap { return newRecipeMap(b -> doAdd(b.copy())); } - static IRecipeMap newRecipeMap(Function<? super GT_RecipeBuilder, Collection<GT_Recipe>> func) { + static IRecipeMap newRecipeMap(Function<? super GTRecipeBuilder, Collection<GTRecipe>> func) { return new IRecipeMap() { private final Collection<IRecipeMap> downstreams = new ArrayList<>(); @@ -57,9 +57,9 @@ public interface IRecipeMap { @Nonnull @Override - public Collection<GT_Recipe> doAdd(GT_RecipeBuilder builder) { - List<Collection<GT_Recipe>> ret = new ArrayList<>(); - Collection<GT_Recipe> out = func.apply(builder); + public Collection<GTRecipe> doAdd(GTRecipeBuilder builder) { + List<Collection<GTRecipe>> ret = new ArrayList<>(); + Collection<GTRecipe> out = func.apply(builder); ret.add(out); builder.clearInvalid(); if (!out.isEmpty()) { @@ -67,7 +67,7 @@ public interface IRecipeMap { ret.add(downstream.doAdd(builder)); } } - return GT_Utility.concat(ret); + return GTUtility.concat(ret); } }; } diff --git a/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java index 0eea6ca3a4..a0a362c4e5 100644 --- a/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java +++ b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java @@ -5,7 +5,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.CoverBehavior; /** * Implemented by the MetaTileEntity of the Redstone Circuit Block @@ -36,7 +36,7 @@ public interface IRedstoneCircuitBlock { /** * If this Side is Covered up and therefor not doing any Redstone */ - GT_CoverBehavior getCover(ForgeDirection side); + CoverBehavior getCover(ForgeDirection side); int getCoverID(ForgeDirection side); diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java index 9d8da63b6c..6f506a6ee1 100644 --- a/src/main/java/gregtech/api/interfaces/IToolStats.java +++ b/src/main/java/gregtech/api/interfaces/IToolStats.java @@ -16,7 +16,7 @@ import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; /** * The Stats for GT Tools. Not including any Material Modifiers. @@ -33,7 +33,7 @@ public interface IToolStats { /** * Called when this gets added to a Tool Item */ - void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); + void onStatsAddedToTool(MetaGeneratedTool aItem, int aID); /** * @implNote if you are only modifying drops, override diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGTFluid.java b/src/main/java/gregtech/api/interfaces/fluid/IGTFluid.java new file mode 100644 index 0000000000..b3765d37db --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/fluid/IGTFluid.java @@ -0,0 +1,14 @@ +package gregtech.api.interfaces.fluid; + +import net.minecraftforge.fluids.FluidRegistry; + +@SuppressWarnings("unused") // API might legitimately expose unused methods within this local project's scope +public interface IGTFluid { + + /** + * Adds this {@link IGTFluid} to the {@link FluidRegistry} and internally-implemented registrations + * + * @return {@link IGTRegisteredFluid} The GregTech registered fluid + */ + IGTRegisteredFluid addFluid(); +} diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java b/src/main/java/gregtech/api/interfaces/fluid/IGTFluidBuilder.java index f15b148fcb..2902824873 100644 --- a/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java +++ b/src/main/java/gregtech/api/interfaces/fluid/IGTFluidBuilder.java @@ -10,87 +10,87 @@ import net.minecraftforge.fluids.FluidRegistry; import gregtech.api.enums.FluidState; @SuppressWarnings("unused") // API might legitimately expose unused methods within this local project's scope -public interface IGT_FluidBuilder { +public interface IGTFluidBuilder { /** * @param colorRGBA The {@code short[]} RGBA color of the {@link Fluid} or {@code null} for no defined RGBA color - * @return {@link IGT_FluidBuilder} self for call chaining + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withColorRGBA(final short[] colorRGBA); + IGTFluidBuilder withColorRGBA(final short[] colorRGBA); /** - * @param localizedName The localized name of this {@link IGT_FluidBuilder} - * @return {@link IGT_FluidBuilder} self for call chaining + * @param localizedName The localized name of this {@link IGTFluidBuilder} + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withLocalizedName(final String localizedName); + IGTFluidBuilder withLocalizedName(final String localizedName); /** - * @param fluidState The {@link FluidState} of this {@link IGT_FluidBuilder} - * @param temperature The Kelvin temperature of this {@link IGT_FluidBuilder} - * @return {@link IGT_FluidBuilder} self for call chaining + * @param fluidState The {@link FluidState} of this {@link IGTFluidBuilder} + * @param temperature The Kelvin temperature of this {@link IGTFluidBuilder} + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withStateAndTemperature(final FluidState fluidState, final int temperature); + IGTFluidBuilder withStateAndTemperature(final FluidState fluidState, final int temperature); /** * @param stillIconResourceLocation the {@link ResourceLocation} of the still fluid icon - * @return {@link IGT_FluidBuilder} self for call chaining + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withStillIconResourceLocation(final ResourceLocation stillIconResourceLocation); + IGTFluidBuilder withStillIconResourceLocation(final ResourceLocation stillIconResourceLocation); /** * @param flowingIconResourceLocation the {@link ResourceLocation} of the flowing fluid icon - * @return {@link IGT_FluidBuilder} self for call chaining + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withFlowingIconResourceLocation(final ResourceLocation flowingIconResourceLocation); + IGTFluidBuilder withFlowingIconResourceLocation(final ResourceLocation flowingIconResourceLocation); /** - * @param textureName The name of the GregTech mod texture of this {@link IGT_FluidBuilder} - * @return {@link IGT_FluidBuilder} self for call chaining + * @param textureName The name of the GregTech mod texture of this {@link IGTFluidBuilder} + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withTextureName(final String textureName); + IGTFluidBuilder withTextureName(final String textureName); /** - * @param fluidBlock the {@link Block} implementation of the {@link IGT_Fluid} - * @return {@link IGT_FluidBuilder} self for call chaining + * @param fluidBlock the {@link Block} implementation of the {@link IGTFluid} + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withFluidBlock(final Block fluidBlock); + IGTFluidBuilder withFluidBlock(final Block fluidBlock); /** * @param fromFluid the {@link Fluid} to copy the icons from - * @return {@link IGT_FluidBuilder} self for call chaining + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withIconsFrom(@Nonnull final Fluid fromFluid); + IGTFluidBuilder withIconsFrom(@Nonnull final Fluid fromFluid); /** * @param stillIconResourceLocation The {@link ResourceLocation} of the still fluid texture * @param flowingIconResourceLocation The {@link ResourceLocation} of the flowing fluid texture - * @return {@link IGT_FluidBuilder} self for call chaining + * @return {@link IGTFluidBuilder} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_FluidBuilder withTextures(final ResourceLocation stillIconResourceLocation, + IGTFluidBuilder withTextures(final ResourceLocation stillIconResourceLocation, final ResourceLocation flowingIconResourceLocation); /** - * Builds the {@link IGT_Fluid} + * Builds the {@link IGTFluid} * - * @return the built {@link IGT_Fluid} + * @return the built {@link IGTFluid} */ - IGT_Fluid build(); + IGTFluid build(); /** - * Builds, then adds the {@link IGT_Fluid} to the {@link FluidRegistry} + * Builds, then adds the {@link IGTFluid} to the {@link FluidRegistry} * - * @return the {@link IGT_Fluid} + * @return the {@link IGTFluid} * @see #build() - * @see IGT_Fluid#addFluid() + * @see IGTFluid#addFluid() */ - IGT_RegisteredFluid buildAndRegister(); + IGTRegisteredFluid buildAndRegister(); } diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java b/src/main/java/gregtech/api/interfaces/fluid/IGTRegisteredFluid.java index 181824874c..b2796ed3f7 100644 --- a/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java +++ b/src/main/java/gregtech/api/interfaces/fluid/IGTRegisteredFluid.java @@ -7,54 +7,54 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import gregtech.api.enums.FluidState; import gregtech.api.enums.Materials; -public interface IGT_RegisteredFluid { +public interface IGTRegisteredFluid { /** - * Registers the containers in the {@link FluidContainerRegistry} for this {@link IGT_RegisteredFluid} + * Registers the containers in the {@link FluidContainerRegistry} for this {@link IGTRegisteredFluid} * * @param fullContainer The full fluid container * @param emptyContainer The empty fluid container * @param containerSize The size of the container - * @return The {@link IGT_RegisteredFluid} for call chaining + * @return The {@link IGTRegisteredFluid} for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_RegisteredFluid registerContainers(final ItemStack fullContainer, final ItemStack emptyContainer, + IGTRegisteredFluid registerContainers(final ItemStack fullContainer, final ItemStack emptyContainer, final int containerSize); /** * Registers the bucket-sized 1000L containers in the {@link FluidContainerRegistry} for this - * {@link IGT_RegisteredFluid} + * {@link IGTRegisteredFluid} * - * @param fullContainer The full container to associate with this {@link IGT_RegisteredFluid} - * @param emptyContainer The empty container associate with this {@link IGT_RegisteredFluid} - * @return {@link IGT_RegisteredFluid} for call chaining + * @param fullContainer The full container to associate with this {@link IGTRegisteredFluid} + * @param emptyContainer The empty container associate with this {@link IGTRegisteredFluid} + * @return {@link IGTRegisteredFluid} for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_RegisteredFluid registerBContainers(final ItemStack fullContainer, final ItemStack emptyContainer); + IGTRegisteredFluid registerBContainers(final ItemStack fullContainer, final ItemStack emptyContainer); /** * Registers the potion-sized 250L containers in the {@link FluidContainerRegistry} for this - * {@link IGT_RegisteredFluid} + * {@link IGTRegisteredFluid} * - * @param fullContainer The full container to associate with this {@link IGT_RegisteredFluid} - * @param emptyContainer The empty container associate with this {@link IGT_RegisteredFluid} - * @return {@link IGT_RegisteredFluid} self for call chaining + * @param fullContainer The full container to associate with this {@link IGTRegisteredFluid} + * @param emptyContainer The empty container associate with this {@link IGTRegisteredFluid} + * @return {@link IGTRegisteredFluid} self for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_RegisteredFluid registerPContainers(final ItemStack fullContainer, final ItemStack emptyContainer); + IGTRegisteredFluid registerPContainers(final ItemStack fullContainer, final ItemStack emptyContainer); /** - * Updates the {@link Materials}'s fluids from this {@link IGT_RegisteredFluid}'s state + * Updates the {@link Materials}'s fluids from this {@link IGTRegisteredFluid}'s state * - * @param material the {@link Materials} to configure based on this {@link IGT_RegisteredFluid} and + * @param material the {@link Materials} to configure based on this {@link IGTRegisteredFluid} and * {@link FluidState} - * @return The {@link IGT_RegisteredFluid} for call chaining + * @return The {@link IGTRegisteredFluid} for call chaining */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value - IGT_RegisteredFluid configureMaterials(final Materials material); + IGTRegisteredFluid configureMaterials(final Materials material); /** - * @return this {@link IGT_RegisteredFluid} cast to {@link Fluid} + * @return this {@link IGTRegisteredFluid} cast to {@link Fluid} */ Fluid asFluid(); } diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java b/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java deleted file mode 100644 index 7c8b2b3f11..0000000000 --- a/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java +++ /dev/null @@ -1,14 +0,0 @@ -package gregtech.api.interfaces.fluid; - -import net.minecraftforge.fluids.FluidRegistry; - -@SuppressWarnings("unused") // API might legitimately expose unused methods within this local project's scope -public interface IGT_Fluid { - - /** - * Adds this {@link IGT_Fluid} to the {@link FluidRegistry} and internally-implemented registrations - * - * @return {@link IGT_RegisteredFluid} The GregTech registered fluid - */ - IGT_RegisteredFluid addFluid(); -} diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java b/src/main/java/gregtech/api/interfaces/internal/IGTCraftingRecipe.java index 3f29736470..beacd71f95 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGTCraftingRecipe.java @@ -2,7 +2,7 @@ package gregtech.api.interfaces.internal; import net.minecraft.item.crafting.IRecipe; -public interface IGT_CraftingRecipe extends IRecipe { +public interface IGTCraftingRecipe extends IRecipe { boolean isRemovable(); } diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java b/src/main/java/gregtech/api/interfaces/internal/IGTMod.java index dbf888ef96..f47a7ef645 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGTMod.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; * <p/> * Don't even think about including this File in your Mod. */ -public interface IGT_Mod { +public interface IGTMod { /** * This means that Server specific Basefiles are definitely existing! Not if the World is actually server side or diff --git a/src/main/java/gregtech/api/interfaces/internal/IGTRecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGTRecipeAdder.java new file mode 100644 index 0000000000..a4d554428e --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IGTRecipeAdder.java @@ -0,0 +1,8 @@ +package gregtech.api.interfaces.internal; + +import gregtech.api.util.GTRecipeBuilder; + +public interface IGTRecipeAdder { + + GTRecipeBuilder stdBuilder(); +} diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java deleted file mode 100644 index e3c3a8cbaa..0000000000 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java +++ /dev/null @@ -1,8 +0,0 @@ -package gregtech.api.interfaces.internal; - -import gregtech.api.util.GT_RecipeBuilder; - -public interface IGT_RecipeAdder { - - GT_RecipeBuilder stdBuilder(); -} diff --git a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java index 5d99f83689..2cb2e6fd84 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java +++ b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java @@ -6,8 +6,8 @@ import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; -import gregtech.api.enums.TC_Aspects; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.TCAspects; +import gregtech.api.enums.TCAspects.TC_AspectStack; public interface IThaumcraftCompat { @@ -35,10 +35,10 @@ public interface IThaumcraftCompat { Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List<TC_AspectStack> aAspects); Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, - int aInstability, List<TC_Aspects.TC_AspectStack> aAspects); + int aInstability, List<TCAspects.TC_AspectStack> aAspects); Object addInfusionEnchantmentRecipe(String aResearch, Enchantment aEnchantment, int aInstability, - List<TC_Aspects.TC_AspectStack> aAspects, ItemStack[] aSideInputs); + List<TCAspects.TC_AspectStack> aAspects, ItemStack[] aSideInputs); Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List<TC_AspectStack> aAspects, diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 4959f8b060..824925f928 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -34,8 +34,8 @@ import gregtech.api.interfaces.tileentity.IGearEnergyTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregtechWailaProvider; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Util; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTUtil; /** * Warning, this Interface has just been made to be able to add multiple kinds of MetaTileEntities (Cables, Pipes, @@ -127,7 +127,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * If a Cover of that Type can be placed on this Side. Also Called when the Facing of the Block Changes and a Cover * is on said Side. */ - boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aStack); + boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack); /** * When a Player right-clicks the Facing with a Screwdriver. @@ -400,7 +400,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand if (getBaseMetaTileEntity() != null) { return getBaseMetaTileEntity().getGUIColorization(); } else { - return GT_Util.getRGBInt(Dyes.MACHINE_METAL.getRGBA()); + return GTUtil.getRGBInt(Dyes.MACHINE_METAL.getRGBA()); } } diff --git a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java b/src/main/java/gregtech/api/interfaces/modularui/IControllerWithOptionalFeatures.java index 8574de7007..d203d9fc87 100644 --- a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java +++ b/src/main/java/gregtech/api/interfaces/modularui/IControllerWithOptionalFeatures.java @@ -20,7 +20,7 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import gregtech.api.enums.SoundResource; import gregtech.api.enums.VoidingMode; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.tileentity.IRecipeLockable; import gregtech.api.interfaces.tileentity.IVoidable; @@ -36,7 +36,7 @@ import gregtech.api.interfaces.tileentity.IVoidable; * <li>Multiple machine modes</li> * </ul> */ -public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockable { +public interface IControllerWithOptionalFeatures extends IVoidable, IRecipeLockable { boolean isAllowedToWork(); @@ -59,11 +59,11 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab : SoundResource.GUI_BUTTON_DOWN.resourceLocation) .setBackground(() -> { if (isAllowedToWork()) { - return new IDrawable[] { GT_UITextures.BUTTON_STANDARD_PRESSED, - GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }; + return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED, + GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }; } else { - return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF }; + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, + GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF }; } }) .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isAllowedToWork, val -> { @@ -96,7 +96,7 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab ret.add(getVoidingMode().buttonTexture); ret.add(getVoidingMode().buttonOverlay); if (!supportsVoidProtection()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_FORBIDDEN); + ret.add(GTUITextures.OVERLAY_BUTTON_FORBIDDEN); } return ret.toArray(new IDrawable[0]); }) @@ -185,7 +185,7 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab .setBackground(() -> { List<UITexture> ret = new ArrayList<>(); if (supportsMachineModeSwitch()) { - ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GTUITextures.BUTTON_STANDARD); ret.add(getMachineModeIcon(getMachineMode())); } else return null; return ret.toArray(new IDrawable[0]); @@ -227,22 +227,22 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab .setBackground(() -> { List<UITexture> ret = new ArrayList<>(); if (isInputSeparationEnabled()) { - ret.add(GT_UITextures.BUTTON_STANDARD_PRESSED); + ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); if (supportsInputSeparation()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); + ret.add(GTUITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); } } else { - ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GTUITextures.BUTTON_STANDARD); if (supportsInputSeparation()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); + ret.add(GTUITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); } } if (!supportsInputSeparation()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_FORBIDDEN); + ret.add(GTUITextures.OVERLAY_BUTTON_FORBIDDEN); } return ret.toArray(new IDrawable[0]); }) @@ -287,22 +287,22 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab .setBackground(() -> { List<UITexture> ret = new ArrayList<>(); if (isBatchModeEnabled()) { - ret.add(GT_UITextures.BUTTON_STANDARD_PRESSED); + ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); if (supportsBatchMode()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON); + ret.add(GTUITextures.OVERLAY_BUTTON_BATCH_MODE_ON); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); } } else { - ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GTUITextures.BUTTON_STANDARD); if (supportsBatchMode()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); + ret.add(GTUITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); } } if (!supportsBatchMode()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_FORBIDDEN); + ret.add(GTUITextures.OVERLAY_BUTTON_FORBIDDEN); } return ret.toArray(new IDrawable[0]); }) @@ -329,22 +329,22 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab .setBackground(() -> { List<UITexture> ret = new ArrayList<>(); if (isRecipeLockingEnabled()) { - ret.add(GT_UITextures.BUTTON_STANDARD_PRESSED); + ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); if (supportsSingleRecipeLocking()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED); + ret.add(GTUITextures.OVERLAY_BUTTON_RECIPE_LOCKED); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); } } else { - ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GTUITextures.BUTTON_STANDARD); if (supportsSingleRecipeLocking()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); + ret.add(GTUITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); + ret.add(GTUITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); } } if (!supportsSingleRecipeLocking()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_FORBIDDEN); + ret.add(GTUITextures.OVERLAY_BUTTON_FORBIDDEN); } return ret.toArray(new IDrawable[0]); }) @@ -374,11 +374,11 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab .setBackground(() -> { List<UITexture> ret = new ArrayList<>(); if (getStructureUpdateTime() > -20) { - ret.add(GT_UITextures.BUTTON_STANDARD_PRESSED); + ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); } else { - ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GTUITextures.BUTTON_STANDARD); } - ret.add(GT_UITextures.OVERLAY_BUTTON_STRUCTURE_UPDATE); + ret.add(GTUITextures.OVERLAY_BUTTON_STRUCTURE_UPDATE); return ret.toArray(new IDrawable[0]); }) .attachSyncer( diff --git a/src/main/java/gregtech/api/interfaces/modularui/IGetTitleColor.java b/src/main/java/gregtech/api/interfaces/modularui/IGetTitleColor.java index 76d94ee299..442ad05efd 100644 --- a/src/main/java/gregtech/api/interfaces/modularui/IGetTitleColor.java +++ b/src/main/java/gregtech/api/interfaces/modularui/IGetTitleColor.java @@ -1,11 +1,11 @@ package gregtech.api.interfaces.modularui; import gregtech.api.enums.Dyes; -import gregtech.api.util.GT_Util; +import gregtech.api.util.GTUtil; public interface IGetTitleColor { default int getTitleColor() { - return GT_Util.getRGBaInt(Dyes.dyeWhite.getRGBA()); + return GTUtil.getRGBaInt(Dyes.dyeWhite.getRGBA()); } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java index ec760dd346..852817add2 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java @@ -1,7 +1,7 @@ package gregtech.api.interfaces.tileentity; import gregtech.api.enums.Dyes; -import gregtech.api.util.GT_Util; +import gregtech.api.util.GTUtil; public interface IColoredTileEntity { @@ -21,7 +21,6 @@ public interface IColoredTileEntity { * @return Actual color shown on GUI */ default int getGUIColorization() { - return GT_Util - .getRGBInt((getColorization() != -1 ? Dyes.get(getColorization()) : Dyes.MACHINE_METAL).getRGBA()); + return GTUtil.getRGBInt((getColorization() != -1 ? Dyes.get(getColorization()) : Dyes.MACHINE_METAL).getRGBA()); } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java index 8834678984..00ae2db9bd 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java @@ -4,8 +4,8 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; import gregtech.api.util.ISerializableObject; import gregtech.common.covers.CoverInfo; @@ -49,9 +49,9 @@ public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEn ItemStack getCoverItemAtSide(ForgeDirection side); @Deprecated - GT_CoverBehavior getCoverBehaviorAtSide(ForgeDirection side); + CoverBehavior getCoverBehaviorAtSide(ForgeDirection side); - default GT_CoverBehaviorBase<?> getCoverBehaviorAtSideNew(ForgeDirection side) { + default CoverBehaviorBase<?> getCoverBehaviorAtSideNew(ForgeDirection side) { return getCoverBehaviorAtSide(side); } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 91a9759e47..6dbc6bd5b8 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -8,10 +8,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import cofh.api.energy.IEnergyReceiver; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.logic.PowerLogic; import gregtech.api.logic.interfaces.PowerLogicHost; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import ic2.api.energy.tile.IEnergySink; /** @@ -97,8 +97,8 @@ public interface IEnergyConnected extends IColoredTileEntity { while (amperage > usedAmperes && sink.getDemandedEnergy() > 0 && sink.injectEnergy(oppositeSide, voltage, voltage) < voltage) usedAmperes++; } - } else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver receiver) { - final int rfOut = GT_Utility.safeInt(voltage * GregTech_API.mEUtoRF / 100); + } else if (GregTechAPI.mOutputRF && tTileEntity instanceof IEnergyReceiver receiver) { + final int rfOut = GTUtility.safeInt(voltage * GregTechAPI.mEUtoRF / 100); if (receiver.receiveEnergy(oppositeSide, rfOut, true) == rfOut) { receiver.receiveEnergy(oppositeSide, rfOut, false); usedAmperes++; @@ -152,7 +152,7 @@ public interface IEnergyConnected extends IColoredTileEntity { emitterLogic.removeEnergyUnsafe(usedAmperes * voltage); return; } - + if (tileEntity instanceof IEnergySink sink) { if (sink.acceptsEnergyFrom((TileEntity) emitter, oppositeSide)) { while (amperage > usedAmperes && sink.getDemandedEnergy() > 0 @@ -164,8 +164,8 @@ public interface IEnergyConnected extends IColoredTileEntity { } } - if (GregTech_API.mOutputRF && tileEntity instanceof IEnergyReceiver receiver) { - final int rfOut = GT_Utility.safeInt(voltage * GregTech_API.mEUtoRF / 100); + if (GregTechAPI.mOutputRF && tileEntity instanceof IEnergyReceiver receiver) { + final int rfOut = GTUtility.safeInt(voltage * GregTechAPI.mEUtoRF / 100); if (receiver.receiveEnergy(oppositeSide, rfOut, true) == rfOut) { receiver.receiveEnergy(oppositeSide, rfOut, false); usedAmperes++; diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java index d8231ee544..9e6b4c57c0 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java @@ -22,7 +22,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.modularui.IAddInventorySlots; import gregtech.api.interfaces.modularui.IGetGUITextureSet; import gregtech.api.util.shutdown.ShutDownReason; -import gregtech.common.blocks.GT_Block_Machines; +import gregtech.common.blocks.BlockMachines; /** * A simple compound Interface for all my TileEntities. @@ -186,7 +186,7 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil /** * A randomly called display update to be able to add particles or other items for display The event is proxied by - * the {@link GT_Block_Machines#randomDisplayTick} + * the {@link BlockMachines#randomDisplayTick} */ @SideOnly(Side.CLIENT) default void onRandomDisplayTick() { diff --git a/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java b/src/main/java/gregtech/api/items/BlockLongDistancePipe.java index 31a44f3dbc..3de95981f5 100644 --- a/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java +++ b/src/main/java/gregtech/api/items/BlockLongDistancePipe.java @@ -17,27 +17,27 @@ import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_LanguageManager; -import gregtech.common.blocks.GT_Item_LongDistancePipe; -import gregtech.common.blocks.GT_Material_Machines; +import gregtech.api.util.GTLanguageManager; +import gregtech.common.blocks.ItemLongDistancePipe; +import gregtech.common.blocks.MaterialMachines; -public class GT_Block_LongDistancePipe extends GT_Generic_Block { +public class BlockLongDistancePipe extends GTGenericBlock { public IIconContainer[] mIcons; - public GT_Block_LongDistancePipe() { - super(GT_Item_LongDistancePipe.class, "gt.block.longdistancepipe", new GT_Material_Machines()); + public BlockLongDistancePipe() { + super(ItemLongDistancePipe.class, "gt.block.longdistancepipe", new MaterialMachines()); setStepSound(soundTypeMetal); - setCreativeTab(GregTech_API.TAB_GREGTECH); - GregTech_API.registerMachineBlock(this, -1); + setCreativeTab(GregTechAPI.TAB_GREGTECH); + GregTechAPI.registerMachineBlock(this, -1); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Long Distance Fluid Pipeline Pipe"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Long Distance Item Pipeline Pipe"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Long Distance Fluid Pipeline Pipe"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Long Distance Item Pipeline Pipe"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); ItemList.Long_Distance_Pipeline_Fluid_Pipe.set(new ItemStack(this, 1, 0)); ItemList.Long_Distance_Pipeline_Item_Pipe.set(new ItemStack(this, 1, 1)); @@ -48,14 +48,14 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block { @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { super.onBlockAdded(aWorld, aX, aY, aZ); - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + if (GregTechAPI.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ); } } @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ); super.breakBlock(aWorld, aX, aY, aZ, aBlock, aMetaData); } diff --git a/src/main/java/gregtech/api/items/GT_Generic_Block.java b/src/main/java/gregtech/api/items/GTGenericBlock.java index 7aaef6d5ca..314849e8cf 100644 --- a/src/main/java/gregtech/api/items/GT_Generic_Block.java +++ b/src/main/java/gregtech/api/items/GTGenericBlock.java @@ -1,22 +1,22 @@ package gregtech.api.items; -import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.GTValues.W; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemBlock; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GTLanguageManager; -public class GT_Generic_Block extends Block { +public class GTGenericBlock extends Block { protected final String mUnlocalizedName; - protected GT_Generic_Block(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { + protected GTGenericBlock(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { super(aMaterial); setBlockName(mUnlocalizedName = aName); GameRegistry.registerBlock(this, aItemClass, getUnlocalizedName()); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + W + ".name", "Any Sub Block of this one"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + "." + W + ".name", "Any Sub Block of this one"); } } diff --git a/src/main/java/gregtech/api/items/GT_Generic_Item.java b/src/main/java/gregtech/api/items/GTGenericItem.java index 3fe2083a96..4f0994bb12 100644 --- a/src/main/java/gregtech/api/items/GT_Generic_Item.java +++ b/src/main/java/gregtech/api/items/GTGenericItem.java @@ -23,30 +23,30 @@ import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.SubTag; import gregtech.api.interfaces.IProjectileItem; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; /** * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur. */ -public class GT_Generic_Item extends Item implements IProjectileItem { +public class GTGenericItem extends Item implements IProjectileItem { private final String mName, mTooltip; protected IIcon mIcon; - public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) { + public GTGenericItem(String aUnlocalized, String aEnglish, String aEnglishTooltip) { super(); mName = "gt." + aUnlocalized; - GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish); - if (GT_Utility.isStringValid(aEnglishTooltip)) - GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip); + GTLanguageManager.addStringLocalization(mName + ".name", aEnglish); + if (GTUtility.isStringValid(aEnglishTooltip)) + GTLanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip); else mTooltip = null; - setCreativeTab(GregTech_API.TAB_GREGTECH); + setCreativeTab(GregTechAPI.TAB_GREGTECH); GameRegistry.registerItem(this, mName, GregTech.ID); BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense()); } @@ -69,7 +69,7 @@ public class GT_Generic_Item extends Item implements IProjectileItem { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { - mIcon = aIconRegister.registerIcon(GregTech.getResourcePath(GT_Config.troll ? "troll" : mName)); + mIcon = aIconRegister.registerIcon(GregTech.getResourcePath(GTConfig.troll ? "troll" : mName)); } @Override @@ -90,8 +90,8 @@ public class GT_Generic_Item extends Item implements IProjectileItem { public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) { if (getMaxDamage() > 0 && !getHasSubtypes()) aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage()); - if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip)); - if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack)); + if (mTooltip != null) aList.add(GTLanguageManager.getTranslation(mTooltip)); + if (GTModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack)); addAdditionalToolTips(aList, aStack, aPlayer); } @@ -144,14 +144,14 @@ public class GT_Generic_Item extends Item implements IProjectileItem { } public String transItem(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Item_DESCRIPTION_Index_" + aKey, aEnglish); + return GTLanguageManager.addStringLocalization("Item_DESCRIPTION_Index_" + aKey, aEnglish); } public static class GT_Item_Dispense extends BehaviorProjectileDispense { @Override public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) { - return ((GT_Generic_Item) aStack.getItem()).onDispense(aSource, aStack); + return ((GTGenericItem) aStack.getItem()).onDispense(aSource, aStack); } @Override diff --git a/src/main/java/gregtech/api/items/GT_BreederCell_Item.java b/src/main/java/gregtech/api/items/ItemBreederCell.java index 438b0f467e..33a4ce3253 100644 --- a/src/main/java/gregtech/api/items/GT_BreederCell_Item.java +++ b/src/main/java/gregtech/api/items/ItemBreederCell.java @@ -1,6 +1,6 @@ package gregtech.api.items; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.List; import java.util.function.Supplier; @@ -12,10 +12,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; import ic2.core.IC2Potion; @@ -25,7 +25,7 @@ import ic2.core.IC2Potion; * * @author glee8e */ -public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComponent { +public class ItemBreederCell extends GTGenericItem implements IReactorComponent { protected final int mHeatBonusStep; protected final int mHeatBonusMultiplier; @@ -34,17 +34,17 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp protected boolean hidden = false; protected boolean neiAdded = false; - public GT_BreederCell_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, int aHeatBonusStep, + public ItemBreederCell(String aUnlocalized, String aEnglish, String aEnglishTooltip, int aHeatBonusStep, int aHeatBonusMultiplier, int aRequiredPulse, Supplier<ItemStack> aProduct) { super(aUnlocalized, aEnglish, aEnglishTooltip); this.mHeatBonusStep = aHeatBonusStep; this.mHeatBonusMultiplier = aHeatBonusMultiplier; this.setMaxDamage(aRequiredPulse); setNoRepair(); - GregTech_API.sAfterGTPostload.add(() -> { + GregTechAPI.sAfterGTPostload.add(() -> { mProduct = aProduct.get(); if (!hidden && !neiAdded) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(new ItemStack(this)) .itemOutputs(mProduct) .setNEIDesc( @@ -61,12 +61,12 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp }); } - public GT_BreederCell_Item setDeflector() { + public ItemBreederCell setDeflector() { deflector = true; return this; } - public GT_BreederCell_Item setHidden() { + public ItemBreederCell setHidden() { hidden = true; return this; } @@ -74,7 +74,7 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp @Override public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) { if ((entity instanceof EntityLivingBase entityLiving)) { - if (!GT_Utility.isWearingFullRadioHazmat(entityLiving)) { + if (!GTUtility.isWearingFullRadioHazmat(entityLiving)) { IC2Potion.radiation.applyTo(entityLiving, 20, 1); } } diff --git a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java b/src/main/java/gregtech/api/items/ItemCoolantCell.java index 6ed7dae3b0..31eb6bc599 100644 --- a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java +++ b/src/main/java/gregtech/api/items/ItemCoolantCell.java @@ -8,20 +8,20 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import ic2.core.util.StackUtil; -public class GT_CoolantCell_Item extends GT_Generic_Item { +public class ItemCoolantCell extends GTGenericItem { protected final int heatStorage; - public GT_CoolantCell_Item(String aUnlocalized, String aEnglish, int aMaxStore) { + public ItemCoolantCell(String aUnlocalized, String aEnglish, int aMaxStore) { super(aUnlocalized, aEnglish, null); this.setMaxStackSize(1); this.setMaxDamage(100); setNoRepair(); this.heatStorage = aMaxStore; - this.setCreativeTab(GregTech_API.TAB_GREGTECH); + this.setCreativeTab(GregTechAPI.TAB_GREGTECH); } protected static int getHeatOfStack(ItemStack aStack) { diff --git a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java b/src/main/java/gregtech/api/items/ItemCoolantCellIC.java index eb3c6276cf..00643996d3 100644 --- a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java +++ b/src/main/java/gregtech/api/items/ItemCoolantCellIC.java @@ -5,9 +5,9 @@ import net.minecraft.item.ItemStack; import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; -public class GT_CoolantCellIC_Item extends GT_CoolantCell_Item implements IReactorComponent { +public class ItemCoolantCellIC extends ItemCoolantCell implements IReactorComponent { - public GT_CoolantCellIC_Item(String aUnlocalized, String aEnglish, int aMaxStore) { + public ItemCoolantCellIC(String aUnlocalized, String aEnglish, int aMaxStore) { super(aUnlocalized, aEnglish, aMaxStore); } diff --git a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java b/src/main/java/gregtech/api/items/ItemEnergyArmor.java index df820f928a..77c8d0991a 100644 --- a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java +++ b/src/main/java/gregtech/api/items/ItemEnergyArmor.java @@ -25,19 +25,19 @@ import net.minecraftforge.event.entity.living.LivingFallEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.GregTechAPI; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; -public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { +public class ItemEnergyArmor extends ItemArmor implements ISpecialArmor { public static Map<EntityPlayer, Float> jumpChargeMap = new ConcurrentHashMap<>(); public int mCharge, mTransfer, mTier, mDamageEnergyCost, mSpecials; public boolean mChargeProvider; public double mArmorAbsorbtionPercentage; - public GT_EnergyArmor_Item(int aID, String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, + public ItemEnergyArmor(int aID, String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) { super(ArmorMaterial.DIAMOND, aArmorIndex, aType); @@ -45,7 +45,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { setMaxDamage(100); setNoRepair(); setUnlocalizedName(aUnlocalized); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".name", aEnglish); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".name", aEnglish); mCharge = Math.max(1, aCharge); mTransfer = Math.max(1, aTransfer); mTier = Math.max(1, aTier); @@ -54,7 +54,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { mDamageEnergyCost = Math.max(0, aDamageEnergyCost); mArmorAbsorbtionPercentage = aArmorAbsorbtionPercentage; - setCreativeTab(GregTech_API.TAB_GREGTECH); + setCreativeTab(GregTechAPI.TAB_GREGTECH); MinecraftForge.EVENT_BUS.register(this); } @@ -109,29 +109,29 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if (!aPlayer.worldObj.isRemote && (mSpecials & 1) != 0) { int airSupply = aPlayer.getAir(); - if (GT_ModHandler.canUseElectricItem(aStack, 1000) && airSupply < 50) { + if (GTModHandler.canUseElectricItem(aStack, 1000) && airSupply < 50) { aPlayer.setAir(airSupply + 250); - GT_ModHandler.useElectricItem(aStack, 1000, aPlayer); + GTModHandler.useElectricItem(aStack, 1000, aPlayer); } } if (!aPlayer.worldObj.isRemote && (mSpecials & 4) != 0) { - if (GT_ModHandler.canUseElectricItem(aStack, 50000) && aPlayer.getFoodStats() + if (GTModHandler.canUseElectricItem(aStack, 50000) && aPlayer.getFoodStats() .needFood()) { aPlayer.getFoodStats() .addStats(1, 0.0F); - GT_ModHandler.useElectricItem(aStack, 50000, aPlayer); + GTModHandler.useElectricItem(aStack, 50000, aPlayer); } } if ((mSpecials & 8) != 0) { - if (GT_ModHandler.canUseElectricItem(aStack, 10000) && aPlayer.isPotionActive(Potion.poison)) { - GT_Utility.removePotion(aPlayer, Potion.poison.id); - GT_ModHandler.useElectricItem(aStack, 10000, aPlayer); + if (GTModHandler.canUseElectricItem(aStack, 10000) && aPlayer.isPotionActive(Potion.poison)) { + GTUtility.removePotion(aPlayer, Potion.poison.id); + GTModHandler.useElectricItem(aStack, 10000, aPlayer); } - if (GT_ModHandler.canUseElectricItem(aStack, 100000) && aPlayer.isPotionActive(Potion.wither)) { - GT_Utility.removePotion(aPlayer, Potion.wither.id); - GT_ModHandler.useElectricItem(aStack, 100000, aPlayer); + if (GTModHandler.canUseElectricItem(aStack, 100000) && aPlayer.isPotionActive(Potion.wither)) { + GTUtility.removePotion(aPlayer, Potion.wither.id); + GTModHandler.useElectricItem(aStack, 100000, aPlayer); } } @@ -142,9 +142,9 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if (!aPlayer.worldObj.isRemote && (mSpecials & 128) != 0) { float jumpCharge = jumpChargeMap.getOrDefault(aPlayer, 1.0F); - if (GT_ModHandler.canUseElectricItem(aStack, 1000) && aPlayer.onGround && jumpCharge < 1.0F) { + if (GTModHandler.canUseElectricItem(aStack, 1000) && aPlayer.onGround && jumpCharge < 1.0F) { jumpCharge = 1.0F; - GT_ModHandler.useElectricItem(aStack, 1000, aPlayer); + GTModHandler.useElectricItem(aStack, 1000, aPlayer); } if (aPlayer.motionY >= 0.0D && jumpCharge > 0.0F && !aPlayer.isInWater()) { @@ -157,14 +157,14 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { } if ((mSpecials & 256) != 0) { - if (GT_ModHandler.canUseElectricItem(aStack, 100) && aPlayer.isSprinting() + if (GTModHandler.canUseElectricItem(aStack, 100) && aPlayer.isSprinting() && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D || aPlayer.isInWater())) { - GT_ModHandler.useElectricItem(aStack, 100, aPlayer); + GTModHandler.useElectricItem(aStack, 100, aPlayer); float bonus = 0.22F; if (aPlayer.isInWater()) { - GT_ModHandler.useElectricItem(aStack, 100, aPlayer); + GTModHandler.useElectricItem(aStack, 100, aPlayer); bonus = 0.1F; if (aPlayer.motionY > 0) { @@ -177,25 +177,24 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { } if ((mSpecials & 512) != 0) { - if (GT_ModHandler.canUseElectricItem(aStack, 10000)) { - GT_ModHandler.useElectricItem(aStack, 10000, aPlayer); + if (GTModHandler.canUseElectricItem(aStack, 10000)) { + GTModHandler.useElectricItem(aStack, 10000, aPlayer); aPlayer.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), 25, 1, true)); } } if (!aPlayer.worldObj.isRemote && (mSpecials & (16 | 32)) != 0) { - // if (GregTech_API.sWorldTickCounter%20==0) { + // if (GregTechAPI.sWorldTickCounter%20==0) { ItemStack tTargetChargeItem = aStack, tTargetDechargeItem = aStack; - if (GT_ModHandler.chargeElectricItem(tTargetChargeItem, 1, Integer.MAX_VALUE, true, true) < 1) { + if (GTModHandler.chargeElectricItem(tTargetChargeItem, 1, Integer.MAX_VALUE, true, true) < 1) { tTargetChargeItem = aPlayer.inventory.armorInventory[2]; } - if (GT_ModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true) - < 10) { + if (GTModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true) < 10) { tTargetDechargeItem = aPlayer.inventory.armorInventory[2]; } - if (tTargetChargeItem == null || !GT_ModHandler.isElectricItem(tTargetChargeItem)) { + if (tTargetChargeItem == null || !GTModHandler.isElectricItem(tTargetChargeItem)) { tTargetChargeItem = null; } @@ -204,15 +203,15 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { MathHelper.floor_double(aPlayer.posY + 1), MathHelper.floor_double(aPlayer.posZ))) { if ((mSpecials & 32) != 0 && tTargetChargeItem != null) { - GT_ModHandler.chargeElectricItem(tTargetChargeItem, 20, Integer.MAX_VALUE, true, false); + GTModHandler.chargeElectricItem(tTargetChargeItem, 20, Integer.MAX_VALUE, true, false); } } else { /* * TODO: if ((mSpecials & 16) != 0 && tTargetDechargeItem != null && - * GT_ModHandler.canUseElectricItem(tTargetDechargeItem, 10)) { if (aPlayer.worldObj.getBlock + * GTModHandler.canUseElectricItem(tTargetDechargeItem, 10)) { if (aPlayer.worldObj.getBlock * ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ) == Blocks.air) aPlayer.worldObj.setBlock - * ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ, GregTech_API.sBlockList[3]); - * GT_ModHandler.useElectricItem(tTargetDechargeItem, 10, aPlayer); } + * ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ, GregTechAPI.sBlockList[3]); + * GTModHandler.useElectricItem(tTargetDechargeItem, 10, aPlayer); } */ // } } @@ -228,7 +227,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { @SideOnly(Side.CLIENT) public void getSubItems(Item aItem, CreativeTabs creativeTab, List<ItemStack> outputSubItems) { ItemStack tCharged = new ItemStack(this, 1), tUncharged = new ItemStack(this, 1, getMaxDamage()); - GT_ModHandler.chargeElectricItem(tCharged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + GTModHandler.chargeElectricItem(tCharged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); outputSubItems.add(tCharged); outputSubItems.add(tUncharged); } @@ -286,9 +285,9 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if (armor != null && armor.getItem() == this && (mSpecials & 2) != 0) { int distanceFactor = (int) event.distance - 3; int energyCost = (this.mDamageEnergyCost * distanceFactor) / 4; - if (energyCost <= GT_ModHandler + if (energyCost <= GTModHandler .dischargeElectricItem(armor, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true)) { - GT_ModHandler.dischargeElectricItem(armor, energyCost, Integer.MAX_VALUE, true, false, true); + GTModHandler.dischargeElectricItem(armor, energyCost, Integer.MAX_VALUE, true, false, true); event.setCanceled(true); break; } @@ -303,9 +302,10 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { return new ISpecialArmor.ArmorProperties( (source == DamageSource.fall && (mSpecials & 2) != 0) ? 10 : 0, getBaseAbsorptionRatio() * mArmorAbsorbtionPercentage, - mDamageEnergyCost > 0 ? 25 - * GT_ModHandler.dischargeElectricItem(armor, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true) - / mDamageEnergyCost : 0); + mDamageEnergyCost > 0 + ? 25 * GTModHandler.dischargeElectricItem(armor, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true) + / mDamageEnergyCost + : 0); } @Override @@ -316,8 +316,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { @Override public void damageArmor(EntityLivingBase entity, ItemStack itemStack, DamageSource source, int damage, int slotIndex) { - GT_ModHandler - .dischargeElectricItem(itemStack, damage * mDamageEnergyCost, Integer.MAX_VALUE, true, false, true); + GTModHandler.dischargeElectricItem(itemStack, damage * mDamageEnergyCost, Integer.MAX_VALUE, true, false, true); } private double getBaseAbsorptionRatio() { diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/ItemRadioactiveCell.java index c927737889..6efc652ef9 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java +++ b/src/main/java/gregtech/api/items/ItemRadioactiveCell.java @@ -1,6 +1,6 @@ package gregtech.api.items; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.List; @@ -9,17 +9,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import gregtech.common.items.GT_DepletetCell_Item; +import gregtech.common.items.ItemDepletedCell; import ic2.api.item.IBoxable; import ic2.core.util.StackUtil; -public class GT_RadioactiveCell_Item extends GT_Generic_Item implements IBoxable { +public class ItemRadioactiveCell extends GTGenericItem implements IBoxable { protected int cellCount; protected int maxDmg; protected int dura; - public GT_RadioactiveCell_Item(String aUnlocalized, String aEnglish, int aCellcount) { + public ItemRadioactiveCell(String aUnlocalized, String aEnglish, int aCellcount) { super(aUnlocalized, aEnglish, null); this.setMaxStackSize(64); this.setMaxDamage(100); @@ -143,7 +143,7 @@ public class GT_RadioactiveCell_Item extends GT_Generic_Item implements IBoxable case 2, 3, 4 -> EnumChatFormatting.GRAY; default -> EnumChatFormatting.DARK_GRAY; }; - EnumChatFormatting color1 = this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY + EnumChatFormatting color1 = this instanceof ItemDepletedCell ? color2 = EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE; aList.add( color1 + String.format( diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java b/src/main/java/gregtech/api/items/ItemRadioactiveCellIC.java index 2509cf6261..de60fe9c33 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java +++ b/src/main/java/gregtech/api/items/ItemRadioactiveCellIC.java @@ -7,16 +7,16 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; import ic2.core.IC2Potion; import ic2.core.init.MainConfig; import ic2.core.util.ConfigUtil; -public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implements IReactorComponent { +public class ItemRadioactiveCellIC extends ItemRadioactiveCell implements IReactorComponent { private static final int MYSTERIOUS_MULTIPLIER_HEAT = 4; public final int numberOfCells; @@ -26,7 +26,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement public final ItemStack sDepleted; public final boolean sMox; - public GT_RadioactiveCellIC_Item(String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, + public ItemRadioactiveCellIC(String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, int aRadiation, float aHeat, ItemStack aDepleted, boolean aMox) { super(aUnlocalized, aEnglish, aCellcount); setMaxStackSize(64); @@ -46,7 +46,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement // see ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric.getOfferedEnergy // don't ask, just accept float nukePowerMult = 5.0f * ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear"); - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(new ItemStack(this)) .itemOutputs(aDepleted) .setNEIDesc( @@ -198,7 +198,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement @Override public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) { if (this.sRadiation > 0 && (entity instanceof EntityLivingBase entityLiving)) { - if (!GT_Utility.isWearingFullRadioHazmat(entityLiving)) { + if (!GTUtility.isWearingFullRadioHazmat(entityLiving)) { IC2Potion.radiation.applyTo(entityLiving, sRadiation * 20, sRadiation * 10); } } diff --git a/src/main/java/gregtech/api/items/GT_Tool_Item.java b/src/main/java/gregtech/api/items/ItemTool.java index 9f78bdc3fc..0de68fc90e 100644 --- a/src/main/java/gregtech/api/items/GT_Tool_Item.java +++ b/src/main/java/gregtech/api/items/ItemTool.java @@ -2,19 +2,19 @@ package gregtech.api.items; import net.minecraft.item.ItemStack; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GTModHandler; /** * This is just a basic Tool, which has normal durability and could break Blocks. */ -public class GT_Tool_Item extends GT_Generic_Item { +public class ItemTool extends GTGenericItem { - public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, + public ItemTool(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed) { this(aUnlocalized, aEnglish, aTooltip, aMaxDamage, aEntityDamage, aSwingIfUsed, -1, -1); } - public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, + public ItemTool(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID) { this( aUnlocalized, @@ -29,13 +29,13 @@ public class GT_Tool_Item extends GT_Generic_Item { 0.0F); } - public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, + public ItemTool(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID, int aToolQuality, float aToolStrength) { super(aUnlocalized, aEnglish, aTooltip); setMaxDamage(aMaxDamage); setMaxStackSize(1); setNoRepair(); setFull3D(); - GT_ModHandler.registerBoxableItemToToolBox(new ItemStack(this)); + GTModHandler.registerBoxableItemToToolBox(new ItemStack(this)); } } diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/MetaBaseItem.java index 481c0b5a08..23726c96e9 100644 --- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/src/main/java/gregtech/api/items/MetaBaseItem.java @@ -1,8 +1,8 @@ package gregtech.api.items; -import static gregtech.api.enums.GT_Values.D1; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.enums.GTValues.D1; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.ArrayList; import java.util.List; @@ -25,27 +25,27 @@ import net.minecraftforge.fluids.IFluidContainerItem; import gregtech.api.enums.SubTag; import gregtech.api.interfaces.IItemBehaviour; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; -public abstract class GT_MetaBase_Item extends GT_Generic_Item +public abstract class MetaBaseItem extends GTGenericItem implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem { /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ - private final ConcurrentHashMap<Short, ArrayList<IItemBehaviour<GT_MetaBase_Item>>> mItemBehaviors = new ConcurrentHashMap<>(); + private final ConcurrentHashMap<Short, ArrayList<IItemBehaviour<MetaBaseItem>>> mItemBehaviors = new ConcurrentHashMap<>(); /** * Creates the Item using these Parameters. * * @param aUnlocalized The Unlocalized Name of this Item. */ - public GT_MetaBase_Item(String aUnlocalized) { + public MetaBaseItem(String aUnlocalized) { super(aUnlocalized, "Generated Item", null); setHasSubtypes(true); setMaxDamage(0); @@ -60,9 +60,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item * @param aBehavior the Click Behavior you want to add. * @return the Item itself for convenience in constructing. */ - public final GT_MetaBase_Item addItemBehavior(int aMetaValue, IItemBehaviour<GT_MetaBase_Item> aBehavior) { + public final MetaBaseItem addItemBehavior(int aMetaValue, IItemBehaviour<MetaBaseItem> aBehavior) { if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this; - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors .computeIfAbsent((short) aMetaValue, k -> new ArrayList<>(1)); tList.add(aBehavior); return this; @@ -74,8 +74,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true; return super.hasProjectile(aProjectileType, aStack); } @@ -83,8 +83,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) { + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) { EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); if (rArrow != null) return rArrow; } @@ -94,8 +94,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) { + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) { EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); if (rArrow != null) return rArrow; } @@ -104,16 +104,16 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack); return super.onDispense(aSource, aStack); } @Override public boolean isItemStackUsable(ItemStack aStack) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (!tBehavior.isItemStackUsable(this, aStack)) return false; return super.isItemStackUsable(aStack); } @@ -122,9 +122,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); try { - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) { if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); return true; @@ -134,7 +134,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item return false; } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return false; } @@ -144,9 +144,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item int ordinalSide, float hitX, float hitY, float hitZ) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); try { - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, ordinalSide, hitX, hitY, hitZ)) { if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); return true; @@ -156,7 +156,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item return false; } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return false; } @@ -166,9 +166,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item int ordinalSide, float hitX, float hitY, float hitZ) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); try { - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) if (tBehavior.onItemUseFirst( + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) if (tBehavior.onItemUseFirst( this, aStack, aPlayer, @@ -188,7 +188,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item return false; } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return false; } @@ -197,12 +197,12 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); try { - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer); } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } return aStack; } @@ -210,10 +210,10 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) { String tKey = getUnlocalizedName(aStack) + ".tooltip"; - String[] tStrings = GT_LanguageManager.getTranslation(tKey) + String[] tStrings = GTLanguageManager.getTranslation(tKey) .split("/n "); for (String tString : tStrings) - if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); + if (GTUtility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); Long[] tStats = getElectricStats(aStack); if (tStats != null) { @@ -247,7 +247,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item FluidStack tFluid = getFluidContent(aStack); aList.add( EnumChatFormatting.BLUE + ((tFluid == null ? transItem("012", "No Fluids Contained") - : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); + : GTUtility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); aList.add( EnumChatFormatting.BLUE + String.format( transItem("013", "%sL / %sL"), @@ -255,8 +255,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item "" + formatNumbers(tStats[0])) + EnumChatFormatting.GRAY); } - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) aList = tBehavior.getAdditionalToolTips(this, aList, aStack); addAdditionalToolTips(aList, aStack, aPlayer); @@ -264,8 +264,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { - ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); - if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) + ArrayList<IItemBehaviour<MetaBaseItem>> tList = mItemBehaviors.get((short) getDamage(aStack)); + if (tList != null) for (IItemBehaviour<MetaBaseItem> tBehavior : tList) tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand); } @@ -352,7 +352,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item if (aPlayer == null || aPlayer.worldObj.isRemote) return; for (int i = 1; i < 5; i++) { ItemStack tArmor = aPlayer.getEquipmentInSlot(i); - if (GT_ModHandler.isElectricItem(tArmor)) { + if (GTModHandler.isElectricItem(tArmor)) { IElectricItem tArmorItem = (IElectricItem) tArmor.getItem(); if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) { double tCharge = ElectricItem.manager.discharge( @@ -403,7 +403,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item * false); chargeFromArmor(aStack, aPlayer); return false; } * @Override public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) { if (aPlayer == null || * aPlayer.worldObj.isRemote) return; for (int i = 1; i < 5; i++) { ItemStack tArmor = - * aPlayer.getEquipmentInSlot(i); if (GT_ModHandler.isElectricItem(tArmor)) { IElectricItem tArmorItem = + * aPlayer.getEquipmentInSlot(i); if (GTModHandler.isElectricItem(tArmor)) { IElectricItem tArmorItem = * (IElectricItem)tArmor.getItem(); if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= * getTier(aStack)) { int tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE-1, * Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, false); if (tCharge > 0) { charge(aStack, tCharge, @@ -460,11 +460,11 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) { if (aStack == null || aStack.stackSize != 1) return 0; - ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false); + ItemStack tStack = GTUtility.fillFluidContainer(aFluid, aStack, false, false); if (tStack != null) { aStack.setItemDamage(tStack.getItemDamage()); aStack.func_150996_a(tStack.getItem()); - return GT_Utility.getFluidForFilledItem(tStack, false).amount; + return GTUtility.getFluidForFilledItem(tStack, false).amount; } Long[] tStats = getFluidContainerStats(aStack); @@ -513,9 +513,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) { if (aStack == null || aStack.stackSize != 1) return null; - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false); + FluidStack tFluid = GTUtility.getFluidForFilledItem(aStack, false); if (tFluid != null && maxDrain >= tFluid.amount) { - ItemStack tStack = GT_Utility.getContainerItem(aStack, false); + ItemStack tStack = GTUtility.getContainerItem(aStack, false); if (tStack == null) { if (doDrain) aStack.stackSize = 0; return tFluid; @@ -547,7 +547,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public FluidStack getFluidContent(ItemStack aStack) { Long[] tStats = getFluidContainerStats(aStack); - if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false); + if (tStats == null || tStats[0] <= 0) return GTUtility.getFluidForFilledItem(aStack, false); NBTTagCompound tNBT = aStack.getTagCompound(); return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent")); } diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java b/src/main/java/gregtech/api/items/MetaGeneratedItem.java index 465c4bc9d6..449b1ced24 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java +++ b/src/main/java/gregtech/api/items/MetaGeneratedItem.java @@ -1,10 +1,10 @@ package gregtech.api.items; -import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GTValues.D1; import static gregtech.api.enums.Mods.AppleCore; import static gregtech.api.enums.Mods.GregTech; import static gregtech.api.recipe.RecipeMaps.cannerRecipes; -import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GTRecipeBuilder.SECONDS; import java.util.ArrayList; import java.util.Arrays; @@ -25,24 +25,24 @@ import net.minecraft.world.World; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -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.Mods; import gregtech.api.enums.SubTag; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.TCAspects.TC_AspectStack; import gregtech.api.interfaces.IFoodStat; import gregtech.api.interfaces.IGT_ItemWithMaterialRenderer; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; +import gregtech.api.util.GTConfig; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; +import gregtech.common.render.items.GeneratedMaterialRenderer; import squeek.applecore.api.food.FoodValues; import squeek.applecore.api.food.IEdible; import squeek.applecore.api.food.ItemFoodProxy; @@ -63,7 +63,7 @@ import squeek.applecore.api.food.ItemFoodProxy; * Item. */ @Optional.Interface(iface = "squeek.applecore.api.food.IEdible", modid = Mods.Names.APPLE_CORE) -public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements IGT_ItemWithMaterialRenderer, IEdible { +public abstract class MetaGeneratedItem extends MetaBaseItem implements IGT_ItemWithMaterialRenderer, IEdible { /** * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this @@ -71,7 +71,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * <p/> * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. */ - public static final ConcurrentHashMap<String, GT_MetaGenerated_Item> sInstances = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap<String, MetaGeneratedItem> sInstances = new ConcurrentHashMap<>(); /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ @@ -90,9 +90,9 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * * @param aUnlocalized The Unlocalized Name of this Item. */ - public GT_MetaGenerated_Item(String aUnlocalized, short aOffset, short aItemAmount) { + public MetaGeneratedItem(String aUnlocalized, short aOffset, short aItemAmount) { super(aUnlocalized); - setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + setCreativeTab(GregTechAPI.TAB_GREGTECH_MATERIALS); setHasSubtypes(true); setMaxDamage(0); mEnabledItems = new BitSet(aItemAmount); @@ -124,8 +124,8 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements } mEnabledItems.set(aID); mVisibleItems.set(aID); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish); - GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip); + GTLanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish); + GTLanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip); List<TC_AspectStack> tAspects = new ArrayList<>(); // Important Stuff to do first for (Object tRandomData : aRandomData) if (tRandomData instanceof SubTag) { @@ -134,7 +134,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements continue; } if (tRandomData == SubTag.NO_UNIFICATION) { - GT_OreDictUnificator.addToBlacklist(rStack); + GTOreDictUnificator.addToBlacklist(rStack); } } // now check for the rest @@ -145,7 +145,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements if (((IFoodStat) tRandomData).getFoodAction(this, rStack) == EnumAction.eat) { int tFoodValue = ((IFoodStat) tRandomData).getFoodLevel(this, rStack, null); if (tFoodValue > 0) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .itemInputs(rStack, ItemList.IC2_Food_Can_Empty.get(tFoodValue)) .itemOutputs( ((IFoodStat) tRandomData).isRotten(this, rStack, null) @@ -161,7 +161,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements if (tRandomData instanceof IItemBehaviour) { // The cast below from is not safe. If you know how to make it safe, please do. // noinspection unchecked - addItemBehavior(mOffset + aID, (IItemBehaviour<GT_MetaBase_Item>) tRandomData); + addItemBehavior(mOffset + aID, (IItemBehaviour<MetaBaseItem>) tRandomData); tUseOreDict = false; } if (tRandomData instanceof IItemContainer) { @@ -176,16 +176,16 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements continue; } if (tRandomData instanceof ItemData) { - if (GT_Utility.isStringValid(tRandomData)) GT_OreDictUnificator.registerOre(tRandomData, rStack); - else GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData); + if (GTUtility.isStringValid(tRandomData)) GTOreDictUnificator.registerOre(tRandomData, rStack); + else GTOreDictUnificator.addItemData(rStack, (ItemData) tRandomData); continue; } if (tUseOreDict) { - GT_OreDictUnificator.registerOre(tRandomData, rStack); + GTOreDictUnificator.registerOre(tRandomData, rStack); } } - if (GregTech_API.sThaumcraftCompat != null) - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + if (GregTechAPI.sThaumcraftCompat != null) + GregTechAPI.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); return rStack; } return null; @@ -198,7 +198,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * @param aFoodBehavior the Food Behavior you want to add. * @return the Item itself for convenience in constructing. */ - public final GT_MetaGenerated_Item setFoodBehavior(int aMetaValue, IFoodStat aFoodBehavior) { + public final MetaGeneratedItem setFoodBehavior(int aMetaValue, IFoodStat aFoodBehavior) { if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; if (aFoodBehavior == null) mFoodStats.remove((short) aMetaValue); else mFoodStats.put((short) aMetaValue, aFoodBehavior); @@ -212,7 +212,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU) * @return the Item itself for convenience in constructing. */ - public final GT_MetaGenerated_Item setBurnValue(int aMetaValue, int aValue) { + public final MetaGeneratedItem setBurnValue(int aMetaValue, int aValue) { if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length() || aValue < 0) return this; if (aValue == 0) mBurnValues.remove((short) aMetaValue); else mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue); @@ -230,8 +230,8 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * this Battery charge/discharge-able. * @return the Item itself for convenience in constructing. */ - public final GT_MetaGenerated_Item setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, - long aTier, long aSpecialData, boolean aUseAnimations) { + public final MetaGeneratedItem setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, long aTier, + long aSpecialData, boolean aUseAnimations) { if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; if (aMaxCharge == 0) mElectricStats.remove((short) aMetaValue); else { @@ -251,7 +251,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * @param aStacksize item stack size * @return the Item itself for convenience in constructing. */ - public final GT_MetaGenerated_Item setFluidContainerStats(int aMetaValue, long aCapacity, long aStacksize) { + public final MetaGeneratedItem setFluidContainerStats(int aMetaValue, long aCapacity, long aStacksize) { if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; if (aCapacity < 0) mElectricStats.remove((short) aMetaValue); else mFluidContainerStats.put((short) aMetaValue, new Long[] { aCapacity, Math.max(1, aStacksize) }); @@ -295,7 +295,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements } @Override - public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) { + public GeneratedMaterialRenderer getMaterialRenderer(int aMetaData) { return null; } @@ -381,10 +381,10 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements for (short i = 0; i < j; i++) if (mEnabledItems.get(i)) { for (byte k = 1; k < mIconList[i].length; k++) { mIconList[i][k] = aIconRegister.registerIcon( - GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k)); + GregTech.getResourcePath(GTConfig.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k)); } mIconList[i][0] = aIconRegister - .registerIcon(GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); + .registerIcon(GregTech.getResourcePath(GTConfig.troll ? "troll" : getUnlocalizedName() + "/" + i)); } } diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java b/src/main/java/gregtech/api/items/MetaGeneratedItemX01.java index db41a3c35b..29fc849a6f 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java +++ b/src/main/java/gregtech/api/items/MetaGeneratedItemX01.java @@ -1,6 +1,6 @@ package gregtech.api.items; -import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GTValues.M; import java.util.List; @@ -11,13 +11,13 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; /** * @author Gregorius Techneticies @@ -34,7 +34,7 @@ import gregtech.api.util.GT_Utility; * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike * Item. */ -public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { +public abstract class MetaGeneratedItemX01 extends MetaGeneratedItem { protected final OrePrefixes mPrefix; protected final int mIconSetIndex; @@ -47,32 +47,32 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { * @param aIconSetIndex The TextureSet Index to be used. -1 for Defaulting to the Data contained in the Prefix. * (this is only to be used for selecting the Icon in getIconContainer, nothing else) */ - public GT_MetaGenerated_Item_X01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) { + public MetaGeneratedItemX01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) { super(aUnlocalized, (short) 32000, (short) 766); mPrefix = aGeneratedPrefix; mIconSetIndex = aIconSetIndex >= 0 ? aIconSetIndex : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0; - for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) { + for (int i = 0; i < GregTechAPI.sGeneratedMaterials.length; i++) { OrePrefixes tPrefix = mPrefix; if (tPrefix == null) continue; - Materials tMaterial = GregTech_API.sGeneratedMaterials[i]; + Materials tMaterial = GregTechAPI.sGeneratedMaterials[i]; if (tMaterial == null) continue; if (mPrefix.doGenerateItem(tMaterial)) { ItemStack tStack = new ItemStack(this, 1, i); - GT_LanguageManager.addStringLocalization( + GTLanguageManager.addStringLocalization( getUnlocalizedName(tStack) + ".name", - GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) + GTLanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i)); - GT_LanguageManager.addStringLocalization( + GTLanguageManager.addStringLocalization( getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); String tOreName = getOreDictString(tPrefix, tMaterial); tPrefix = OrePrefixes.getOrePrefix(tOreName); if (tPrefix != null && tPrefix.mIsUnificatable) { - GT_OreDictUnificator.set(tPrefix, OrePrefixes.getMaterial(tOreName, tPrefix), tStack); + GTOreDictUnificator.set(tPrefix, OrePrefixes.getMaterial(tOreName, tPrefix), tStack); } else { - GT_OreDictUnificator.registerOre(tOreName, tStack); + GTOreDictUnificator.registerOre(tOreName, tStack); } } } @@ -136,10 +136,10 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { @Override public ItemStack getContainerItem(ItemStack aStack) { int aMetaData = aStack.getItemDamage(); - if (aMetaData < GregTech_API.sGeneratedMaterials.length && aMetaData >= 0) { - Materials aMaterial = GregTech_API.sGeneratedMaterials[aMetaData]; + if (aMetaData < GregTechAPI.sGeneratedMaterials.length && aMetaData >= 0) { + Materials aMaterial = GregTechAPI.sGeneratedMaterials[aMetaData]; if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) { - return GT_Utility.copyAmount(1, mPrefix.mContainerItem); + return GTUtility.copyAmount(1, mPrefix.mContainerItem); } } return null; @@ -148,39 +148,36 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { @Override public short[] getRGBa(ItemStack aStack) { int aMetaData = getDamage(aStack); - return aMetaData < GregTech_API.sGeneratedMaterials.length - && GregTech_API.sGeneratedMaterials[aMetaData] != null ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa - : Materials._NULL.mRGBa; + return aMetaData < GregTechAPI.sGeneratedMaterials.length && GregTechAPI.sGeneratedMaterials[aMetaData] != null + ? GregTechAPI.sGeneratedMaterials[aMetaData].mRGBa + : Materials._NULL.mRGBa; } @Override public final IIconContainer getIconContainer(int aMetaData) { - return aMetaData < GregTech_API.sGeneratedMaterials.length - && GregTech_API.sGeneratedMaterials[aMetaData] != null - ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) - : null; + return aMetaData < GregTechAPI.sGeneratedMaterials.length && GregTechAPI.sGeneratedMaterials[aMetaData] != null + ? getIconContainer(aMetaData, GregTechAPI.sGeneratedMaterials[aMetaData]) + : null; } @Override @SideOnly(Side.CLIENT) public final void getSubItems(Item aItem, CreativeTabs aCreativeTab, List<ItemStack> aList) { - for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) - if (mPrefix.doGenerateItem(GregTech_API.sGeneratedMaterials[i]) && doesShowInCreative( - mPrefix, - GregTech_API.sGeneratedMaterials[i], - GregTech_API.sDoShowAllItemsInCreative)) { - ItemStack tStack = new ItemStack(this, 1, i); - isItemStackUsable(tStack); - aList.add(tStack); - } + for (int i = 0; i < GregTechAPI.sGeneratedMaterials.length; i++) if (mPrefix + .doGenerateItem(GregTechAPI.sGeneratedMaterials[i]) + && doesShowInCreative(mPrefix, GregTechAPI.sGeneratedMaterials[i], GregTechAPI.sDoShowAllItemsInCreative)) { + ItemStack tStack = new ItemStack(this, 1, i); + isItemStackUsable(tStack); + aList.add(tStack); + } super.getSubItems(aItem, aCreativeTab, aList); } @Override public final IIcon getIconFromDamage(int aMetaData) { if (aMetaData < 0) return null; - if (aMetaData < GregTech_API.sGeneratedMaterials.length) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData]; + if (aMetaData < GregTechAPI.sGeneratedMaterials.length) { + Materials tMaterial = GregTechAPI.sGeneratedMaterials[aMetaData]; if (tMaterial == null) return null; IIconContainer tIcon = getIconContainer(aMetaData, tMaterial); if (tIcon != null) return tIcon.getIcon(); diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java b/src/main/java/gregtech/api/items/MetaGeneratedItemX32.java index c344397e4e..cb83804ae1 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java +++ b/src/main/java/gregtech/api/items/MetaGeneratedItemX32.java @@ -1,6 +1,6 @@ package gregtech.api.items; -import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GTValues.M; import java.util.Arrays; import java.util.List; @@ -12,15 +12,15 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; +import gregtech.common.render.items.GeneratedMaterialRenderer; /** * @author Gregorius Techneticies @@ -37,7 +37,7 @@ import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike * Item. */ -public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { +public abstract class MetaGeneratedItemX32 extends MetaGeneratedItem { protected final OrePrefixes[] mGeneratedPrefixList; @@ -47,7 +47,7 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { * @param aUnlocalized The Unlocalized Name of this Item. * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated. */ - public GT_MetaGenerated_Item_X32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) { + public MetaGeneratedItemX32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) { super(aUnlocalized, (short) 32000, (short) 766); mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32); @@ -55,27 +55,27 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { OrePrefixes tPrefix = mGeneratedPrefixList[i / 1000]; if (tPrefix == null) continue; if (tPrefix == OrePrefixes.___placeholder___) continue; - Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000]; + Materials tMaterial = GregTechAPI.sGeneratedMaterials[i % 1000]; if (tMaterial == null) continue; if (doesMaterialAllowGeneration(tPrefix, tMaterial)) { ItemStack tStack = new ItemStack(this, 1, i); - GT_LanguageManager.addStringLocalization( + GTLanguageManager.addStringLocalization( getUnlocalizedName(tStack) + ".name", - GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) + GTLanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i)); - GT_LanguageManager.addStringLocalization( + GTLanguageManager.addStringLocalization( getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); if (tPrefix.mIsUnificatable) { - GT_OreDictUnificator.set(tPrefix, tMaterial, tStack); + GTOreDictUnificator.set(tPrefix, tMaterial, tStack); } else { - GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack); + GTOreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack); } if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine || tPrefix == OrePrefixes.ingot) && (tMaterial == Materials.Lead || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) { - GregTech_API.sSolderingMetalList.add(tStack); - GT_ModHandler.registerBoxableItemToToolBox(tStack); + GregTechAPI.sSolderingMetalList.add(tStack); + GTModHandler.registerBoxableItemToToolBox(tStack); } } } @@ -88,7 +88,7 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { */ @Override public short[] getRGBa(ItemStack aStack) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[getDamage(aStack) % 1000]; + Materials tMaterial = GregTechAPI.sGeneratedMaterials[getDamage(aStack) % 1000]; return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa; } @@ -163,10 +163,10 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { public ItemStack getContainerItem(ItemStack aStack) { int aDamage = aStack.getItemDamage(); if (aDamage < 32000 && aDamage >= 0) { - Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000]; + Materials aMaterial = GregTechAPI.sGeneratedMaterials[aDamage % 1000]; if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) { OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000]; - if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem); + if (aPrefix != null) return GTUtility.copyAmount(1, aPrefix.mContainerItem); } } return null; @@ -174,14 +174,14 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { @Override public final IIconContainer getIconContainer(int aMetaData) { - return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null - : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]); + return GregTechAPI.sGeneratedMaterials[aMetaData % 1000] == null ? null + : getIconContainer(aMetaData, GregTechAPI.sGeneratedMaterials[aMetaData % 1000]); } @Override - public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) { - return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null - : GregTech_API.sGeneratedMaterials[aMetaData % 1000].renderer; + public GeneratedMaterialRenderer getMaterialRenderer(int aMetaData) { + return GregTechAPI.sGeneratedMaterials[aMetaData % 1000] == null ? null + : GregTechAPI.sGeneratedMaterials[aMetaData % 1000].renderer; } @Override @@ -189,10 +189,10 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { public final void getSubItems(Item aItem, CreativeTabs aCreativeTab, List<ItemStack> aList) { for (int i = 0; i < 32000; i++) { OrePrefixes aPrefix = mGeneratedPrefixList[i / 1000]; - Materials aMaterial = GregTech_API.sGeneratedMaterials[i % 1000]; + Materials aMaterial = GregTechAPI.sGeneratedMaterials[i % 1000]; if (aPrefix != null && aMaterial != null) { if (doesMaterialAllowGeneration(aPrefix, aMaterial) - && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) { + && doesShowInCreative(aPrefix, aMaterial, GregTechAPI.sDoShowAllItemsInCreative)) { ItemStack tStack = new ItemStack(this, 1, i); isItemStackUsable(tStack); aList.add(tStack); @@ -206,7 +206,7 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { public final IIcon getIconFromDamage(int aMetaData) { if (aMetaData < 0) return null; if (aMetaData < 32000) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000]; + Materials tMaterial = GregTechAPI.sGeneratedMaterials[aMetaData % 1000]; if (tMaterial == null) return null; IIconContainer tIcon = getIconContainer(aMetaData, tMaterial); if (tIcon != null) return tIcon.getIcon(); diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/MetaGeneratedTool.java index cec93169ec..6487a67a6b 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/src/main/java/gregtech/api/items/MetaGeneratedTool.java @@ -1,7 +1,7 @@ package gregtech.api.items; -import static gregtech.api.util.GT_Utility.formatNumbers; -import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow; +import static gregtech.api.util.GTUtility.formatNumbers; +import static gregtech.common.tileentities.machines.multi.MTELargeTurbineSteam.calculateLooseFlow; import java.util.ArrayList; import java.util.HashMap; @@ -44,24 +44,24 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import crazypants.enderio.api.tool.ITool; import forestry.api.arboriculture.IToolGrafter; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enchants.Enchantment_Radioactivity; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; +import gregtech.api.enchants.EnchantmentRadioactivity; import gregtech.api.enums.Materials; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.TCAspects.TC_AspectStack; import gregtech.api.interfaces.IDamagableItem; import gregtech.api.interfaces.IToolStats; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.common.tools.GT_Tool_Turbine; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; +import gregtech.common.tools.ToolTurbine; import mods.railcraft.api.core.items.IToolCrowbar; import mrtjp.projectred.api.IScrewdriver; /** * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench: - * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, + * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(MetaGeneratedTool01.WRENCH, 1, * Materials.Bismuth, Materials.Bismuth, null); */ @Optional.InterfaceList( @@ -71,7 +71,7 @@ import mrtjp.projectred.api.IScrewdriver; @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools"), @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIOAPI|Tools"), @Optional.Interface(iface = "mrtjp.projectred.api.IScrewdriver", modid = "ProjRed|Core"), }) -public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item +public abstract class MetaGeneratedTool extends MetaBaseItem implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool, IScrewdriver, IAEWrench { /** @@ -80,7 +80,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item * <p/> * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. */ - public static final ConcurrentHashMap<String, GT_MetaGenerated_Tool> sInstances = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap<String, MetaGeneratedTool> sInstances = new ConcurrentHashMap<>(); /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ @@ -91,9 +91,9 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item * * @param aUnlocalized The Unlocalized Name of this Item. */ - public GT_MetaGenerated_Tool(String aUnlocalized) { + public MetaGeneratedTool(String aUnlocalized) { super(aUnlocalized); - setCreativeTab(GregTech_API.TAB_GREGTECH); + setCreativeTab(GregTechAPI.TAB_GREGTECH); setMaxStackSize(1); sInstances.put(getUnlocalizedName(), this); } @@ -188,11 +188,11 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item Object... aOreDictNamesAndAspects) { if (aToolTip == null) aToolTip = ""; if (aID >= 0 && aID < 32766 && aID % 2 == 0) { - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip); - GT_LanguageManager + GTLanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip); + GTLanguageManager .addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)"); - GT_LanguageManager + GTLanguageManager .addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it"); mToolStats.put((short) aID, aToolStats); mToolStats.put((short) (aID + 1), aToolStats); @@ -202,11 +202,11 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) { if (tOreDictNameOrAspect instanceof TC_AspectStack) ((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects); - else GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack); + else GTOreDictUnificator.registerOre(tOreDictNameOrAspect, rStack); } - if (GregTech_API.sThaumcraftCompat != null) - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); - GT_ModHandler.registerBoxableItemToToolBox(rStack); + if (GregTechAPI.sThaumcraftCompat != null) + GregTechAPI.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + GTModHandler.registerBoxableItemToToolBox(rStack); return rStack; } return null; @@ -252,7 +252,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item } /** - * Called by the Block Harvesting Event within the GT_Proxy + * Called by the Block Harvesting Event within the GTProxy */ @Mod.EventHandler public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, @@ -310,7 +310,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { IToolStats tStats = getToolStats(aStack); if (tStats == null || !isItemStackUsable(aStack)) return true; - GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F); + GTUtility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F); if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true; if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { float tMagicDamage = tStats.getMagicDamageAgainstEntity( @@ -420,7 +420,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item IToolStats tStats = getToolStats(aStack); int tOffset = getElectricStats(aStack) != null ? 2 : 1; if (tStats != null) { - if (tStats instanceof GT_Tool_Turbine) { + if (tStats instanceof ToolTurbine) { // Durability -> toolMaxDamage // % Efficiency -> toolCombatDamage -> toolQuality @@ -434,9 +434,9 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item @SuppressWarnings("AccessStaticViaInstance") float aOptFlow = (Math.max( Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + ((MetaGeneratedTool) aStack.getItem()).getToolStats(aStack) .getSpeedMultiplier() - * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed + * ((MetaGeneratedTool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50F)); aList.add( tOffset + 0, @@ -464,7 +464,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("006", "Optimal Steam flow: %s L/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -476,7 +476,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("900", "Energy from Optimal Steam Flow: %s EU/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -520,7 +520,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("902", "Optimal SC Steam flow: %s L/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -532,7 +532,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("903", "Energy from Optimal SC Steam Flow: %s EU/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -545,7 +545,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("007", "Energy from Optimal Gas Flow: %s EU/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -560,7 +560,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item transItem("008", "Energy from Optimal Plasma Flow: %s EU/t"), "" + EnumChatFormatting.GOLD + formatNumbers( - GT_Utility.safeInt( + GTUtility.safeInt( (long) (Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed @@ -572,7 +572,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item aList.add( tOffset + 14, EnumChatFormatting.GRAY + "(EU/t values include efficiency and are not 100% accurate)"); - int toolQualityLevel = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality; + int toolQualityLevel = MetaGeneratedTool.getPrimaryMaterial(aStack).mToolQuality; int overflowMultiplier = 0; if (toolQualityLevel >= 6) { overflowMultiplier = 3; @@ -679,8 +679,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item setToolDamage(aStack, tNewDamage); if (tNewDamage >= getToolMaxDamage(aStack)) { IToolStats tStats = getToolStats(aStack); - if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { - if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (tStats == null || GTUtility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { + if (tStats != null) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); if (aStack.stackSize > 0) aStack.stackSize--; } } @@ -693,8 +693,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item setToolDamage(aStack, tNewDamage); if (tNewDamage >= getToolMaxDamage(aStack)) { IToolStats tStats = getToolStats(aStack); - if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { - if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (tStats == null || GTUtility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { + if (tStats != null) GTUtility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); if (aStack.stackSize > 0) aStack.stackSize--; } } @@ -731,7 +731,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item if (!isItemStackUsable(aStack)) return false; IToolStats tStats = getToolStats(aStack); if (tStats == null) return false; - GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); + GTUtility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); doDamage( aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); @@ -750,15 +750,15 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item private ItemStack getContainerItem(ItemStack aStack, boolean playSound) { if (!isItemStackUsable(aStack)) return null; - aStack = GT_Utility.copyAmount(1, aStack); + aStack = GTUtility.copyAmount(1, aStack); IToolStats tStats = getToolStats(aStack); if (tStats == null) return null; doDamage(aStack, tStats.getToolDamagePerContainerCraft()); aStack = aStack.stackSize > 0 ? aStack : null; - if (playSound && GT_Mod.gregtechproxy.mTicksUntilNextCraftSound <= 0) { - GT_Mod.gregtechproxy.mTicksUntilNextCraftSound = 10; + if (playSound && GTMod.gregtechproxy.mTicksUntilNextCraftSound <= 0) { + GTMod.gregtechproxy.mTicksUntilNextCraftSound = 10; String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound(); - GT_Utility.doSoundAtClient(sound, 1, 1.0F); + GTUtility.doSoundAtClient(sound, 1, 1.0F); } return aStack; } @@ -831,7 +831,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item @Override public boolean canUse(EntityPlayer player, ItemStack stack) { if (player == null) return false; - if (GT_Utility.isStackInvalid(stack) || !isItemStackUsable(stack)) return false; + if (GTUtility.isStackInvalid(stack) || !isItemStackUsable(stack)) return false; IToolStats tStats = getToolStats(stack); return tStats != null && tStats.isScrewdriver(); } @@ -839,7 +839,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item @Override public void damageScrewdriver(EntityPlayer player, ItemStack stack) { if (player == null) return; - if (GT_Utility.isStackInvalid(stack) || !isItemStackUsable(stack)) return; + if (GTUtility.isStackInvalid(stack) || !isItemStackUsable(stack)) return; IToolStats tStats = getToolStats(stack); if (tStats != null) doDamage(stack, tStats.getToolDamagePerEntityAttack()); } @@ -935,7 +935,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item } for (Entry<Integer, Integer> tEntry : tMap.entrySet()) { if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) - || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId) + || tEntry.getKey() == EnchantmentRadioactivity.INSTANCE.effectId) tResult.put(tEntry.getKey(), tEntry.getValue()); else switch (Enchantment.enchantmentsList[tEntry.getKey()].type) { case weapon: diff --git a/src/main/java/gregtech/api/logic/AbstractProcessingLogic.java b/src/main/java/gregtech/api/logic/AbstractProcessingLogic.java index 3c05d8bed0..ed953d9477 100644 --- a/src/main/java/gregtech/api/logic/AbstractProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/AbstractProcessingLogic.java @@ -11,9 +11,9 @@ import gregtech.api.interfaces.tileentity.IVoidable; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.OverclockCalculator; +import gregtech.api.util.ParallelHelper; /** * Logic class to calculate result of recipe check from inputs. @@ -23,7 +23,7 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< protected IVoidable machine; protected Supplier<RecipeMap<?>> recipeMapSupplier; - protected GT_Recipe lastRecipe; + protected GTRecipe lastRecipe; protected RecipeMap<?> lastRecipeMap; protected ItemStack[] outputItems; protected FluidStack[] outputFluids; @@ -229,8 +229,8 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< * At this point, inputs have been already consumed. */ @Nonnull - protected CheckRecipeResult applyRecipe(@Nonnull GT_Recipe recipe, @Nonnull GT_ParallelHelper helper, - @Nonnull GT_OverclockCalculator calculator, @Nonnull CheckRecipeResult result) { + protected CheckRecipeResult applyRecipe(@Nonnull GTRecipe recipe, @Nonnull ParallelHelper helper, + @Nonnull OverclockCalculator calculator, @Nonnull CheckRecipeResult result) { if (recipe.mCanBeBuffered) { lastRecipe = recipe; } else { @@ -267,8 +267,8 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< /** * Override to tweak final duration that will be set as a result of this logic class. */ - protected double calculateDuration(@Nonnull GT_Recipe recipe, @Nonnull GT_ParallelHelper helper, - @Nonnull GT_OverclockCalculator calculator) { + protected double calculateDuration(@Nonnull GTRecipe recipe, @Nonnull ParallelHelper helper, + @Nonnull OverclockCalculator calculator) { return calculator.getDuration() * helper.getDurationMultiplierDouble(); } @@ -276,7 +276,7 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< * Override to do additional check for found recipe if needed. */ @Nonnull - protected CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { + protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } @@ -289,7 +289,7 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< * all inputs! */ @Nonnull - protected CheckRecipeResult onRecipeStart(@Nonnull GT_Recipe recipe) { + protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { return CheckRecipeResultRegistry.SUCCESSFUL; } @@ -297,8 +297,8 @@ public abstract class AbstractProcessingLogic<P extends AbstractProcessingLogic< * Override to tweak overclock logic if needed. */ @Nonnull - protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) { - return new GT_OverclockCalculator().setRecipeEUt(recipe.mEUt) + protected OverclockCalculator createOverclockCalculator(@Nonnull GTRecipe recipe) { + return new OverclockCalculator().setRecipeEUt(recipe.mEUt) .setAmperage(availableAmperage) .setEUt(availableVoltage) .setDuration(recipe.mDuration) diff --git a/src/main/java/gregtech/api/logic/ItemInventoryLogic.java b/src/main/java/gregtech/api/logic/ItemInventoryLogic.java index 69005216b8..22d4a9a627 100644 --- a/src/main/java/gregtech/api/logic/ItemInventoryLogic.java +++ b/src/main/java/gregtech/api/logic/ItemInventoryLogic.java @@ -25,12 +25,12 @@ import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.item.ItemHolder; /** * Generic Item logic for MuTEs. - * + * * @author BlueWeabo */ public class ItemInventoryLogic { @@ -101,7 +101,7 @@ public class ItemInventoryLogic { } /** - * + * * @return The Item Inventory Logic as an NBTTagCompound to be saved in another nbt as how one wants. */ @Nonnull @@ -150,7 +150,7 @@ public class ItemInventoryLogic { final NBTTagCompound tNBT = nbtList.getCompoundTagAt(i); final int tSlot = tNBT.getShort("s"); if (tSlot >= 0 && tSlot < inventory.getSlots()) { - inventory.setStackInSlot(tSlot, GT_Utility.loadItem(tNBT)); + inventory.setStackInSlot(tSlot, GTUtility.loadItem(tNBT)); } } } diff --git a/src/main/java/gregtech/api/logic/MuTEProcessingLogic.java b/src/main/java/gregtech/api/logic/MuTEProcessingLogic.java index da53c8875d..0d6bf4cac9 100644 --- a/src/main/java/gregtech/api/logic/MuTEProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/MuTEProcessingLogic.java @@ -24,10 +24,10 @@ import gregtech.api.logic.interfaces.ProcessingLogicHost; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; +import gregtech.api.util.OverclockCalculator; +import gregtech.api.util.ParallelHelper; /** * Processing logic class, dedicated for MultiTileEntities. @@ -81,13 +81,13 @@ public class MuTEProcessingLogic<P extends MuTEProcessingLogic<P>> extends Abstr } @Nonnull - protected CheckRecipeResult processRecipe(@Nonnull List<GT_Recipe> recipes, @Nonnull ItemInventoryLogic itemInput, + protected CheckRecipeResult processRecipe(@Nonnull List<GTRecipe> recipes, @Nonnull ItemInventoryLogic itemInput, @Nonnull FluidInventoryLogic fluidInput) { CheckRecipeResult result = CheckRecipeResultRegistry.INTERNAL_ERROR; - for (GT_Recipe recipe : recipes) { + for (GTRecipe recipe : recipes) { Objects.requireNonNull(recipe); - GT_ParallelHelper helper = createParallelHelper(recipe, itemInput, fluidInput); - GT_OverclockCalculator calculator = createOverclockCalculator(recipe); + ParallelHelper helper = createParallelHelper(recipe, itemInput, fluidInput); + OverclockCalculator calculator = createOverclockCalculator(recipe); helper.setCalculator(calculator); helper.build(); result = helper.getResult(); @@ -112,9 +112,9 @@ public class MuTEProcessingLogic<P extends MuTEProcessingLogic<P>> extends Abstr } @Nonnull - protected GT_ParallelHelper createParallelHelper(@Nonnull GT_Recipe recipe, @Nonnull ItemInventoryLogic itemInput, + protected ParallelHelper createParallelHelper(@Nonnull GTRecipe recipe, @Nonnull ItemInventoryLogic itemInput, @Nonnull FluidInventoryLogic fluidInput) { - return new GT_ParallelHelper().setRecipe(recipe) + return new ParallelHelper().setRecipe(recipe) .setItemInputInventory(itemInput) .setFluidInputInventory(fluidInput) .setAvailableEUt(availableVoltage * availableAmperage) @@ -197,7 +197,7 @@ public class MuTEProcessingLogic<P extends MuTEProcessingLogic<P>> extends Abstr if (outputItems != null) { NBTTagList itemOutputsNBT = new NBTTagList(); for (ItemStack item : outputItems) { - itemOutputsNBT.appendTag(GT_Utility.saveItem(item)); + itemOutputsNBT.appendTag(GTUtility.saveItem(item)); } logicNBT.setTag("itemOutputs", itemOutputsNBT); } @@ -226,7 +226,7 @@ public class MuTEProcessingLogic<P extends MuTEProcessingLogic<P>> extends Abstr NBTTagList itemOutputsNBT = logicNBT.getTagList("itemOutputs", TAG_COMPOUND); outputItems = new ItemStack[itemOutputsNBT.tagCount()]; for (int i = 0; i < itemOutputsNBT.tagCount(); i++) { - outputItems[i] = GT_Utility.loadItem(itemOutputsNBT.getCompoundTagAt(i)); + outputItems[i] = GTUtility.loadItem(itemOutputsNBT.getCompoundTagAt(i)); } } if (logicNBT.hasKey("fluidOutputs")) { diff --git a/src/main/java/gregtech/api/logic/PowerLogic.java b/src/main/java/gregtech/api/logic/PowerLogic.java index ad19987a76..afc1877deb 100644 --- a/src/main/java/gregtech/api/logic/PowerLogic.java +++ b/src/main/java/gregtech/api/logic/PowerLogic.java @@ -8,12 +8,12 @@ import javax.annotation.Nonnull; import net.minecraft.nbt.NBTTagCompound; -import gregtech.api.enums.GT_Values.NBT; +import gregtech.api.enums.GTValues.NBT; /** * Power logic for machines. This is used to store all the important variables for a machine to have energy and use it * in any way. - * + * * @author BlueWeabo, Maxim */ public class PowerLogic { @@ -122,7 +122,7 @@ public class PowerLogic { /** * Injecting energy in the multiblock ampere per ampere until full or until we have added the maximum possible * amperes for this tick - * + * * @param voltage At what voltage are the amps? * @param availableAmperage How much amperage do we have available * @return Amount of amperes used @@ -218,7 +218,7 @@ public class PowerLogic { /** * Saves the power logic to its own nbt tag before saving it to the given one. - * + * * @param nbt Tag where you want to save the power logic tag to. */ public void saveToNBT(NBTTagCompound nbt) { @@ -233,7 +233,7 @@ public class PowerLogic { /** * Loads the power logic from its own nbt after getting it from the given one - * + * * @param nbt Tag where the power logic tag was saved to */ public void loadFromNBT(NBTTagCompound nbt) { diff --git a/src/main/java/gregtech/api/logic/ProcessingLogic.java b/src/main/java/gregtech/api/logic/ProcessingLogic.java index 4d203ed80f..63c8f6494e 100644 --- a/src/main/java/gregtech/api/logic/ProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/ProcessingLogic.java @@ -14,9 +14,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SingleRecipeCheck; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.OverclockCalculator; +import gregtech.api.util.ParallelHelper; /** * Logic class to calculate result of recipe check from inputs, based on recipemap. @@ -119,10 +119,10 @@ public class ProcessingLogic extends AbstractProcessingLogic<ProcessingLogic> { recipeLockableMachine.getSingleRecipeCheck() .getRecipe()).checkRecipeResult; } - Stream<GT_Recipe> matchedRecipes = findRecipeMatches(recipeMap); - Iterable<GT_Recipe> recipeIterable = matchedRecipes::iterator; + Stream<GTRecipe> matchedRecipes = findRecipeMatches(recipeMap); + Iterable<GTRecipe> recipeIterable = matchedRecipes::iterator; CheckRecipeResult checkRecipeResult = CheckRecipeResultRegistry.NO_RECIPE; - for (GT_Recipe matchedRecipe : recipeIterable) { + for (GTRecipe matchedRecipe : recipeIterable) { CalculationResult foundResult = validateAndCalculateRecipe(matchedRecipe); if (foundResult.successfullyConsumedInputs) { // Successfully found and set recipe, so return it @@ -143,14 +143,14 @@ public class ProcessingLogic extends AbstractProcessingLogic<ProcessingLogic> { * @param recipe The recipe which will be checked and processed */ @Nonnull - private CalculationResult validateAndCalculateRecipe(@Nonnull GT_Recipe recipe) { + private CalculationResult validateAndCalculateRecipe(@Nonnull GTRecipe recipe) { CheckRecipeResult result = validateRecipe(recipe); if (!result.wasSuccessful()) { return CalculationResult.ofFailure(result); } - GT_ParallelHelper helper = createParallelHelper(recipe); - GT_OverclockCalculator calculator = createOverclockCalculator(recipe); + ParallelHelper helper = createParallelHelper(recipe); + OverclockCalculator calculator = createOverclockCalculator(recipe); helper.setCalculator(calculator); helper.build(); @@ -170,7 +170,7 @@ public class ProcessingLogic extends AbstractProcessingLogic<ProcessingLogic> { * Override this method if it doesn't work with normal recipemaps. */ @Nonnull - protected Stream<GT_Recipe> findRecipeMatches(@Nullable RecipeMap<?> map) { + protected Stream<GTRecipe> findRecipeMatches(@Nullable RecipeMap<?> map) { if (map == null) { return Stream.empty(); } @@ -186,8 +186,8 @@ public class ProcessingLogic extends AbstractProcessingLogic<ProcessingLogic> { * Override to tweak parallel logic if needed. */ @Nonnull - protected GT_ParallelHelper createParallelHelper(@Nonnull GT_Recipe recipe) { - return new GT_ParallelHelper().setRecipe(recipe) + protected ParallelHelper createParallelHelper(@Nonnull GTRecipe recipe) { + return new ParallelHelper().setRecipe(recipe) .setItemInputs(inputItems) .setFluidInputs(inputFluids) .setAvailableEUt(availableVoltage * availableAmperage) diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 2bc560f8e7..aae3ddcebb 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -1,7 +1,7 @@ package gregtech.api.metatileentity; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.NW; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.NW; import java.util.ArrayList; import java.util.Arrays; @@ -25,8 +25,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.graphs.Lock; @@ -38,13 +38,13 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IDebugableTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity; -import gregtech.api.net.GT_Packet_TileEntity; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.net.GTPacketTileEntity; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import gregtech.common.covers.CoverInfo; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -59,7 +59,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity public byte mConnections = IConnectable.NO_CONNECTION; protected MetaPipeEntity mMetaTileEntity; - private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; + private final int[] mTimeStatistics = new int[GregTechAPI.TICKS_FOR_LAG_AVERAGING]; private boolean hasTimeStatisticsStarted; private boolean mWorkUpdate = false, mWorks = true; private byte mColor = 0, oColor = 0, oStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, @@ -214,7 +214,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity | IConnectable.HAS_HARDENEDFOAM); } if (mTickTimer > 12 && oldConnections != mConnections) - GregTech_API.causeCableUpdate(worldObj, xCoord, yCoord, zCoord); + GregTechAPI.causeCableUpdate(worldObj, xCoord, yCoord, zCoord); } mMetaTileEntity.onPreTick(this, mTickTimer); if (!hasValidMetaTileEntity()) return; @@ -264,14 +264,14 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity } } catch (Throwable e) { e.printStackTrace(); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } if (isServerSide() && hasTimeStatisticsStarted && hasValidMetaTileEntity()) { tTime = System.nanoTime() - tTime; mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length; mTimeStatistics[mTimeStatisticsIndex] = (int) tTime; - if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L) + if (tTime > 0 && tTime > (GregTechAPI.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) @@ -296,7 +296,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (mSendClientData) { NW.sendPacketToAllPlayersInRange( worldObj, - new GT_Packet_TileEntity( + new GTPacketTileEntity( xCoord, (short) yCoord, zCoord, @@ -438,7 +438,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity tList.add( "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " - + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + + GregTechAPI.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server."); } if (mMetaTileEntity != null) { @@ -491,13 +491,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity markDirty(); mInventoryChanged = true; if (canAccessData()) mMetaTileEntity - .setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); + .setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GTOreDictUnificator.setStack(true, aStack)); } @Override public String getInventoryName() { if (canAccessData()) return mMetaTileEntity.getInventoryName(); - if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName(); + if (GregTechAPI.METATILEENTITIES[mID] != null) return GregTechAPI.METATILEENTITIES[mID].getInventoryName(); return ""; } @@ -776,7 +776,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public ArrayList<ItemStack> getDrops() { - final ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID); + final ItemStack rStack = new ItemStack(GregTechAPI.sBlockMachines, 1, mID); final NBTTagCompound tNBT = new NBTTagCompound(); writeCoverNBT(tNBT, true); @@ -799,7 +799,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final ForgeDirection tSide = (getCoverIDAtSide(side) == 0) - ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) + ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; return (getCoverInfoAtSide(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(side).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { @@ -810,19 +810,19 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GTUtility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { mMetaTileEntity.markDirty(); tCurrentItem.func_150996_a(Items.bucket); setColorization((byte) -1); return true; } - final ForgeDirection tSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { + final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) { if (mMetaTileEntity.onWrenchRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { mMetaTileEntity.markDirty(); - GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GT_Utility.sendSoundToPlayers( + GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -833,15 +833,15 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity } return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList)) { if (getCoverIDAtSide(side) == 0 && getCoverIDAtSide(tSide) != 0) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( tSide, getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ, tCurrentItem); mMetaTileEntity.markDirty(); - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -851,13 +851,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity zCoord); } } else { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { setCoverDataAtSide( side, getCoverInfoAtSide(side).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); mMetaTileEntity.markDirty(); - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -870,21 +870,21 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sHardHammerList)) { return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSoftHammerList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); else enableWorking(); mMetaTileEntity.markDirty(); - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled"))); - GT_Utility.sendSoundToPlayers( + GTUtility.trans("090", "Machine Processing: ") + + (isAllowedToWork() ? GTUtility.trans("088", "Enabled") + : GTUtility.trans("087", "Disabled"))); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, @@ -896,11 +896,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList)) { if (mMetaTileEntity.onWireCutterRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { mMetaTileEntity.markDirty(); // logic handled internally - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -913,11 +913,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { if (mMetaTileEntity.onSolderingToolRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { mMetaTileEntity.markDirty(); // logic handled internally - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 1.0F, @@ -925,16 +925,16 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity xCoord, yCoord, zCoord); - } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { + } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mMetaTileEntity.markDirty(); mStrongRedstone ^= tSide.flag; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("091", "Redstone Output at Side ") + tSide - + GT_Utility.trans("092", " set to: ") - + ((mStrongRedstone & tSide.flag) != 0 ? GT_Utility.trans("093", "Strong") - : GT_Utility.trans("094", "Weak"))); - GT_Utility.sendSoundToPlayers( + GTUtility.trans("091", "Redstone Output at Side ") + tSide + + GTUtility.trans("092", " set to: ") + + ((mStrongRedstone & tSide.flag) != 0 ? GTUtility.trans("093", "Strong") + : GTUtility.trans("094", "Weak"))); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, @@ -954,17 +954,17 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final CoverInfo coverInfo = getCoverInfoAtSide(coverSide); if (coverInfo.getCoverID() == 0) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { - final GT_CoverBehaviorBase<?> coverBehavior = GregTech_API.getCoverBehaviorNew(tCurrentItem); + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { + final CoverBehaviorBase<?> coverBehavior = GregTechAPI.getCoverBehaviorNew(tCurrentItem); if (coverBehavior.isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + && mMetaTileEntity.allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, side); mMetaTileEntity.markDirty(); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -976,9 +976,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } } else { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - GT_Utility.sendSoundToPlayers( + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCrowbarList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_BREAK, 1.0F, @@ -993,7 +993,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity } } } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config or turn back. - side = (getCoverIDAtSide(side) == 0) ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) : side; + side = (getCoverIDAtSide(side) == 0) ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; final CoverInfo coverInfo = getCoverInfoAtSide(side); return coverInfo.isValid() && coverInfo.onCoverShiftRightClick(aPlayer); } @@ -1064,7 +1064,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final CoverInfo coverInfo = getCoverInfoAtSide(ForgeDirection.getOrientation(ordinalSide)); if (canAccessData() && (coverInfo.letsItemsOut(-1) || coverInfo.letsItemsIn(-1))) return mMetaTileEntity.getAccessibleSlotsFromSide(ordinalSide); - return GT_Values.emptyIntArray; + return GTValues.emptyIntArray; } /** @@ -1164,7 +1164,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public UUID getOwnerUuid() { - return GT_Utility.defaultUuid; + return GTUtility.defaultUuid; } @Override @@ -1276,15 +1276,15 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean addStackToSlot(int aIndex, ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return true; + if (GTUtility.isStackInvalid(aStack)) return true; if (aIndex < 0 || aIndex >= getSizeInventory()) return false; final ItemStack tStack = getStackInSlot(aIndex); - if (GT_Utility.isStackInvalid(tStack)) { + if (GTUtility.isStackInvalid(tStack)) { setInventorySlotContents(aIndex, aStack); return true; } - aStack = GT_OreDictUnificator.get(aStack); - if (GT_Utility.areStacksEqual(tStack, aStack) + aStack = GTOreDictUnificator.get(aStack); + if (GTUtility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { markDirty(); tStack.stackSize += aStack.stackSize; @@ -1295,7 +1295,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) { - return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack)); + return addStackToSlot(aIndex, GTUtility.copyAmount(aAmount, aStack)); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 27a6216cff..1229dfcc5b 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -1,8 +1,8 @@ package gregtech.api.metatileentity; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.NW; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.NW; +import static gregtech.api.enums.GTValues.V; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import java.lang.reflect.Field; @@ -54,9 +54,9 @@ import appeng.me.helpers.IGridProxyable; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; import cpw.mods.fml.relauncher.ReflectionHelper; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; @@ -71,19 +71,19 @@ import gregtech.api.interfaces.tileentity.IDebugableTileEntity; import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregtechWailaProvider; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.net.GT_Packet_TileEntity; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.metatileentity.implementations.MTEBasicMachine; +import gregtech.api.metatileentity.implementations.MTEHatch; +import gregtech.api.net.GTPacketTileEntity; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.blockupdate.BlockUpdateHandler; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; -import gregtech.common.GT_Pollution; +import gregtech.common.Pollution; import gregtech.common.covers.CoverInfo; import ic2.api.Direction; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -102,7 +102,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity .findField(EntityItem.class, "health", "field_70291_e"); private final boolean[] mActiveEUInputs = new boolean[] { false, false, false, false, false, false }; private final boolean[] mActiveEUOutputs = new boolean[] { false, false, false, false, false, false }; - private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; + private final int[] mTimeStatistics = new int[GregTechAPI.TICKS_FOR_LAG_AVERAGING]; private boolean hasTimeStatisticsStarted; public long mLastSoundTick = 0; public boolean mWasShutdown = false; @@ -125,7 +125,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity private long oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; private long mLastCheckTick = 0; private String mOwnerName = ""; - private UUID mOwnerUuid = GT_Utility.defaultUuid; + private UUID mOwnerUuid = GTUtility.defaultUuid; private NBTTagCompound mRecipeStuff = new NBTTagCompound(); private int cableUpdateDelay = 30; @@ -242,7 +242,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity */ public void chargeItem(ItemStack aStack) { decreaseStoredEU( - GT_ModHandler.chargeElectricItem( + GTModHandler.chargeElectricItem( aStack, (int) Math.min(Integer.MAX_VALUE, getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), @@ -256,7 +256,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity */ public void dischargeItem(ItemStack aStack) { increaseStoredEnergyUnits( - GT_ModHandler.dischargeElectricItem( + GTModHandler.dischargeElectricItem( aStack, (int) Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), @@ -351,7 +351,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } if (mNeedsUpdate) { - if (GT_Mod.gregtechproxy.mUseBlockUpdateHandler) { + if (GTMod.gregtechproxy.mUseBlockUpdateHandler) { BlockUpdateHandler.Instance.enqueueBlockUpdate(worldObj, getLocation()); } else { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); @@ -424,7 +424,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { final long tOutputVoltage = Math - .max(oOutput, oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))); + .max(oOutput, oOutput + (1L << Math.max(0, GTUtility.getTier(oOutput) - 1))); final long tUsableAmperage = Math.min( getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); @@ -436,7 +436,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } } if (getEUCapacity() > 0) { - if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { + if (GregTechAPI.sMachineFireExplosions && getRandomNumber(1000) == 0) { final Block tBlock = getBlockAtSide(ForgeDirection.getOrientation(getRandomNumber(6))); if (tBlock instanceof BlockFire) doEnergyExplosion(); } @@ -446,7 +446,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return; } - if (GregTech_API.sMachineRainExplosions) { + if (GregTechAPI.sMachineRainExplosions) { if (mMetaTileEntity.willExplodeInRain()) { if (getRandomNumber(1000) == 0 && isRainPossible()) { // Short-circuit so raincheck happens before isRainExposed, @@ -457,12 +457,12 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (worldObj.isRaining() && isRainExposed()) { if (getRandomNumber(10) == 0) { try { - GT_Mod.achievements.issueAchievement( + GTMod.achievements.issueAchievement( this.getWorldObj() .getPlayerEntityByName(mOwnerName), "badweather"); } catch (Exception ignored) {} - GT_Log.exp.println( + GTLog.exp.println( "Machine at: " + this.getXCoord() + " | " + this.getYCoord() @@ -473,7 +473,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity + " explosion due to rain!"); doEnergyExplosion(); } else { - GT_Log.exp.println( + GTLog.exp.println( "Machine at: " + this.getXCoord() + " | " + this.getYCoord() @@ -489,16 +489,16 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity mRunningThroughTick = false; return; } - if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() + if (GregTechAPI.sMachineThunderExplosions && worldObj.isThundering() && getRandomNumber(3) == 0 && isRainExposed()) { try { - GT_Mod.achievements.issueAchievement( + GTMod.achievements.issueAchievement( this.getWorldObj() .getPlayerEntityByName(mOwnerName), "badweather"); } catch (Exception ignored) {} - GT_Log.exp.println( + GTLog.exp.println( "Machine at: " + this.getXCoord() + " | " + this.getYCoord() @@ -591,8 +591,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity tData = mMetaTileEntity.getUpdateData(); if (tData != oUpdateData) sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, oUpdateData = tData); - if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { - tData = ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage(); + if (mMetaTileEntity instanceof MTEHatch) { + tData = ((MTEHatch) mMetaTileEntity).getTexturePage(); if (tData != oTexturePage) sendBlockEvent( GregTechTileClientEvents.CHANGE_CUSTOM_DATA, (byte) ((oTexturePage = tData) | 0x80)); // set last bit as a flag for page @@ -628,12 +628,12 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } } catch (Throwable e) { e.printStackTrace(); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); try { mMetaTileEntity.onTickFail(this, mTickTimer); } catch (Throwable ex) { ex.printStackTrace(); - ex.printStackTrace(GT_Log.err); + ex.printStackTrace(GTLog.err); } } @@ -641,7 +641,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity tTime = System.nanoTime() - tTime; mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length; mTimeStatistics[mTimeStatisticsIndex] = (int) tTime; - if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1_000_000L) + if (tTime > 0 && tTime > (GregTechAPI.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1_000_000L) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) @@ -684,7 +684,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (mSendClientData) { NW.sendPacketToAllPlayersInRange( worldObj, - new GT_Packet_TileEntity( + new GTPacketTileEntity( xCoord, (short) yCoord, zCoord, @@ -699,8 +699,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0) | (mWorks ? 64 : 0)), - oTexturePage = (hasValidMetaTileEntity() && mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ? ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage() + oTexturePage = (hasValidMetaTileEntity() && mMetaTileEntity instanceof MTEHatch) + ? ((MTEHatch) mMetaTileEntity).getTexturePage() : 0, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) @@ -747,9 +747,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity try { mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue); } catch (Throwable e) { - GT_Log.err.println( + GTLog.err.println( "Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } } @@ -768,8 +768,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (hasValidMetaTileEntity()) { if ((aValue & 0x80) == 0) // Is texture index mMetaTileEntity.onValueUpdate((byte) (aValue & 0x7F)); - else if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) // is texture page and hatch - ((GT_MetaTileEntity_Hatch) mMetaTileEntity).onTexturePageUpdate((byte) (aValue & 0x7F)); + else if (mMetaTileEntity instanceof MTEHatch) // is texture page and hatch + ((MTEHatch) mMetaTileEntity).onTexturePageUpdate((byte) (aValue & 0x7F)); } } case GregTechTileClientEvents.CHANGE_COLOR -> { @@ -836,11 +836,11 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity int samples = mTimeStatistics.length - amountOfZero; if (samples > 0) { tList.add( - "Average CPU load of ~" + GT_Utility.formatNumbers(tAverageTime / samples) + "Average CPU load of ~" + GTUtility.formatNumbers(tAverageTime / samples) + "ns over " - + GT_Utility.formatNumbers(samples) + + GTUtility.formatNumbers(samples) + " ticks with worst time of " - + GT_Utility.formatNumbers(tWorstTime) + + GTUtility.formatNumbers(tWorstTime) + "ns."); } } else { @@ -848,9 +848,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity tList.add("Just started tick time statistics."); } tList.add( - "Recorded " + GT_Utility.formatNumbers(mMetaTileEntity.mSoundRequests) + "Recorded " + GTUtility.formatNumbers(mMetaTileEntity.mSoundRequests) + " sound requests in " - + GT_Utility.formatNumbers(mTickTimer - mLastCheckTick) + + GTUtility.formatNumbers(mTickTimer - mLastCheckTick) + " ticks."); mLastCheckTick = mTickTimer; mMetaTileEntity.mSoundRequests = 0; @@ -858,7 +858,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity tList.add( "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " - + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + + GregTechAPI.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server."); } tList.add( @@ -867,8 +867,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } if (aLogLevel > 0) { if (getSteamCapacity() > 0 && hasSteamEngineUpgrade()) tList.add( - GT_Utility.formatNumbers(getStoredSteam()) + " of " - + GT_Utility.formatNumbers(getSteamCapacity()) + GTUtility.formatNumbers(getStoredSteam()) + " of " + + GTUtility.formatNumbers(getSteamCapacity()) + " Steam"); tList.add( "Machine is " + (mActive ? EnumChatFormatting.GREEN + "active" + EnumChatFormatting.RESET @@ -907,7 +907,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (mMetaTileEntity.shouldTriggerBlockUpdate()) { // If we're triggering a block update this will call onMachineBlockUpdate() - GregTech_API.causeMachineUpdate(worldObj, xCoord, yCoord, zCoord); + GregTechAPI.causeMachineUpdate(worldObj, xCoord, yCoord, zCoord); } else { // If we're not trigger a cascading one, call the update here. onMachineBlockUpdate(); @@ -934,14 +934,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity markDirty(); mMetaTileEntity.setInventorySlotContents( aIndex, - worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); + worldObj.isRemote ? aStack : GTOreDictUnificator.setStack(true, aStack)); } } @Override public String getInventoryName() { if (canAccessData()) return mMetaTileEntity.getInventoryName(); - if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName(); + if (GregTechAPI.METATILEENTITIES[mID] != null) return GregTechAPI.METATILEENTITIES[mID].getInventoryName(); return ""; } @@ -1374,7 +1374,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity public void doEnergyExplosion() { if (getUniversalEnergyCapacity() > 0 && getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 5) { - GT_Log.exp.println( + GTLog.exp.println( "Energy Explosion, injected " + getUniversalEnergyStored() + "EU >= " + getUniversalEnergyCapacity() / 5D @@ -1383,7 +1383,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity doExplosion( oOutput * (getUniversalEnergyStored() >= getUniversalEnergyCapacity() ? 4 : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1)); - GT_Mod.achievements.issueAchievement( + GTMod.achievements.issueAchievement( this.getWorldObj() .getPlayerEntityByName(mOwnerName), "electricproblems"); @@ -1394,7 +1394,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity public void doExplosion(long aAmount) { if (canAccessData()) { // This is only for Electric Machines - if (GregTech_API.sMachineWireFire && mMetaTileEntity.isElectric()) { + if (GregTechAPI.sMachineWireFire && mMetaTileEntity.isElectric()) { try { mReleaseEnergy = true; IEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this); @@ -1403,7 +1403,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity mReleaseEnergy = false; // Normal Explosion Code mMetaTileEntity.onExplosion(); - if (GT_Mod.gregtechproxy.mExplosionItemDrop) { + if (GTMod.gregtechproxy.mExplosionItemDrop) { for (int i = 0; i < this.getSizeInventory(); i++) { final ItemStack tItem = this.getStackInSlot(i); if ((tItem != null) && (tItem.stackSize > 0) && (this.isValidSlot(i))) { @@ -1415,12 +1415,12 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (mRecipeStuff != null) { for (int i = 0; i < 9; i++) { if (this.getRandomNumber(100) < 50) { - dropItems(GT_Utility.loadItem(mRecipeStuff, "Ingredient." + i)); + dropItems(GTUtility.loadItem(mRecipeStuff, "Ingredient." + i)); } } } - GT_Pollution.addPollution((TileEntity) this, GT_Mod.gregtechproxy.mPollutionOnExplosion); + Pollution.addPollution((TileEntity) this, GTMod.gregtechproxy.mPollutionOnExplosion); mMetaTileEntity.doExplosion(aAmount); } } @@ -1453,7 +1453,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity @Override public ArrayList<ItemStack> getDrops() { - final ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID); + final ItemStack rStack = new ItemStack(GregTechAPI.sBlockMachines, 1, mID); final NBTTagCompound tNBT = new NBTTagCompound(); if (mRecipeStuff != null && !mRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", mRecipeStuff); if (mMuffler) tNBT.setBoolean("mMuffler", mMuffler); @@ -1486,7 +1486,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final ForgeDirection tSide = (getCoverIDAtSide(side) == 0) - ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) + ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(side).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { @@ -1502,17 +1502,17 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GTUtility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { tCurrentItem.func_150996_a(Items.bucket); setColorization((byte) (getColorization() >= 16 ? -2 : -1)); return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { - if (aPlayer.isSneaking() && mMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine - && ((GT_MetaTileEntity_BasicMachine) mMetaTileEntity) - .setMainFacing(GT_Utility.determineWrenchingSide(side, aX, aY, aZ))) { - GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GT_Utility.sendSoundToPlayers( + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) { + if (aPlayer.isSneaking() && mMetaTileEntity instanceof MTEBasicMachine + && ((MTEBasicMachine) mMetaTileEntity) + .setMainFacing(GTUtility.determineWrenchingSide(side, aX, aY, aZ))) { + GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1523,14 +1523,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity cableUpdateDelay = 10; } else if (mMetaTileEntity.onWrenchRightClick( side, - GT_Utility.determineWrenchingSide(side, aX, aY, aZ), + GTUtility.determineWrenchingSide(side, aX, aY, aZ), aPlayer, aX, aY, aZ, tCurrentItem)) { - GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GT_Utility.sendSoundToPlayers( + GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1543,8 +1543,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( side, getCoverBehaviorAtSideNew(side).onCoverScrewdriverClick( @@ -1557,7 +1557,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity aY, aZ)); mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1569,18 +1569,18 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sHardHammerList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { mInputDisabled = !mInputDisabled; if (mInputDisabled) mOutputDisabled = !mOutputDisabled; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("086", "Auto-Input: ") + (mInputDisabled - ? GT_Utility.trans("087", "Disabled") - : GT_Utility.trans("088", "Enabled") + GT_Utility.trans("089", " Auto-Output: ") - + (mOutputDisabled ? GT_Utility.trans("087", "Disabled") - : GT_Utility.trans("088", "Enabled")))); - GT_Utility.sendSoundToPlayers( + GTUtility.trans("086", "Auto-Input: ") + + (mInputDisabled ? GTUtility.trans("087", "Disabled") + : GTUtility.trans("088", "Enabled") + GTUtility.trans("089", " Auto-Output: ") + + (mOutputDisabled ? GTUtility.trans("087", "Disabled") + : GTUtility.trans("088", "Enabled")))); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_ANVIL_USE, 1.0F, @@ -1592,19 +1592,19 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSoftHammerList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); else enableWorking(); { - String tChat = GT_Utility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled")); + String tChat = GTUtility.trans("090", "Machine Processing: ") + + (isAllowedToWork() ? GTUtility.trans("088", "Enabled") + : GTUtility.trans("087", "Disabled")); if (getMetaTileEntity() != null && getMetaTileEntity().hasAlternativeModeText()) tChat = getMetaTileEntity().getAlternativeModeText(); - GT_Utility.sendChatToPlayer(aPlayer, tChat); + GTUtility.sendChatToPlayer(aPlayer, tChat); } - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, @@ -1616,11 +1616,11 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { - final ForgeDirection tSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { + final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); if (mMetaTileEntity.onSolderingToolRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { // logic handled internally - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 1.0F, @@ -1628,15 +1628,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity xCoord, yCoord, zCoord); - } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { + } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= tSide.flag; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("091", "Redstone Output at Side ") + tSide - + GT_Utility.trans("092", " set to: ") - + ((mStrongRedstone & tSide.flag) != 0 ? GT_Utility.trans("093", "Strong") - : GT_Utility.trans("094", "Weak"))); - GT_Utility.sendSoundToPlayers( + GTUtility.trans("091", "Redstone Output at Side ") + tSide + + GTUtility.trans("092", " set to: ") + + ((mStrongRedstone & tSide.flag) != 0 ? GTUtility.trans("093", "Strong") + : GTUtility.trans("094", "Weak"))); + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, @@ -1651,11 +1651,11 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) { - final ForgeDirection tSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList)) { + final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); if (mMetaTileEntity.onWireCutterRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { // logic handled internally - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1670,20 +1670,19 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } ForgeDirection coverSide = side; - if (getCoverIDAtSide(side) == 0) coverSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + if (getCoverIDAtSide(side) == 0) coverSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); if (getCoverIDAtSide(coverSide) == 0) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { - final GT_CoverBehaviorBase<?> coverBehavior = GregTech_API - .getCoverBehaviorNew(tCurrentItem); + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { + final CoverBehaviorBase<?> coverBehavior = GregTechAPI.getCoverBehaviorNew(tCurrentItem); if (coverBehavior.isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + && mMetaTileEntity.allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, coverSide); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1696,9 +1695,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return true; } } else { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - GT_Utility.sendSoundToPlayers( + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCrowbarList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_BREAK, 1.0F, @@ -1709,15 +1708,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity dropCover(coverSide, side, false); } return true; - } else if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sJackhammerList)) { + } else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sJackhammerList)) { // Configuration of delicate electronics calls for a tool with precision and subtlety. - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { final CoverInfo info = getCoverInfoAtSide(coverSide); if (info != CoverInfo.EMPTY_INFO) { - final GT_CoverBehaviorBase<?> behavior = info.getCoverBehavior(); + final CoverBehaviorBase<?> behavior = info.getCoverBehavior(); if (behavior.allowsTickRateAddition()) { info.onCoverJackhammer(aPlayer); - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_DRILL_DRILL_SOFT, 1.0F, @@ -1727,7 +1726,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity zCoord); } else { - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, StatCollector.translateToLocal("gt.cover.info.chat.tick_rate_not_allowed")); } @@ -1738,7 +1737,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } // End item != null } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. - side = (getCoverIDAtSide(side) == 0) ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) : side; + side = (getCoverIDAtSide(side) == 0) ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; return getCoverIDAtSide(side) > 0 && getCoverBehaviorAtSideNew(side).onCoverShiftRightClick( side, getCoverIDAtSide(side), @@ -1762,7 +1761,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (isUpgradable() && tCurrentItem != null) { if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) { if (addMufflerUpgrade()) { - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_CLICK, 1.0F, @@ -1779,7 +1778,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity mLockUpgrade = true; setOwnerName(aPlayer.getDisplayName()); setOwnerUuid(aPlayer.getUniqueID()); - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_CLICK, 1.0F, @@ -1799,9 +1798,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ); } catch (Throwable e) { - GT_Log.err.println( + GTLog.err.println( "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); e.printStackTrace(); } @@ -1813,9 +1812,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity try { if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer); } catch (Throwable e) { - GT_Log.err.println( + GTLog.err.println( "Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } } @@ -1859,7 +1858,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity final CoverInfo coverInfo = getCoverInfoAtSide(ForgeDirection.getOrientation(ordinalSide)); if (canAccessData() && (coverInfo.letsItemsOut(-1) || coverInfo.letsItemsIn(-1))) return mMetaTileEntity.getAccessibleSlotsFromSide(ordinalSide); - return GT_Values.emptyIntArray; + return GTValues.emptyIntArray; } /** @@ -1998,13 +1997,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity @Override public String getOwnerName() { - if (GT_Utility.isStringInvalid(mOwnerName)) return "Player"; + if (GTUtility.isStringInvalid(mOwnerName)) return "Player"; return mOwnerName; } @Override public String setOwnerName(String aName) { - if (GT_Utility.isStringInvalid(aName)) return mOwnerName = "Player"; + if (GTUtility.isStringInvalid(aName)) return mOwnerName = "Player"; return mOwnerName = aName; } @@ -2041,7 +2040,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity || getStoredEU() >= getEUCapacity() || mMetaTileEntity.maxAmperesIn() <= mAcceptedAmperes) return 0; if (aVoltage > getInputVoltage()) { - GT_Log.exp + GTLog.exp .println("Energy Explosion, injected " + aVoltage + "EU/t in a " + getInputVoltage() + "EU/t Machine!"); doExplosion(aVoltage); return 0; @@ -2245,15 +2244,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity @Override public boolean addStackToSlot(int slotIndex, ItemStack stack) { - if (GT_Utility.isStackInvalid(stack)) return true; + if (GTUtility.isStackInvalid(stack)) return true; if (slotIndex < 0 || slotIndex >= getSizeInventory()) return false; final ItemStack toStack = getStackInSlot(slotIndex); - if (GT_Utility.isStackInvalid(toStack)) { + if (GTUtility.isStackInvalid(toStack)) { setInventorySlotContents(slotIndex, stack); return true; } - final ItemStack fromStack = GT_OreDictUnificator.get(stack); - if (GT_Utility.areStacksEqual(toStack, fromStack) && toStack.stackSize + fromStack.stackSize + final ItemStack fromStack = GTOreDictUnificator.get(stack); + if (GTUtility.areStacksEqual(toStack, fromStack) && toStack.stackSize + fromStack.stackSize <= Math.min(fromStack.getMaxStackSize(), getInventoryStackLimit())) { toStack.stackSize += fromStack.stackSize; markDirty(); @@ -2264,7 +2263,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity @Override public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) { - return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack)); + return addStackToSlot(aIndex, GTUtility.copyAmount(aAmount, aStack)); } @Override @@ -2343,13 +2342,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity final int newInputSize; final int oldOutputSize; final int newOutputSize; - final int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31); - final int configCircuitAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 40); - final int wireAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 41); - final int disassemblerRemoveVersion = GT_Mod.calculateTotalGTVersion(509, 42, 44); + final int chemistryUpdateVersion = GTMod.calculateTotalGTVersion(509, 31); + final int configCircuitAdditionVersion = GTMod.calculateTotalGTVersion(509, 40); + final int wireAdditionVersion = GTMod.calculateTotalGTVersion(509, 41); + final int disassemblerRemoveVersion = GTMod.calculateTotalGTVersion(509, 42, 44); if (nbtVersion < 1000000) nbtVersion *= 1000; // 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT - if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine + if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof MTEBasicMachine && slotIndex >= 4) slotIndex += 1; if (mID >= 211 && mID <= 218) { // Assembler if (nbtVersion < chemistryUpdateVersion) { @@ -2415,10 +2414,10 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity } int indexShift = 0; - if (slotIndex >= GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT + oldInputSize) { + if (slotIndex >= MTEBasicMachine.OTHER_SLOT_COUNT + oldInputSize) { indexShift += newInputSize - oldInputSize; } - if (slotIndex >= GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT + oldInputSize + oldOutputSize) { + if (slotIndex >= MTEBasicMachine.OTHER_SLOT_COUNT + oldInputSize + oldOutputSize) { indexShift += newOutputSize - oldOutputSize; } return slotIndex + indexShift; diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java index c2cef8628d..7b18565165 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity; -import static gregtech.api.enums.GT_Values.NW; +import static gregtech.api.enums.GTValues.NW; import java.util.Arrays; import java.util.List; @@ -47,10 +47,10 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.enums.GTValues; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.modularui.IAddGregtechLogo; @@ -60,11 +60,11 @@ import gregtech.api.interfaces.tileentity.IGTEnet; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.interfaces.tileentity.IIC2Enet; -import gregtech.api.net.GT_Packet_Block_Event; -import gregtech.api.net.GT_Packet_SetConfigurationCircuit; +import gregtech.api.net.GTPacketBlockEvent; +import gregtech.api.net.GTPacketSetConfigurationCircuit; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; import gregtech.api.util.GT_TooltipDataCache; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; import gregtech.common.gui.modularui.uifactory.SelectItemUIFactory; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; @@ -103,7 +103,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje public static ForgeDirection getSideForPlayerPlacing(Entity player, ForgeDirection defaultFacing, boolean[] aAllowedFacings) { - final ForgeDirection facingFromPlayer = GT_Utility.getSideFromPlayerFacing(player); + final ForgeDirection facingFromPlayer = GTUtility.getSideFromPlayerFacing(player); if (facingFromPlayer != ForgeDirection.UNKNOWN && aAllowedFacings[facingFromPlayer.ordinal()]) return facingFromPlayer; @@ -424,13 +424,13 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public final boolean getOpacity(int x, int y, int z) { if (ignoreUnloadedChunks && crossedChunkBorder(x, z) && !worldObj.blockExists(x, y, z)) return false; - return GT_Utility.isOpaqueBlock(worldObj, x, y, z); + return GTUtility.isOpaqueBlock(worldObj, x, y, z); } @Override public final boolean getAir(int x, int y, int z) { if (ignoreUnloadedChunks && crossedChunkBorder(x, z) && !worldObj.blockExists(x, y, z)) return true; - return GT_Utility.isBlockAir(worldObj, x, y, z); + return GTUtility.isBlockAir(worldObj, x, y, z); } @Override @@ -540,7 +540,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje public final void sendBlockEvent(byte aID, byte aValue) { NW.sendPacketToAllPlayersInRange( worldObj, - new GT_Packet_Block_Event(xCoord, (short) yCoord, zCoord, aID, aValue), + new GTPacketBlockEvent(xCoord, (short) yCoord, zCoord, aID, aValue), xCoord, zCoord); } @@ -554,7 +554,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje } public final void setOnFire() { - GT_Utility.setCoordsOnFire(worldObj, xCoord, yCoord, zCoord, false); + GTUtility.setCoordsOnFire(worldObj, xCoord, yCoord, zCoord, false); } public final void setToFire() { @@ -666,7 +666,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje } protected void addTitleToUI(ModularWindow.Builder builder, String title) { - if (GT_Mod.gregtechproxy.mTitleTabStyle == 2) { + if (GTMod.gregtechproxy.mTitleTabStyle == 2) { addTitleItemIconStyle(builder, title); } else { addTitleTextStyle(builder, title); @@ -691,7 +691,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje final TextWidget text = new TextWidget(title).setDefaultColor(getTitleColor()) .setTextAlignment(Alignment.CenterLeft) .setMaxWidth(titleWidth); - if (GT_Mod.gregtechproxy.mTitleTabStyle == 1) { + if (GTMod.gregtechproxy.mTitleTabStyle == 1) { tab.setDrawable(getGUITextureSet().getTitleTabAngular()) .setPos(0, -(titleHeight + TAB_PADDING) + 1) .setSize(getGUIWidth(), titleHeight + TAB_PADDING * 2); @@ -852,9 +852,9 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje } } else { final List<ItemStack> tCircuits = ccs.getConfigurationCircuits(); - final int index = GT_Utility.findMatchingStackInList(tCircuits, cursorStack); + final int index = GTUtility.findMatchingStackInList(tCircuits, cursorStack); if (index < 0) { - int curIndex = GT_Utility + int curIndex = GTUtility .findMatchingStackInList(tCircuits, inv.getStackInSlot(ccs.getCircuitSlot())) + 1; if (clickData.mouseButton == 0) { curIndex += 1; @@ -894,7 +894,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje }) .disableShiftInsert() .setHandlePhantomActionClient(true) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setBackground(getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_INT_CIRCUIT) .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.select_circuit.tooltip")) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(ccs.getCircuitSlotX() - 1, ccs.getCircuitSlotY() - 1)); @@ -913,7 +913,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje getStackForm(0), this::onCircuitSelected, circuits, - GT_Utility.findMatchingStackInList(circuits, inv.getStackInSlot(ccs.getCircuitSlot()))) + GTUtility.findMatchingStackInList(circuits, inv.getStackInSlot(ccs.getCircuitSlot()))) .setAnotherWindow(true, dialogOpened) .setGuiTint(getGUIColorization()) .setCurrentGetter(() -> inv.getStackInSlot(ccs.getCircuitSlot())) @@ -926,7 +926,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje if (!(this instanceof IInventory inv)) return; - GT_Values.NW.sendToServer(new GT_Packet_SetConfigurationCircuit(this, selected)); + GTValues.NW.sendToServer(new GTPacketSetConfigurationCircuit(this, selected)); // we will not do any validation on client side // it doesn't get to actually decide what inventory contains anyway inv.setInventorySlotContents(ccs.getCircuitSlot(), selected); @@ -943,7 +943,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje protected Supplier<Integer> COLOR_TEXT_RED = () -> getTextColorOrDefault("text_red", 0xff0000); public int getGUIColorization() { - return GT_Util.getRGBaInt(Dyes.dyeWhite.getRGBA()); + return GTUtil.getRGBaInt(Dyes.dyeWhite.getRGBA()); } public ItemStack getStackForm(long aAmount) { diff --git a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java index c3528d44d7..3b0c9cc89f 100644 --- a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -16,8 +16,8 @@ import appeng.api.crafting.ICraftingIconProvider; import appeng.api.implementations.tiles.ISoundP2PHandler; import appeng.me.cache.helpers.TunnelCollection; import appeng.parts.p2p.PartP2PSound; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.IConfigurationCircuitSupport; @@ -27,9 +27,9 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.modularui.IBindPlayerInventoryUI; import gregtech.api.interfaces.modularui.IGetTitleColor; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtility; public abstract class CommonMetaTileEntity extends CoverableTileEntity implements IGregTechTileEntity, ICraftingIconProvider, ISoundP2PHandler { @@ -37,11 +37,11 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity protected boolean mNeedsBlockUpdate = true, mNeedsUpdate = true, mSendClientData = false, mInventoryChanged = false; protected boolean createNewMetatileEntity(short aID) { - if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) { - GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); + if (aID <= 0 || aID >= GregTechAPI.METATILEENTITIES.length || GregTechAPI.METATILEENTITIES[aID] == null) { + GTLog.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); } else { if (hasValidMetaTileEntity()) getMetaTileEntity().setBaseMetaTileEntity(null); - GregTech_API.METATILEENTITIES[aID].newMetaEntity(this) + GregTechAPI.METATILEENTITIES[aID].newMetaEntity(this) .setBaseMetaTileEntity(this); mTickTimer = 0; mID = aID; @@ -53,7 +53,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity protected void saveMetaTileNBT(NBTTagCompound aNBT) { try { if (hasValidMetaTileEntity()) { - aNBT.setInteger("nbtVersion", GT_Mod.NBT_VERSION); + aNBT.setInteger("nbtVersion", GTMod.NBT_VERSION); final NBTTagList tItemList = new NBTTagList(); for (int i = 0; i < getMetaTileEntity().getRealInventory().length; i++) { final ItemStack tStack = getMetaTileEntity().getRealInventory()[i]; @@ -70,12 +70,12 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity getMetaTileEntity().saveNBTData(aNBT); } catch (Throwable e) { GT_FML_LOGGER.error("Encountered CRITICAL ERROR while saving MetaTileEntity."); - GT_Mod.logStackTrace(e); + GTMod.logStackTrace(e); } } } catch (Throwable e) { GT_FML_LOGGER.error("Encountered CRITICAL ERROR while saving MetaTileEntity."); - GT_Mod.logStackTrace(e); + GTMod.logStackTrace(e); } } @@ -87,7 +87,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity final NBTTagCompound tTag = tItemList.getCompoundTagAt(i); final int tSlot = migrateInventoryIndex(tTag.getInteger("IntSlot"), nbtVersion); if (tSlot >= 0 && tSlot < getMetaTileEntity().getRealInventory().length) { - ItemStack loadedStack = GT_Utility.loadItem(tTag); + ItemStack loadedStack = GTUtility.loadItem(tTag); // We move away from fluid display item in TEs if (loadedStack != null && loadedStack.getItem() == ItemList.Display_Fluid.getItem()) { loadedStack = null; @@ -100,7 +100,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity getMetaTileEntity().loadNBTData(aNBT); } catch (Throwable e) { GT_FML_LOGGER.error("Encountered Exception while loading MetaTileEntity."); - GT_Mod.logStackTrace(e); + GTMod.logStackTrace(e); } } } @@ -175,7 +175,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { return hasValidMetaTileEntity() && getMetaTileEntity().allowCoverOnSide(side, aCoverID); } diff --git a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java index 429e0fc04c..bf62a1ce74 100644 --- a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java @@ -1,9 +1,9 @@ package gregtech.api.metatileentity; -import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.NW; -import static gregtech.api.util.GT_LanguageManager.FACES; -import static gregtech.api.util.GT_LanguageManager.getTranslation; +import static gregtech.api.enums.GTValues.E; +import static gregtech.api.enums.GTValues.NW; +import static gregtech.api.util.GTLanguageManager.FACES; +import static gregtech.api.util.GTLanguageManager.getTranslation; import java.util.ArrayList; import java.util.Arrays; @@ -48,23 +48,23 @@ import com.gtnewhorizons.modularui.common.widget.MultiChildWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregtechWailaProvider; -import gregtech.api.net.GT_Packet_RequestCoverData; -import gregtech.api.net.GT_Packet_SendCoverData; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; +import gregtech.api.net.GTPacketRequestCoverData; +import gregtech.api.net.GTPacketSendCoverData; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; import gregtech.api.util.ISerializableObject; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; +import gregtech.common.covers.CoverFluidfilter; import gregtech.common.covers.CoverInfo; -import gregtech.common.covers.GT_Cover_Fluidfilter; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -105,7 +105,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov .saveDataToNBT()); } if (tList.tagCount() > 0) { - aNBT.setTag(GT_Values.NBT.COVERS, tList); + aNBT.setTag(GTValues.NBT.COVERS, tList); // Backwards compat, in case of a revert... for now aNBT.setIntArray("mCoverSides", coverSides); } @@ -124,7 +124,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov : new byte[] { 15, 15, 15, 15, 15, 15 }; mStrongRedstone = aNBT.getByte("mStrongRedstone"); - if (aNBT.hasKey(GT_Values.NBT.COVERS)) { + if (aNBT.hasKey(GTValues.NBT.COVERS)) { readCoverInfoNBT(aNBT); } else if (aNBT.hasKey("mCoverSides")) { readLegacyCoverInfoNBT(aNBT); @@ -132,7 +132,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov } public void readCoverInfoNBT(NBTTagCompound aNBT) { - final NBTTagList tList = aNBT.getTagList(GT_Values.NBT.COVERS, 10); + final NBTTagList tList = aNBT.getTagList(GTValues.NBT.COVERS, 10); for (byte i = 0; i < tList.tagCount(); i++) { final NBTTagCompound tNBT = tList.getCompoundTagAt(i); final CoverInfo coverInfo = new CoverInfo(this, tNBT); @@ -152,12 +152,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov if (coverIDs[ordinalSide] == 0) continue; final CoverInfo coverInfo = new CoverInfo(side, coverIDs[ordinalSide], this, null); - final GT_CoverBehaviorBase<?> coverBehavior = coverInfo.getCoverBehavior(); - if (coverBehavior == GregTech_API.sNoBehavior) continue; + final CoverBehaviorBase<?> coverBehavior = coverInfo.getCoverBehavior(); + if (coverBehavior == GregTechAPI.sNoBehavior) continue; ISerializableObject coverData = null; if (hasOldCoverData) { - if (coverBehavior instanceof GT_Cover_Fluidfilter) { + if (coverBehavior instanceof CoverFluidfilter) { final String filterKey = String.format("fluidFilter%d", ordinalSide); if (aNBT.hasKey(filterKey)) { coverData = coverInfo.getCoverBehavior() @@ -229,12 +229,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov return true; } - public abstract boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID); + public abstract boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID); protected void checkDropCover() { for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { final int coverId = getCoverIDAtSide(side); - if (coverId != 0 && !allowCoverOnSide(side, new GT_ItemStack(coverId))) dropCover(side, side, true); + if (coverId != 0 && !allowCoverOnSide(side, new GTItemStack(coverId))) dropCover(side, side, true); } } @@ -256,20 +256,20 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov public final ITexture getCoverTexture(ForgeDirection side) { final CoverInfo coverInfo = getCoverInfoAtSide(side); if (!coverInfo.isValid()) return null; - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) { + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x1) != 0) { return Textures.BlockIcons.HIDDEN_TEXTURE[0]; // See through } final ITexture coverTexture = (!(this instanceof BaseMetaPipeEntity)) ? coverInfo.getSpecialCoverFGTexture() : coverInfo.getSpecialCoverTexture(); - return coverTexture != null ? coverTexture : GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(side))); + return coverTexture != null ? coverTexture : GregTechAPI.sCovers.get(new GTItemStack(getCoverIDAtSide(side))); } protected void requestCoverDataIfNeeded() { if (worldObj == null || !worldObj.isRemote) return; for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { final CoverInfo coverInfo = getCoverInfoAtSide(side); - if (coverInfo.isDataNeededOnClient()) NW.sendToServer(new GT_Packet_RequestCoverData(coverInfo, this)); + if (coverInfo.isDataNeededOnClient()) NW.sendToServer(new GTPacketRequestCoverData(coverInfo, this)); } } @@ -318,15 +318,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override @Deprecated - public GT_CoverBehavior getCoverBehaviorAtSide(ForgeDirection side) { - final GT_CoverBehaviorBase<?> behavior = getCoverInfoAtSide(side).getCoverBehavior(); - if (behavior instanceof GT_CoverBehavior) return (GT_CoverBehavior) behavior; - return GregTech_API.sNoBehavior; + public CoverBehavior getCoverBehaviorAtSide(ForgeDirection side) { + final CoverBehaviorBase<?> behavior = getCoverInfoAtSide(side).getCoverBehavior(); + if (behavior instanceof CoverBehavior) return (CoverBehavior) behavior; + return GregTechAPI.sNoBehavior; } @Override public void setCoverItemAtSide(ForgeDirection side, ItemStack aCover) { - GregTech_API.getCoverBehaviorNew(aCover) + GregTechAPI.getCoverBehaviorNew(aCover) .placeCover(side, aCover, this); } @@ -366,7 +366,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov } @Override - public GT_CoverBehaviorBase<?> getCoverBehaviorAtSideNew(ForgeDirection side) { + public CoverBehaviorBase<?> getCoverBehaviorAtSideNew(ForgeDirection side) { return getCoverInfoAtSide(side).getCoverBehavior(); } @@ -546,11 +546,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { final CoverInfo coverInfo = getCoverInfoAtSide(side); if (coverInfo.needsUpdate()) { - NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_SendCoverData(coverInfo, this), - xCoord, - zCoord); + NW.sendPacketToAllPlayersInRange(worldObj, new GTPacketSendCoverData(coverInfo, this), xCoord, zCoord); coverInfo.setNeedsUpdate(false); } } @@ -562,11 +558,11 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final NBTTagCompound tag = accessor.getNBTData(); final ForgeDirection currentFacing = accessor.getSide(); - final NBTTagList tList = tag.getTagList(GT_Values.NBT.COVERS, 10); + final NBTTagList tList = tag.getTagList(GTValues.NBT.COVERS, 10); for (byte i = 0; i < tList.tagCount(); i++) { final NBTTagCompound tNBT = tList.getCompoundTagAt(i); final CoverInfo coverInfo = new CoverInfo(this, tNBT); - if (!coverInfo.isValid() || coverInfo.getCoverBehavior() == GregTech_API.sNoBehavior) continue; + if (!coverInfo.isValid() || coverInfo.getCoverBehavior() == GregTechAPI.sNoBehavior) continue; final ItemStack coverStack = coverInfo.getDisplayStack(); if (coverStack != null) { @@ -608,12 +604,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov */ public static void addInstalledCoversInformation(NBTTagCompound aNBT, List<String> aList) { if (aNBT == null || aList == null) return; - final NBTTagList tList = aNBT.getTagList(GT_Values.NBT.COVERS, 10); + final NBTTagList tList = aNBT.getTagList(GTValues.NBT.COVERS, 10); for (byte i = 0; i < tList.tagCount(); i++) { final NBTTagCompound tNBT = tList.getCompoundTagAt(i); final CoverInfo coverInfo = new CoverInfo(null, tNBT); - if (!coverInfo.isValid() || coverInfo.getCoverBehavior() == GregTech_API.sNoBehavior) continue; + if (!coverInfo.isValid() || coverInfo.getCoverBehavior() == GregTechAPI.sNoBehavior) continue; final ItemStack coverStack = coverInfo.getDisplayStack(); if (coverStack != null) { @@ -634,8 +630,8 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final int i = tSide.ordinal(); final int coverId = mCoverSides[i]; if (coverId == 0) continue; - final GT_CoverBehaviorBase<?> behavior = GregTech_API.getCoverBehaviorNew(coverId); - if (behavior == null || behavior == GregTech_API.sNoBehavior) continue; + final CoverBehaviorBase<?> behavior = GregTechAPI.getCoverBehaviorNew(coverId); + if (behavior == null || behavior == GregTechAPI.sNoBehavior) continue; if (!aNBT.hasKey(CoverableTileEntity.COVER_DATA_NBT_KEYS[i])) continue; final ISerializableObject dataObject = behavior .createDataObject(aNBT.getTag(CoverableTileEntity.COVER_DATA_NBT_KEYS[i])); @@ -676,12 +672,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov public void addCoverTabs(ModularWindow.Builder builder, UIBuildContext buildContext) { final int COVER_TAB_LEFT = -16, COVER_TAB_TOP = 1, COVER_TAB_HEIGHT = 20, COVER_TAB_WIDTH = 18, COVER_TAB_SPACING = 2, ICON_SIZE = 16; - final boolean flipHorizontally = GT_Mod.gregtechproxy.mCoverTabsFlipped; + final boolean flipHorizontally = GTMod.gregtechproxy.mCoverTabsFlipped; final Column columnWidget = new Column(); builder.widget(columnWidget); final int xPos = flipHorizontally ? (getGUIWidth() - COVER_TAB_LEFT - COVER_TAB_WIDTH) : COVER_TAB_LEFT; - if (GT_Mod.gregtechproxy.mCoverTabsVisible) { + if (GTMod.gregtechproxy.mCoverTabsVisible) { columnWidget.setPos(xPos, COVER_TAB_TOP) .setEnabled( widget -> ((Column) widget).getChildren() diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index 8971db2d92..194aef8547 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity; -import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GTValues.GT; import java.io.File; import java.util.ArrayList; @@ -30,9 +30,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IConnectable; @@ -40,15 +40,15 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IColoredTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import gregtech.common.covers.CoverInfo; /** @@ -107,10 +107,10 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount, boolean aAddInfo) { - if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) + if (GregTechAPI.sPostloadStarted || !GregTechAPI.sPreloadStarted) throw new IllegalAccessError("This Constructor has to be called in the load Phase"); - if (GregTech_API.METATILEENTITIES[aID] == null) { - GregTech_API.METATILEENTITIES[aID] = this; + if (GregTechAPI.METATILEENTITIES[aID] == null) { + GregTechAPI.METATILEENTITIES[aID] = this; } else { throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } @@ -118,7 +118,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { .toLowerCase(Locale.ENGLISH); setBaseMetaTileEntity(new BaseMetaPipeEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); - GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); + GTLanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); mInventory = new ItemStack[aInvSlotCount]; if (aAddInfo && GT.isClientSide()) { @@ -129,7 +129,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { protected final void addInfo(int aID) { if (!GT.isClientSide()) return; - ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID); + ItemStack tStack = new ItemStack(GregTechAPI.sBlockMachines, 1, aID); Objects.requireNonNull(tStack.getItem()) .addInformation(tStack, null, new ArrayList<>(), true); } @@ -187,7 +187,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public ItemStack getStackForm(long aAmount) { - return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID()); + return new ItemStack(GregTechAPI.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID()); } public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) { @@ -254,7 +254,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { return true; } @@ -322,7 +322,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { + if (aBaseMetaTileEntity.isClientSide() && GTClient.changeDetected == 4) { /* * Client tick counter that is set to 5 on hiding pipes and covers. It triggers a texture update next client * tick when reaching 4, with provision for 3 more update tasks, spreading client change detection related @@ -598,8 +598,8 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public String getInventoryName() { - if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) - return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); + if (GregTechAPI.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) + return GregTechAPI.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); return ""; } @@ -615,7 +615,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public ItemStack decrStackSize(int aIndex, int aAmount) { - ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copyOrNull(tStack); + ItemStack tStack = getStackInSlot(aIndex), rStack = GTUtility.copyOrNull(tStack); if (tStack != null) { if (tStack.stackSize <= aAmount) { if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0; @@ -647,7 +647,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { public boolean canInsertItem(int slotIndex, ItemStack itemStack, int ordinalSide) { return isValidSlot(slotIndex) && itemStack != null && slotIndex < mInventory.length - && (mInventory[slotIndex] == null || GT_Utility.areStacksEqual(itemStack, mInventory[slotIndex])) + && (mInventory[slotIndex] == null || GTUtility.areStacksEqual(itemStack, mInventory[slotIndex])) && allowPutStack(getBaseMetaTileEntity(), slotIndex, ForgeDirection.getOrientation(ordinalSide), itemStack); } @@ -796,12 +796,12 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public void doExplosion(long aExplosionPower) { - float tStrength = GT_Values.getExplosionPowerForVoltage(aExplosionPower); + float tStrength = GTValues.getExplosionPowerForVoltage(aExplosionPower); int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord(); World tWorld = getBaseMetaTileEntity().getWorld(); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) { + if (GregTechAPI.sMachineExplosions) { new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setStrength(tStrength) .setSmoking(true) .setPosition(tX + 0.5, tY + 0.5, tZ + 0.5) @@ -949,7 +949,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { return (mConnections & sideDirection.flag) != 0; } - public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsIn(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } @@ -958,7 +958,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { return false; } - public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsOut(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } @@ -967,12 +967,12 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { return false; } - public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsIn(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; } - public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsOut(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; } @@ -1000,13 +1000,13 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public int getGUIColorization() { Dyes dye = Dyes.dyeWhite; - if (GregTech_API.sColoredGUI) { - if (GregTech_API.sMachineMetalGUI) { + if (GregTechAPI.sColoredGUI) { + if (GregTechAPI.sMachineMetalGUI) { dye = Dyes.MACHINE_METAL; } else if (getBaseMetaTileEntity() != null) { dye = Dyes.getDyeFromIndex(getBaseMetaTileEntity().getColorization()); } } - return GT_Util.getRGBInt(dye.getRGBA()); + return GTUtil.getRGBInt(dye.getRGBA()); } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index d4f8aa6ba4..1008a64507 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -38,27 +38,27 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.SoundResource; import gregtech.api.enums.SteamVariant; -import gregtech.api.gui.GT_GUIColorOverride; +import gregtech.api.gui.GUIColorOverride; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.ICleanroom; import gregtech.api.interfaces.ICleanroomReceiver; import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.metatileentity.implementations.MTECable; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; import gregtech.api.util.GT_TooltipDataCache; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import gregtech.common.covers.CoverInfo; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -90,7 +90,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei */ public final ItemStackHandler inventoryHandler; - protected GT_GUIColorOverride colorOverride; + protected GUIColorOverride colorOverride; protected GT_TooltipDataCache mTooltipCache = new GT_TooltipDataCache(); @Override @@ -128,18 +128,18 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei * @param aID the machine ID */ public MetaTileEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { - if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) + if (GregTechAPI.sPostloadStarted || !GregTechAPI.sPreloadStarted) throw new IllegalAccessError("This Constructor has to be called in the load Phase"); - if (GregTech_API.METATILEENTITIES[aID] == null) { - GregTech_API.METATILEENTITIES[aID] = this; + if (GregTechAPI.METATILEENTITIES[aID] == null) { + GregTechAPI.METATILEENTITIES[aID] = this; } else { throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } mName = aBasicName.replace(" ", "_") .toLowerCase(Locale.ENGLISH); - setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity()); + setBaseMetaTileEntity(GregTechAPI.constructBaseMetaTileEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); - GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); + GTLanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); mInventory = new ItemStack[aInvSlotCount]; inventoryHandler = new ItemStackHandler(mInventory); } @@ -151,7 +151,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei mInventory = new ItemStack[aInvSlotCount]; mName = aName; inventoryHandler = new ItemStackHandler(mInventory); - colorOverride = GT_GUIColorOverride.get(getGUITextureSet().getMainBackground().location); + colorOverride = GUIColorOverride.get(getGUITextureSet().getMainBackground().location); } @Override @@ -179,12 +179,12 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public ItemStack getStackForm(long aAmount) { - return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID()); + return new ItemStack(GregTechAPI.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID()); } @Override public String getLocalName() { - return GT_LanguageManager.getTranslation("gt.blockmachines." + mName + ".name"); + return GTLanguageManager.getTranslation("gt.blockmachines." + mName + ".name"); } @Override @@ -219,7 +219,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aStack) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { return true; } @@ -254,8 +254,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei if (!aPlayer.isSneaking()) return false; final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); final TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); - if ((tTileEntity instanceof IGregTechTileEntity gtTE) - && (gtTE.getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { + if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { // The tile entity we're facing is a cable, let's try to connect to it return gtTE.getMetaTileEntity() @@ -276,8 +275,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei if (!aPlayer.isSneaking()) return false; final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); - if ((tTileEntity instanceof IGregTechTileEntity gtTE) - && (gtTE.getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { + if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { // The tile entity we're facing is a cable, let's try to connect to it return gtTE.getMetaTileEntity() @@ -311,7 +309,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public void onExplosion() { - GT_Log.exp.println( + GTLog.exp.println( "Machine at " + this.getBaseMetaTileEntity() .getXCoord() + " | " @@ -338,7 +336,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { + if (aBaseMetaTileEntity.isClientSide() && GTClient.changeDetected == 4) { /* * Client tick counter that is set to 5 on hiding pipes and covers. It triggers a texture update next client * tick when reaching 4, with provision for 3 more update tasks, spreading client change detection related @@ -633,14 +631,14 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei * Determines the Tier of the Machine, used for de-charging Tools. */ public long getInputTier() { - return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage()); + return GTUtility.getTier(getBaseMetaTileEntity().getInputVoltage()); } /** * Determines the Tier of the Machine, used for charging Tools. */ public long getOutputTier() { - return GT_Utility.getTier(getBaseMetaTileEntity().getOutputVoltage()); + return GTUtility.getTier(getBaseMetaTileEntity().getOutputVoltage()); } /** @@ -888,7 +886,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei markDirty(); if (this instanceof IConfigurationCircuitSupport ccs) { if (ccs.allowSelectCircuit() && aIndex == ccs.getCircuitSlot() && aStack != null) { - mInventory[aIndex] = GT_Utility.copyAmount(0, aStack); + mInventory[aIndex] = GTUtility.copyAmount(0, aStack); return; } } @@ -897,8 +895,8 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public String getInventoryName() { - if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) - return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); + if (GregTechAPI.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) + return GregTechAPI.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); return ""; } @@ -914,7 +912,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public ItemStack decrStackSize(int aIndex, int aAmount) { - ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copyOrNull(tStack); + ItemStack tStack = getStackInSlot(aIndex), rStack = GTUtility.copyOrNull(tStack); if (tStack != null) { if (tStack.stackSize <= aAmount) { if (setStackToZeroInsteadOfNull(aIndex)) { @@ -949,7 +947,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei public boolean canInsertItem(int aIndex, ItemStack aStack, int ordinalSide) { return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length - && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) + && (mInventory[aIndex] == null || GTUtility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, ForgeDirection.getOrientation(ordinalSide), aStack); } @@ -986,7 +984,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public int fill(ForgeDirection side, FluidStack aFluid, boolean doFill) { - if (getBaseMetaTileEntity().hasSteamEngineUpgrade() && GT_ModHandler.isSteam(aFluid) && aFluid.amount > 1) { + if (getBaseMetaTileEntity().hasSteamEngineUpgrade() && GTModHandler.isSteam(aFluid) && aFluid.amount > 1) { int tSteam = (int) Math.min( Integer.MAX_VALUE, Math.min( @@ -1114,15 +1112,14 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei @Override public void doExplosion(long aExplosionPower) { - float tStrength = GT_Values.getExplosionPowerForVoltage(aExplosionPower); + float tStrength = GTValues.getExplosionPowerForVoltage(aExplosionPower); final int tX = getBaseMetaTileEntity().getXCoord(); final int tY = getBaseMetaTileEntity().getYCoord(); final int tZ = getBaseMetaTileEntity().getZCoord(); final World tWorld = getBaseMetaTileEntity().getWorld(); - GT_Utility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ); + GTUtility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) - tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + if (GregTechAPI.sMachineExplosions) tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } @Override @@ -1266,16 +1263,16 @@ public abstract class MetaTileEntity implements IMetaTileEntity, ICleanroomRecei if (this.colorOverride.sLoaded()) { if (this.colorOverride.sGuiTintingEnabled() && getBaseMetaTileEntity() != null) { dye = Dyes.getDyeFromIndex(getBaseMetaTileEntity().getColorization()); - return this.colorOverride.getGuiTintOrDefault(dye.mName, GT_Util.getRGBInt(dye.getRGBA())); + return this.colorOverride.getGuiTintOrDefault(dye.mName, GTUtil.getRGBInt(dye.getRGBA())); } - } else if (GregTech_API.sColoredGUI) { - if (GregTech_API.sMachineMetalGUI) { + } else if (GregTechAPI.sColoredGUI) { + if (GregTechAPI.sMachineMetalGUI) { dye = Dyes.MACHINE_METAL; } else if (getBaseMetaTileEntity() != null) { dye = Dyes.getDyeFromIndex(getBaseMetaTileEntity().getColorization()); } } - return GT_Util.getRGBInt(dye.getRGBA()); + return GTUtil.getRGBInt(dye.getRGBA()); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java index 6fecb840b4..a793dbbe34 100644 --- a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java +++ b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java @@ -9,21 +9,21 @@ import gregtech.api.interfaces.metatileentity.IConnectable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.api.util.GT_Utility; +import gregtech.api.metatileentity.implementations.MTECable; +import gregtech.api.util.GTUtility; import ic2.api.energy.tile.IEnergySink; public class TileIC2EnergySink extends TileEntity implements IEnergySink { private final IGregTechTileEntity myMeta; - private GT_MetaPipeEntity_Cable cableMeta = null; + private MTECable cableMeta = null; public TileIC2EnergySink(IGregTechTileEntity meta) { if (meta == null) throw new NullPointerException("no null metas"); myMeta = meta; final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); if (metaTile instanceof IMetaTileEntityCable) { - cableMeta = (GT_MetaPipeEntity_Cable) metaTile; + cableMeta = (MTECable) metaTile; } setWorldObj(meta.getWorld()); xCoord = meta.getXCoord(); @@ -62,7 +62,7 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink { */ @Override public int getSinkTier() { - return GT_Utility.getTier(cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage()); + return GTUtility.getTier(cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage()); } /** diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicBatteryBuffer.java index cff63caeb5..7ca8cce273 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicBatteryBuffer.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import java.util.List; @@ -20,14 +20,14 @@ import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_MetaBase_Item; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.items.MetaBaseItem; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; import ic2.api.item.IElectricItem; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -38,8 +38,7 @@ import mcp.mobius.waila.api.IWailaDataAccessor; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_TieredMachineBlock - implements IAddUIWidgets { +public class MTEBasicBatteryBuffer extends MTETieredMachineBlock implements IAddUIWidgets { public boolean mCharge = false, mDecharge = false; public int mBatteryCount = 0, mChargeableCount = 0; @@ -47,18 +46,18 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier private long mStored = 0; private long mMax = 0; - public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier, - String aDescription, int aSlotCount) { + public MTEBasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, + int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + public MTEBasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, int aSlotCount) { + public MTEBasicBatteryBuffer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, + int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @@ -91,7 +90,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicBatteryBuffer(mName, mTier, mDescriptionArray, mTextures, mInventory.length); + return new MTEBasicBatteryBuffer(mName, mTier, mDescriptionArray, mTextures, mInventory.length); } @Override @@ -216,7 +215,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -227,8 +226,8 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; mBatteryCount = 0; mChargeableCount = 0; - for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) { - if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++; + for (ItemStack tStack : mInventory) if (GTModHandler.isElectricItem(tStack, mTier)) { + if (GTModHandler.isChargerItem(tStack)) mBatteryCount++; mChargeableCount++; } } @@ -238,7 +237,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { - if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName() + if (GTModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName() .startsWith("gt.metaitem.01.")) { String name = aStack.getUnlocalizedName(); if (name.equals("gt.metaitem.01.32510") || name.equals("gt.metaitem.01.32511") @@ -255,10 +254,10 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { - if (!GT_Utility.isStackValid(aStack)) { + if (!GTUtility.isStackValid(aStack)) { return false; } - return mInventory[aIndex] == null && GT_ModHandler.isElectricItem(aStack, this.mTier); + return mInventory[aIndex] == null && GTModHandler.isElectricItem(aStack, this.mTier); } @Override @@ -274,16 +273,16 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier long tStep = 0; if (mInventory != null) { for (ItemStack aStack : mInventory) { - if (GT_ModHandler.isElectricItem(aStack)) { + if (GTModHandler.isElectricItem(aStack)) { - if (aStack.getItem() instanceof GT_MetaBase_Item) { - Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); + if (aStack.getItem() instanceof MetaBaseItem) { + Long[] stats = ((MetaBaseItem) aStack.getItem()).getElectricStats(aStack); if (stats != null) { if (stats[0] > Long.MAX_VALUE / 2) { scaleOverflow = true; } tScale = tScale + stats[0]; - tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); + tStep = ((MetaBaseItem) aStack.getItem()).getRealCharge(aStack); if (tStep > Long.MAX_VALUE / 2) { storedOverflow = true; } @@ -310,15 +309,15 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier updateStorageInfo(); return new String[] { EnumChatFormatting.BLUE + getLocalName() + EnumChatFormatting.RESET, "Stored Items:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mStored) + EnumChatFormatting.GREEN + GTUtility.formatNumbers(mStored) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMax) + + GTUtility.formatNumbers(mMax) + EnumChatFormatting.RESET + " EU", - "Average input:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t", - "Average output:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" }; + "Average input:", GTUtility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t", + "Average output:", GTUtility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" }; } private void updateStorageInfo() { @@ -337,22 +336,22 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.stored", - GT_Utility.formatNumbers(tag.getLong("mStored")), - GT_Utility.formatNumbers(tag.getLong("mMax")))); + GTUtility.formatNumbers(tag.getLong("mStored")), + GTUtility.formatNumbers(tag.getLong("mMax")))); long avgIn = tag.getLong("AvgIn"); long avgOut = tag.getLong("AvgOut"); currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.avg_in_with_amperage", - GT_Utility.formatNumbers(avgIn), - GT_Utility.getAmperageForTier(avgIn, (byte) getInputTier()), - GT_Utility.getColoredTierNameFromTier((byte) getInputTier()))); + GTUtility.formatNumbers(avgIn), + GTUtility.getAmperageForTier(avgIn, (byte) getInputTier()), + GTUtility.getColoredTierNameFromTier((byte) getInputTier()))); currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.avg_out_with_amperage", - GT_Utility.formatNumbers(avgOut), - GT_Utility.getAmperageForTier(avgOut, (byte) getOutputTier()), - GT_Utility.getColoredTierNameFromTier((byte) getOutputTier()))); + GTUtility.formatNumbers(avgOut), + GTUtility.getAmperageForTier(avgOut, (byte) getOutputTier()), + GTUtility.getColoredTierNameFromTier((byte) getOutputTier()))); super.getWailaBody(itemStack, currenttip, accessor, config); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java index 7a968afc4b..ac923bc699 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -12,36 +12,35 @@ import net.minecraftforge.fluids.IFluidHandler; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.RecipeMapWorkable; import gregtech.api.objects.ItemData; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.maps.FuelBackend; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Pollution; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; +import gregtech.common.Pollution; -public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity_BasicTank - implements RecipeMapWorkable { +public abstract class MTEBasicGenerator extends MTEBasicTank implements RecipeMapWorkable { - public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, + public MTEBasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, ITexture... aTextures) { + public MTEBasicGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_BasicGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEBasicGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_BasicGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEBasicGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -81,7 +80,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -219,7 +218,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { // divided by two because this is called every 10 ticks, not 20 - GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); + Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -227,7 +226,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) - && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null) + && ((GTUtility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null) || solidFuelOverride(mInventory[getInputSlot()]))) { long tFuelValue = getFuelValue(mInventory[getInputSlot()]); if (tFuelValue <= 0) tFuelValue = getFuelValue(mInventory[getInputSlot()], true); @@ -238,7 +237,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); // divided by two because this is called every 10 ticks, not 20 - GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); + Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); } } } @@ -255,11 +254,11 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity */ public boolean solidFuelOverride(ItemStack stack) { // this could be used for a coal generator for example aswell... - ItemData association = GT_OreDictUnificator.getAssociation(stack); + ItemData association = GTOreDictUnificator.getAssociation(stack); // if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK or any type of cell, else do vanilla checks if (association != null) { return !OrePrefixes.CELL_TYPES.contains(association.mPrefix) - && !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true); + && !GTUtility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true); } else { return stack != null && // when the stack is null its not a solid stack.getItem() != null && // when the item in the stack is null its not a solid @@ -293,7 +292,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity public long getFuelValue(FluidStack aLiquid, boolean aLong) { RecipeMap<?> tRecipes = getRecipeMap(); if (aLiquid == null || !(tRecipes.getBackend() instanceof FuelBackend tFuels)) return 0; - GT_Recipe tFuel = tFuels.findFuel(aLiquid); + GTRecipe tFuel = tFuels.findFuel(aLiquid); if (tFuel == null) return 0; return (long) tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(aLiquid) / 100; @@ -305,8 +304,8 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity } public long getFuelValue(ItemStack aStack, boolean aLong) { - if (GT_Utility.isStackInvalid(aStack) || getRecipeMap() == null) return 0; - GT_Recipe tFuel = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + if (GTUtility.isStackInvalid(aStack) || getRecipeMap() == null) return 0; + GTRecipe tFuel = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); if (tFuel == null) return 0; long liters = 10L; // 1000mb/100 @@ -314,17 +313,17 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity } public ItemStack getEmptyContainer(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack) || getRecipeMap() == null) return null; - GT_Recipe tFuel = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); - if (tFuel != null) return GT_Utility.copyOrNull(tFuel.getOutput(0)); - return GT_Utility.getContainerItem(aStack, true); + if (GTUtility.isStackInvalid(aStack) || getRecipeMap() == null) return null; + GTRecipe tFuel = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + if (tFuel != null) return GTUtility.copyOrNull(tFuel.getOutput(0)); + return GTUtility.getContainerItem(aStack, true); } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { return super.allowPutStack(aBaseMetaTileEntity, aIndex, side, aStack) && (getFuelValue(aStack, true) > 0 - || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true), true) > 0); + || getFuelValue(GTUtility.getFluidForFilledItem(aStack, true), true) > 0); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicHull.java index e5766eee39..35b6003c24 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicHull.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,31 +11,29 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank { +public class MTEBasicHull extends MTEBasicTank { - public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription, + public MTEBasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 1, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription, ITexture... aTextures) { + public MTEBasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTEBasicHull(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEBasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicHull(mName, mTier, mInventory.length, mDescriptionArray, mTextures); + return new MTEBasicHull(mName, mTier, mInventory.length, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicHullNonElectric.java index b6584b50ab..ec01af0408 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicHullNonElectric.java @@ -5,20 +5,17 @@ import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public abstract class GT_MetaTileEntity_BasicHull_NonElectric extends GT_MetaTileEntity_BasicHull { +public abstract class MTEBasicHullNonElectric extends MTEBasicHull { - public GT_MetaTileEntity_BasicHull_NonElectric(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + public MTEBasicHullNonElectric(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + public MTEBasicHullNonElectric(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); } - public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + public MTEBasicHullNonElectric(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java index 377646f85a..25dfb9b58b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java @@ -1,7 +1,7 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.enums.GTValues.debugCleanroom; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; import static gregtech.api.metatileentity.BaseTileEntity.FLUID_TRANSFER_TOOLTIP; @@ -14,9 +14,9 @@ import static gregtech.api.metatileentity.BaseTileEntity.STALLED_STUTTERING_TOOL import static gregtech.api.metatileentity.BaseTileEntity.STALLED_VENT_TOOLTIP; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.metatileentity.BaseTileEntity.UNUSED_SLOT_TOOLTIP; -import static gregtech.api.util.GT_RecipeConstants.EXPLODE; -import static gregtech.api.util.GT_RecipeConstants.ON_FIRE; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; +import static gregtech.api.util.GTRecipeConstants.EXPLODE; +import static gregtech.api.util.GTRecipeConstants.ON_FIRE; +import static gregtech.api.util.GTUtility.moveMultipleItemStacks; import static net.minecraftforge.common.util.ForgeDirection.DOWN; import static net.minecraftforge.common.util.ForgeDirection.UNKNOWN; import static net.minecraftforge.common.util.ForgeDirection.UP; @@ -56,11 +56,11 @@ import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.SoundResource; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.gui.modularui.SteamTexture; import gregtech.api.interfaces.ICleanroom; import gregtech.api.interfaces.IConfigurationCircuitSupport; @@ -70,21 +70,21 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IOverclockDescriptionProvider; import gregtech.api.interfaces.tileentity.RecipeMapWorkable; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.overclockdescriber.EUOverclockDescriber; import gregtech.api.objects.overclockdescriber.OverclockDescriber; import gregtech.api.recipe.BasicUIProperties; import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_ClientPreference; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTClientPreference; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; +import gregtech.api.util.GTWaila; import gregtech.api.util.GT_TooltipDataCache; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Waila; +import gregtech.api.util.OverclockCalculator; import gregtech.common.gui.modularui.UIHelper; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -95,8 +95,8 @@ import mcp.mobius.waila.api.IWailaDataAccessor; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank implements RecipeMapWorkable, - IConfigurationCircuitSupport, IOverclockDescriptionProvider, IAddGregtechLogo, IAddUIWidgets { +public abstract class MTEBasicMachine extends MTEBasicTank implements RecipeMapWorkable, IConfigurationCircuitSupport, + IOverclockDescriptionProvider, IAddGregtechLogo, IAddUIWidgets { /** * return values for checkRecipe() @@ -120,7 +120,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have * been buffered */ - protected GT_Recipe mLastRecipe = null; + protected GTRecipe mLastRecipe = null; private FluidStack mFluidOut; protected final FluidStackTank fluidOutputTank = new FluidStackTank( @@ -138,8 +138,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * TopFacingPipeActive 11 = TopFacingPipeInactive 12 = SideFacingPipeActive 13 = * SideFacingPipeInactive */ - public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, - String aDescription, int aInputSlotCount, int aOutputSlotCount, ITexture... aOverlays) { + public MTEBasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, + int aInputSlotCount, int aOutputSlotCount, ITexture... aOverlays) { super( aID, aName, @@ -157,8 +157,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B /** * Registers machine with multi-line descriptions. */ - public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, - String[] aDescription, int aInputSlotCount, int aOutputSlotCount, ITexture... aOverlays) { + public MTEBasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String[] aDescription, + int aInputSlotCount, int aOutputSlotCount, ITexture... aOverlays) { super( aID, aName, @@ -176,8 +176,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B /** * For {@link #newMetaEntity}. */ - public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, - ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount) { + public MTEBasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, + int aInputSlotCount, int aOutputSlotCount) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -494,17 +494,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - if (!GT_Mod.gregtechproxy.mForceFreeFace) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + if (!GTMod.gregtechproxy.mForceFreeFace) { + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { if (aBaseMetaTileEntity.getAirAtSide(side)) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } } - GT_Utility.sendChatToPlayer(aPlayer, "No free Side!"); + GTUtility.sendChatToPlayer(aPlayer, "No free Side!"); return true; } @@ -512,7 +512,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public void initDefaultModes(NBTTagCompound aNBT) { mMainFacing = ForgeDirection.UNKNOWN; if (!getBaseMetaTileEntity().getWorld().isRemote) { - final GT_ClientPreference tPreference = GT_Mod.gregtechproxy + final GTClientPreference tPreference = GTMod.gregtechproxy .getClientPreference(getBaseMetaTileEntity().getOwnerUuid()); if (tPreference != null) { mDisableFilter = !tPreference.isSingleBlockInitialFilterEnabled(); @@ -538,7 +538,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound())); for (int i = 0; i < mOutputItems.length; i++) - if (mOutputItems[i] != null) GT_Utility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]); + if (mOutputItems[i] != null) GTUtility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]); } @Override @@ -557,7 +557,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid")); mFluidOut = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluidOut")); - for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GTUtility.loadItem(aNBT, "mOutputItem" + i); } @Override @@ -663,14 +663,14 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; for (int i = 0; i < mOutputItems.length; i++) { - mOutputItems[i] = GT_Utility.copyOrNull(mOutputItems[i]); + mOutputItems[i] = GTUtility.copyOrNull(mOutputItems[i]); if (mOutputItems[i] != null && mOutputItems[i].stackSize > 64) mOutputItems[i].stackSize = 64; - mOutputItems[i] = GT_OreDictUnificator.get(true, mOutputItems[i]); + mOutputItems[i] = GTOreDictUnificator.get(true, mOutputItems[i]); } if (mFluid != null && mFluid.amount <= 0) mFluid = null; mMaxProgresstime = Math.max(1, mMaxProgresstime); - if (GT_Utility.isDebugItem(mInventory[dechargerSlotStartIndex()])) { + if (GTUtility.isDebugItem(mInventory[dechargerSlotStartIndex()])) { mEUt = mMaxProgresstime = 1; } startProcess(); @@ -717,9 +717,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B /** * Calculates overclock based on {@link #overclockDescriber}. */ - protected void calculateCustomOverclock(GT_Recipe recipe) { - GT_OverclockCalculator calculator = overclockDescriber.createCalculator( - new GT_OverclockCalculator().setRecipeEUt(recipe.mEUt) + protected void calculateCustomOverclock(GTRecipe recipe) { + OverclockCalculator calculator = overclockDescriber.createCalculator( + new OverclockCalculator().setRecipeEUt(recipe.mEUt) .setDuration(recipe.mDuration) .setOneTickDiscount(true), recipe); @@ -732,7 +732,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * Helper method for calculating simple overclock. */ protected void calculateOverclockedNess(int eut, int duration) { - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(eut) + OverclockCalculator calculator = new OverclockCalculator().setRecipeEUt(eut) .setEUt(V[mTier] * mAmperage) .setDuration(duration) .setOneTickDiscount(true) @@ -755,7 +755,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return rOutputs; } - protected boolean canOutput(GT_Recipe aRecipe) { + protected boolean canOutput(GTRecipe aRecipe) { return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); } @@ -765,7 +765,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B ItemStack[] tOutputSlots = getAllOutputs(); for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++) if (tOutputSlots[i] != null && aOutputs[i] != null - && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) + && (!GTUtility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { mOutputBlocked++; return false; @@ -814,7 +814,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { super.doSound(aIndex, aX, aY, aZ); - if (aIndex == 8) GT_Utility.doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); + if (aIndex == 8) GTUtility.doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } public boolean doesAutoOutput() { @@ -875,27 +875,27 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public String[] getInfoData() { return new String[] { "Progress:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mProgresstime / 20)) + EnumChatFormatting.GREEN + GTUtility.formatNumbers((mProgresstime / 20)) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + GTUtility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", "Stored Energy:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.GREEN + GTUtility.formatNumbers(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getBaseMetaTileEntity().getEUCapacity()) + + GTUtility.formatNumbers(getBaseMetaTileEntity().getEUCapacity()) + EnumChatFormatting.RESET + " EU", "Probably uses: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mEUt) + + GTUtility.formatNumbers(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mEUt == 0 ? 0 : mAmperage) + + GTUtility.formatNumbers(mEUt == 0 ? 0 : mAmperage) + EnumChatFormatting.RESET + " A" }; } @@ -910,15 +910,15 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) { if (aPlayer.isSneaking()) { mDisableFilter = !mDisableFilter; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter)); } else { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - mAllowInputFromOutputSide ? GT_Utility.trans("095", "Input from Output Side allowed") - : GT_Utility.trans("096", "Input from Output Side forbidden")); + mAllowInputFromOutputSide ? GTUtility.trans("095", "Input from Output Side allowed") + : GTUtility.trans("096", "Input from Output Side forbidden")); } } } @@ -931,19 +931,19 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (click) return true; if (wrenchingSide != mMainFacing) return false; mDisableMultiStack = !mDisableMultiStack; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( entityPlayer, StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack)); return true; } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { if (side != mMainFacing) return true; - GT_CoverBehaviorBase<?> tBehavior = GregTech_API.getCoverBehaviorNew(aCoverID.toStack()); + CoverBehaviorBase<?> tBehavior = GregTechAPI.getCoverBehaviorNew(aCoverID.toStack()); return tBehavior.isGUIClickable( side, - GT_Utility.stackToInt(aCoverID.toStack()), + GTUtility.stackToInt(aCoverID.toStack()), tBehavior.createDataObject(), getBaseMetaTileEntity()); } @@ -961,7 +961,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && side == aBaseMetaTileEntity.getFrontFacing())) return false; for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i]) && mDisableMultiStack) + if (GTUtility.areStacksEqual(GTOreDictUnificator.get(aStack), mInventory[i]) && mDisableMultiStack) return i == aIndex; return mDisableFilter || allowPutStackValidated(aBaseMetaTileEntity, aIndex, side, aStack); } @@ -1005,7 +1005,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public List<ItemStack> getConfigurationCircuits() { - return GregTech_API.getConfigurationCircuitList(mTier); + return GregTechAPI.getConfigurationCircuitList(mTier); } @Override @@ -1027,7 +1027,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return checkRecipe(false); } - public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) { + public static boolean isValidForLowGravity(GTRecipe tRecipe, int dimId) { return // TODO check or get a better solution DimensionManager.getProvider(dimId) .getClass() @@ -1060,7 +1060,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public int checkRecipe(boolean skipOC) { RecipeMap<?> tMap = getRecipeMap(); if (tMap == null) return DID_NOT_FIND_RECIPE; - GT_Recipe tRecipe = tMap.findRecipeQuery() + GTRecipe tRecipe = tMap.findRecipeQuery() .items(getAllInputs()) .fluids(getFillableStack()) .specialSlot(getSpecialSlot()) @@ -1079,7 +1079,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return DID_NOT_FIND_RECIPE; } - if (GT_Mod.gregtechproxy.mLowGravProcessing && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300) + if (GTMod.gregtechproxy.mLowGravProcessing && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300) && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; @@ -1103,7 +1103,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000) > cleanroom.getCleanness()) { if (debugCleanroom) { - GT_Log.out.println( + GTLog.out.println( "BasicMachine: Voiding output due to cleanness failure. Cleanness = " + cleanroom.getCleanness()); } @@ -1192,35 +1192,35 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.use_with_amperage", - GT_Utility.formatNumbers(mEUt), - GT_Utility.getAmperageForTier(mEUt, (byte) getInputTier()), - GT_Utility.getColoredTierNameFromTier((byte) getInputTier()))); + GTUtility.formatNumbers(mEUt), + GTUtility.getAmperageForTier(mEUt, (byte) getInputTier()), + GTUtility.getColoredTierNameFromTier((byte) getInputTier()))); } else if (mEUt < 0) { currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.produce_with_amperage", - GT_Utility.formatNumbers(-mEUt), - GT_Utility.getAmperageForTier(-mEUt, (byte) getOutputTier()), - GT_Utility.getColoredTierNameFromTier((byte) getOutputTier()))); + GTUtility.formatNumbers(-mEUt), + GTUtility.getAmperageForTier(-mEUt, (byte) getOutputTier()), + GTUtility.getColoredTierNameFromTier((byte) getOutputTier()))); } } else { if (mEUt > 0) { currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.use", - GT_Utility.formatNumbers(mEUt), - GT_Utility.getColoredTierNameFromVoltage(mEUt))); + GTUtility.formatNumbers(mEUt), + GTUtility.getColoredTierNameFromVoltage(mEUt))); } else if (mEUt < 0) { currenttip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.produce", - GT_Utility.formatNumbers(-mEUt), - GT_Utility.getColoredTierNameFromVoltage(-mEUt))); + GTUtility.formatNumbers(-mEUt), + GTUtility.getColoredTierNameFromVoltage(-mEUt))); } } } currenttip.add( - GT_Waila.getMachineProgressString( + GTWaila.getMachineProgressString( isActive, tag.getInteger("maxProgressSingleBlock"), tag.getInteger("progressSingleBlock"))); @@ -1308,7 +1308,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B builder.widget( createErrorStatusArea( builder, - isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM : GT_UITextures.PICTURE_STALLED_ELECTRICITY)); + isSteampowered() ? GTUITextures.PICTURE_STALLED_STEAM : GTUITextures.PICTURE_STALLED_ELECTRICITY)); } /** @@ -1442,8 +1442,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B protected CycleButtonWidget createItemAutoOutputButton() { return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mItemTransfer, val -> mItemTransfer = val) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GTUITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM) + .setVariableBackground(GTUITextures.BUTTON_STANDARD_TOGGLE) .setGTTooltip(() -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP)) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(25, 62) @@ -1452,8 +1452,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B protected CycleButtonWidget createFluidAutoOutputButton() { return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mFluidTransfer, val -> mFluidTransfer = val) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GTUITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) + .setVariableBackground(GTUITextures.BUTTON_STANDARD_TOGGLE) .setGTTooltip(() -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(7, 62) @@ -1461,7 +1461,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } protected Widget setNEITransferRect(Widget widget, String transferRectID) { - if (GT_Utility.isStringInvalid(transferRectID)) { + if (GTUtility.isStringInvalid(transferRectID)) { return widget; } final String transferRectTooltip; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineBronze.java index 5eb648d560..507a807a76 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineBronze.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GTValues.D1; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; @@ -25,7 +25,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; @@ -34,13 +34,13 @@ import gregtech.api.enums.TierEU; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.overclockdescriber.OverclockDescriber; import gregtech.api.objects.overclockdescriber.SteamOverclockDescriber; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; /** @@ -49,19 +49,19 @@ import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileEntity_BasicMachine { +public abstract class MTEBasicMachineBronze extends MTEBasicMachine { private static final String TT_machineType = "GT5U.MBTT.MachineType"; private static final int NEEDS_STEAM_VENTING = 64; public boolean mNeedsSteamVenting = false; - public GT_MetaTileEntity_BasicMachine_Bronze(int aID, String aName, String aNameRegional, String aDescription, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + public MTEBasicMachineBronze(int aID, String aName, String aNameRegional, String aDescription, int aInputSlotCount, + int aOutputSlotCount, boolean aHighPressure) { super(aID, aName, aNameRegional, aHighPressure ? 2 : 1, 0, aDescription, aInputSlotCount, aOutputSlotCount); } - public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + public MTEBasicMachineBronze(String aName, String[] aDescription, ITexture[][][] aTextures, int aInputSlotCount, + int aOutputSlotCount, boolean aHighPressure) { super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount); } @@ -160,7 +160,7 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE public boolean allowToCheckRecipe() { if (mNeedsSteamVenting && getBaseMetaTileEntity().getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing()) == 0 - && !GT_Utility.hasBlockHitBox( + && !GTUtility.hasBlockHitBox( getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1), getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1), @@ -178,10 +178,10 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 1))) { - GT_Utility.applyHeatDamage(tLiving, getSteamDamage()); + GTUtility.applyHeatDamage(tLiving, getSteamDamage()); } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } return !mNeedsSteamVenting; @@ -189,7 +189,7 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, TierEU.LV, null, getAllInputs()); + GTRecipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, TierEU.LV, null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); @@ -215,7 +215,7 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE public void doSound(byte aIndex, double aX, double aY, double aZ) { super.doSound(aIndex, aX, aY, aZ); if (aIndex == 9) { - GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) .setWorld(getBaseMetaTileEntity().getWorld()) @@ -240,8 +240,8 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { - return GregTech_API.getCoverBehaviorNew(aCoverID.toStack()) + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { + return GregTechAPI.getCoverBehaviorNew(aCoverID.toStack()) .isSimpleCover() && super.allowCoverOnSide(side, aCoverID); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineSteel.java index d6ae385430..8d6f5568d5 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineSteel.java @@ -22,16 +22,15 @@ import gregtech.api.render.TextureFactory; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze - implements IGetTitleColor { +public abstract class MTEBasicMachineSteel extends MTEBasicMachineBronze implements IGetTitleColor { - public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + public MTEBasicMachineSteel(int aID, String aName, String aNameRegional, String aDescription, int aInputSlotCount, + int aOutputSlotCount, boolean aHighPressure) { super(aID, aName, aNameRegional, aDescription, aInputSlotCount, aOutputSlotCount, aHighPressure); } - public GT_MetaTileEntity_BasicMachine_Steel(String aName, String[] aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + public MTEBasicMachineSteel(String aName, String[] aDescription, ITexture[][][] aTextures, int aInputSlotCount, + int aOutputSlotCount, boolean aHighPressure) { super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineWithRecipe.java index a10e735843..b5bd3d77e1 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachineWithRecipe.java @@ -1,9 +1,9 @@ package gregtech.api.metatileentity.implementations; -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.api.enums.GT_Values.ticksBetweenSounds; +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.enums.GTValues.ticksBetweenSounds; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import static net.minecraftforge.common.util.ForgeDirection.UP; @@ -29,7 +29,7 @@ import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures.BlockIcons.CustomIcon; import gregtech.api.enums.Tier; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -38,8 +38,8 @@ import gregtech.api.recipe.BasicUIProperties; import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.ExternalMaterials; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; /** @@ -48,7 +48,7 @@ import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine { +public class MTEBasicMachineWithRecipe extends MTEBasicMachine { private final RecipeMap<?> mRecipes; private final int mTankCapacity; @@ -60,9 +60,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with single-line description, specific tank capacity, and sound specified by ResourceLocation. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - ResourceLocation aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, ResourceLocation aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( aID, aName, @@ -82,9 +82,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with multi-line descriptions, specific tank capacity, and sound specified by ResourceLocation. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - ResourceLocation aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, ResourceLocation aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { super( aID, aName, @@ -422,11 +422,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ // spotless:on } - if (!GT_ModHandler.addCraftingRecipe( + if (!GTModHandler.addCraftingRecipe( getStackForm(1), - 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: " + getStackForm(1).getDisplayName()); } @@ -436,9 +436,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with single-line description, auto-scaled fluid tank, and sound specified by SoundResource. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, boolean usesFluids, - SoundResource aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, boolean usesFluids, SoundResource aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( aID, aName, @@ -458,9 +458,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with multi-line descriptions, auto-scaled fluid tank, and sound specified by SoundResource. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, boolean usesFluids, - SoundResource aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, boolean usesFluids, SoundResource aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( aID, aName, @@ -480,9 +480,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with single-line description, specific tank capacity, and sound specified by SoundResource. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - SoundResource aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, SoundResource aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( aID, aName, @@ -502,9 +502,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * Registers machine with multi-line descriptions, specific tank capacity, and sound specified by SoundResource. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - SoundResource aSound, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + public MTEBasicMachineWithRecipe(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, SoundResource aSound, + SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( aID, aName, @@ -524,9 +524,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ /** * For {@link #newMetaEntity}. */ - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, - RecipeMap<?> aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, - ITexture[][][] aTextures, ResourceLocation aSound, SpecialEffects aSpecialEffect) { + public MTEBasicMachineWithRecipe(String aName, int aTier, String[] aDescription, RecipeMap<?> aRecipes, + int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, ITexture[][][] aTextures, + ResourceLocation aSound, SpecialEffects aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots); this.mTankCapacity = aTankCapacity; this.mSpecialEffect = aSpecialEffect; @@ -536,7 +536,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicMachine_GT_Recipe( + return new MTEBasicMachineWithRecipe( this.mName, this.mTier, this.mDescriptionArray, @@ -551,17 +551,17 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ .setRecipeCatalystPriority(this.recipeCatalystPriority); } - public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTexture(FallbackableUITexture progressBarTexture) { + public MTEBasicMachineWithRecipe setProgressBarTexture(FallbackableUITexture progressBarTexture) { this.progressBarTexture = progressBarTexture; return this; } - public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name, UITexture fallback) { - return setProgressBarTexture(GT_UITextures.fallbackableProgressbar(name, fallback)); + public MTEBasicMachineWithRecipe setProgressBarTextureName(String name, UITexture fallback) { + return setProgressBarTexture(GTUITextures.fallbackableProgressbar(name, fallback)); } - public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name) { - return setProgressBarTextureName(name, GT_UITextures.PROGRESSBAR_ARROW); + public MTEBasicMachineWithRecipe setProgressBarTextureName(String name) { + return setProgressBarTextureName(name, GTUITextures.PROGRESSBAR_ARROW); } @Override @@ -617,7 +617,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ // uv; // assemblers // luv-uev - if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) { + if (GTUtility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) { if (OreDictionary.getOreName(oreID) .startsWith("circuit")) return true; } @@ -734,7 +734,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ return recipeCatalystPriority; } - public GT_MetaTileEntity_BasicMachine_GT_Recipe setRecipeCatalystPriority(int recipeCatalystPriority) { + public MTEBasicMachineWithRecipe setRecipeCatalystPriority(int recipeCatalystPriority) { this.recipeCatalystPriority = recipeCatalystPriority; return this; } @@ -748,9 +748,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1 && this.mSoundResourceLocation != null - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) - GT_Utility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ); + && GTUtility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) + && GTUtility.isStringValid(this.mSoundResourceLocation.getResourcePath())) + GTUtility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ); } @Override @@ -759,9 +759,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ // Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent. if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) { if (this.mSoundResourceLocation != null - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) - this.sendLoopStart((byte) 1); + && GTUtility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) + && GTUtility.isStringValid(this.mSoundResourceLocation.getResourcePath())) this.sendLoopStart((byte) 1); // Does not have overflow protection, but they are longs. myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicTank.java index 25fc7e7855..003b8c893e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicTank.java @@ -15,19 +15,18 @@ import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * <p> * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually */ -public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock - implements IAddUIWidgets { +public abstract class MTEBasicTank extends MTETieredMachineBlock implements IAddUIWidgets { public FluidStack mFluid; // Due to class initializing order, getCapacity might not work properly at this time. @@ -40,23 +39,21 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier /** * @param aInvSlotCount should be 3 */ - public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription, ITexture... aTextures) { + public MTEBasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + public MTEBasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTEBasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEBasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -151,13 +148,13 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier final int inputSlot = getInputSlot(); if (doesEmptyContainers()) { - FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[inputSlot], true); + FluidStack tFluid = GTUtility.getFluidForFilledItem(mInventory[inputSlot], true); if (tFluid != null && isFluidInputAllowed(tFluid)) { if (getFillableStack() == null) { if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) { if (aBaseMetaTileEntity.addStackToSlot( getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[inputSlot], true), + GTUtility.getContainerForFilledItem(mInventory[inputSlot], true), 1)) { setFillableStack(tFluid.copy()); this.onEmptyingContainerWhenEmpty(); @@ -169,7 +166,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) { if (aBaseMetaTileEntity.addStackToSlot( getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[inputSlot], true), + GTUtility.getContainerForFilledItem(mInventory[inputSlot], true), 1)) { getFillableStack().amount += tFluid.amount; aBaseMetaTileEntity.decrStackSize(inputSlot, 1); @@ -180,10 +177,10 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier } if (doesFillContainers()) { - ItemStack tOutput = GT_Utility + ItemStack tOutput = GTUtility .fillFluidContainer(getDrainableStack(), mInventory[inputSlot], false, true); if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { - FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); + FluidStack tFluid = GTUtility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(inputSlot, 1); if (tFluid != null) getDrainableStack().amount -= tFluid.amount; if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) setDrainableStack(null); @@ -298,23 +295,23 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_SCREEN_BLACK) .setPos(7, 16) .setSize(71, 45)) .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_GAUGE) .setPos(79, 34) .setSize(18, 18)) .widget( new SlotWidget(inventoryHandler, getInputSlot()) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setBackground(getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_IN) .setPos(79, 16)) .widget( new SlotWidget(inventoryHandler, getOutputSlot()).setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setBackground(getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_OUT) .setPos(79, 52)) .widget( - createFluidSlot().setBackground(GT_UITextures.TRANSPARENT) + createFluidSlot().setBackground(GTUITextures.TRANSPARENT) .setPos(58, 41)) .widget( new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java index ef64d99db8..c8b4e6bfca 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import static gregtech.api.enums.Textures.BlockIcons.ARROW_DOWN; import static gregtech.api.enums.Textures.BlockIcons.ARROW_DOWN_GLOW; import static gregtech.api.enums.Textures.BlockIcons.ARROW_LEFT; @@ -35,16 +35,16 @@ import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTUtility; import gregtech.api.util.GT_TooltipDataCache; -import gregtech.api.util.GT_Utility; -public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock implements IAddUIWidgets { +public abstract class MTEBuffer extends MTETieredMachineBlock implements IAddUIWidgets { private static final int OUTPUT_INDEX = 0; private static final int ARROW_RIGHT_INDEX = 1; @@ -67,23 +67,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM public int mSuccess = 0, mTargetStackSize = 0; private int uiButtonCount = 0; - public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription) { + public MTEBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription) { + public MTEBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTEBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -275,7 +271,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -314,11 +310,11 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM mTargetStackSize = mMaxStackSize; } if (mTargetStackSize == 0) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("098", "Do not regulate Item Stack Size")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("098", "Do not regulate Item Stack Size")); } else { - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize); + GTUtility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize); } } } @@ -374,7 +370,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long ignoredTimer, int stacks) { int tCost; - if (bStockingMode) tCost = GT_Utility.moveMultipleItemStacks( + if (bStockingMode) tCost = GTUtility.moveMultipleItemStacks( aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), @@ -386,7 +382,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM (byte) 64, (byte) 1, stacks); - else tCost = GT_Utility.moveMultipleItemStacks( + else tCost = GTUtility.moveMultipleItemStacks( aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), @@ -428,23 +424,23 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM } protected void fillStacksIntoFirstSlots() { - HashMap<GT_Utility.ItemId, Integer> slots = new HashMap<>(mInventory.length); - HashMap<GT_Utility.ItemId, ItemStack> stacks = new HashMap<>(mInventory.length); - List<GT_Utility.ItemId> order = new ArrayList<>(mInventory.length); + HashMap<GTUtility.ItemId, Integer> slots = new HashMap<>(mInventory.length); + HashMap<GTUtility.ItemId, ItemStack> stacks = new HashMap<>(mInventory.length); + List<GTUtility.ItemId> order = new ArrayList<>(mInventory.length); List<Integer> validSlots = new ArrayList<>(mInventory.length); for (int i = 0; i < mInventory.length - 1; i++) { if (!isValidSlot(i)) continue; validSlots.add(i); ItemStack s = mInventory[i]; if (s == null) continue; - GT_Utility.ItemId sID = GT_Utility.ItemId.createNoCopy(s); + GTUtility.ItemId sID = GTUtility.ItemId.createNoCopy(s); slots.merge(sID, s.stackSize, Integer::sum); if (!stacks.containsKey(sID)) stacks.put(sID, s); order.add(sID); mInventory[i] = null; } int slotindex = 0; - for (GT_Utility.ItemId sID : order) { + for (GTUtility.ItemId sID : order) { int toSet = slots.get(sID); if (toSet == 0) continue; int slot = validSlots.get(slotindex); @@ -463,10 +459,10 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM if (entityPlayer.isSneaking()) { // I was so proud of all this but I literally just copied code from OutputBus bSortStacks = !bSortStacks; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( entityPlayer, - GT_Utility.trans("200", "Sort mode: ") - + (bSortStacks ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled"))); + GTUtility.trans("200", "Sort mode: ") + + (bSortStacks ? GTUtility.trans("088", "Enabled") : GTUtility.trans("087", "Disabled"))); return true; } return super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ); @@ -477,16 +473,16 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM createToggleButton( () -> bOutput, val -> bOutput = val, - GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY, + GTUITextures.OVERLAY_BUTTON_EMIT_ENERGY, this::getEmitEnergyButtonTooltip)); } private GT_TooltipDataCache.TooltipData getEmitEnergyButtonTooltip() { return mTooltipCache.getData( EMIT_ENERGY_TOOLTIP, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(V[mTier]) + EnumChatFormatting.GREEN + GTUtility.formatNumbers(V[mTier]) + " (" - + GT_Utility.getColoredTierNameFromTier(mTier) + + GTUtility.getColoredTierNameFromTier(mTier) + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY, @@ -498,7 +494,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM createToggleButton( () -> bRedstoneIfFull, val -> bRedstoneIfFull = val, - GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE, + GTUITextures.OVERLAY_BUTTON_EMIT_REDSTONE, this::getEmitRedstoneIfFullButtonTooltip).setUpdateTooltipEveryTick(true)); } @@ -514,7 +510,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM createToggleButton( () -> bInvert, val -> bInvert = val, - GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE, + GTUITextures.OVERLAY_BUTTON_INVERT_REDSTONE, () -> mTooltipCache.getData(INVERT_REDSTONE_TOOLTIP))); } @@ -523,7 +519,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM createToggleButton( () -> bStockingMode, val -> bStockingMode = val, - GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE, + GTUITextures.OVERLAY_BUTTON_STOCKING_MODE, () -> mTooltipCache.getData(STOCKING_MODE_TOOLTIP))); } @@ -532,7 +528,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM createToggleButton( () -> bSortStacks, val -> bSortStacks = val, - GT_UITextures.OVERLAY_BUTTON_SORTING_MODE, + GTUITextures.OVERLAY_BUTTON_SORTING_MODE, () -> mTooltipCache.getData(SORTING_MODE_TOOLTIP))); } @@ -546,7 +542,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM Supplier<GT_TooltipDataCache.TooltipData> tooltipDataSupplier) { return new CycleButtonWidget().setToggle(getter, setter) .setStaticTexture(picture) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setVariableBackground(GTUITextures.BUTTON_STANDARD_TOGGLE) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(7 + (uiButtonCount++ * BUTTON_SIZE), 62) .setSize(BUTTON_SIZE, BUTTON_SIZE) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java index e44860963f..b56769c59b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java @@ -25,8 +25,8 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import cofh.api.energy.IEnergyReceiver; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; @@ -47,17 +47,17 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.interfaces.PowerLogicHost; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.objects.GT_Cover_None; +import gregtech.api.objects.GTCoverNone; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_GC_Compat; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTGCCompat; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import gregtech.common.covers.CoverInfo; -import gregtech.common.covers.GT_Cover_SolarPanel; +import gregtech.common.covers.CoverSolarPanel; import ic2.api.energy.EnergyNet; import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergySink; @@ -67,7 +67,7 @@ import ic2.api.reactor.IReactorChamber; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; -public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable { +public class MTECable extends MetaPipeEntity implements IMetaTileEntityCable { public final float mThickNess; public final Materials mMaterial; @@ -76,7 +76,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public int mTransferredAmperage = 0; - public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, + public MTECable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aID, aName, aNameRegional, 0); mThickNess = aThickNess; @@ -88,8 +88,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile mCableLossPerMeter = aCableLossPerMeter; } - public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, - long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + public MTECable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, + long aVoltage, boolean aInsulated, boolean aCanShock) { super(aName, 0); mThickNess = aThickNess; mMaterial = aMaterial; @@ -107,7 +107,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaPipeEntity_Cable( + return new MTECable( mName, mThickNess, mMaterial, @@ -185,7 +185,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (amperage == 0L) return; - GT_Utility.applyElectricityDamage(livingEntity, voltage, amperage); + GTUtility.applyElectricityDamage(livingEntity, voltage, amperage); } @Override @@ -259,7 +259,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aTick % 20 == 0 && aBaseMetaTileEntity.isServerSide() - && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) { + && (!GTMod.gregtechproxy.gt6Cable || mCheckConnections)) { checkConnections(); } } @@ -267,14 +267,14 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Mod.gregtechproxy.gt6Cable - && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + if (GTMod.gregtechproxy.gt6Cable + && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(wrenchingSide)) { disconnect(wrenchingSide); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected")); - } else if (!GT_Mod.gregtechproxy.costlyCableConnection) { + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("215", "Disconnected")); + } else if (!GTMod.gregtechproxy.costlyCableConnection) { if (connect(wrenchingSide) > 0) - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("214", "Connected")); } return true; } @@ -284,14 +284,14 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Mod.gregtechproxy.gt6Cable - && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + if (GTMod.gregtechproxy.gt6Cable + && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(wrenchingSide)) { disconnect(wrenchingSide); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected")); - } else if (!GT_Mod.gregtechproxy.costlyCableConnection || GT_ModHandler.consumeSolderingMaterial(aPlayer)) { + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("215", "Disconnected")); + } else if (!GTMod.gregtechproxy.costlyCableConnection || GTModHandler.consumeSolderingMaterial(aPlayer)) { if (connect(wrenchingSide) > 0) - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("214", "Connected")); } return true; } @@ -299,25 +299,25 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsIn(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyIn(side, aCoverID, aCoverVariable, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsOut(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyOut(side, aCoverID, aCoverVariable, aTileEntity); } @Override - public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsIn(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyIn(side, aCoverID, aCoverVariable, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsOut(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyOut(side, aCoverID, aCoverVariable, aTileEntity); } @@ -335,7 +335,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean canConnect(ForgeDirection side, TileEntity tileEntity) { final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity(); - final GT_CoverBehaviorBase<?> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(side); + final CoverBehaviorBase<?> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(side); final ForgeDirection oppositeSide = side.getOpposite(); // GT Machine handling @@ -346,11 +346,11 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return true; // Solar Panel Compat - if (coverBehavior instanceof GT_Cover_SolarPanel) return true; + if (coverBehavior instanceof CoverSolarPanel) return true; // ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) ) // --> Not needed - if (GalacticraftCore.isModLoaded() && GT_GC_Compat.canConnect(tileEntity, oppositeSide)) return true; + if (GalacticraftCore.isModLoaded() && GTGCCompat.canConnect(tileEntity, oppositeSide)) return true; // AE2-p2p Compat if (tileEntity instanceof appeng.tile.powersink.IC2 ic2sink @@ -372,25 +372,25 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, oppositeSide)) return true; // IC2 Source Compat - if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) { + if (GTMod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) { if (((IEnergySource) ic2Energy).emitsEnergyTo((TileEntity) baseMetaTile, oppositeSide)) { return true; } } } // RF Output Compat - if (GregTech_API.mOutputRF && tileEntity instanceof IEnergyReceiver + if (GregTechAPI.mOutputRF && tileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tileEntity).canConnectEnergy(oppositeSide)) return true; // RF Input Compat - return GregTech_API.mInputRF && (tileEntity instanceof IEnergyEmitter + return GregTechAPI.mInputRF && (tileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tileEntity).emitsEnergyTo((TileEntity) baseMetaTile, oppositeSide)); } @Override public boolean getGT6StyleConnection() { // Yes if GT6 Cables are enabled - return GT_Mod.gregtechproxy.gt6Cable; + return GTMod.gregtechproxy.gt6Cable; } @Override @@ -410,19 +410,19 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return new String[] { StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": %%%" + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mVoltage) + + GTUtility.formatNumbers(mVoltage) + " (" - + GT_Utility.getColoredTierNameFromVoltage(mVoltage) + + GTUtility.getColoredTierNameFromVoltage(mVoltage) + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY, StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": %%%" + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mAmperage) + + GTUtility.formatNumbers(mAmperage) + EnumChatFormatting.GRAY, StatCollector.translateToLocal("GT5U.item.cable.loss") + ": %%%" + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mCableLossPerMeter) + + GTUtility.formatNumbers(mCableLossPerMeter) + EnumChatFormatting.GRAY + "%%% " + StatCollector.translateToLocal("GT5U.item.cable.eu_volt") }; @@ -430,18 +430,18 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public float getThickNess() { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F; + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x1) != 0) return 0.0625F; return mThickNess; } @Override public void saveNBTData(NBTTagCompound aNBT) { - if (GT_Mod.gregtechproxy.gt6Cable) aNBT.setByte("mConnections", mConnections); + if (GTMod.gregtechproxy.gt6Cable) aNBT.setByte("mConnections", mConnections); } @Override public void loadNBTData(NBTTagCompound aNBT) { - if (GT_Mod.gregtechproxy.gt6Cable) { + if (GTMod.gregtechproxy.gt6Cable) { mConnections = aNBT.getByte("mConnections"); } } @@ -469,34 +469,34 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return new String[] { "Amperage: " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(currAmp) + + GTUtility.formatNumbers(currAmp) + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mAmperage) + + GTUtility.formatNumbers(mAmperage) + EnumChatFormatting.RESET + " A", "Voltage Out: " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(currVoltage) + + GTUtility.formatNumbers(currVoltage) + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxVoltageOut) + + GTUtility.formatNumbers(maxVoltageOut) + EnumChatFormatting.RESET + " EU/t", "Avg Amperage (20t): " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(avgAmp) + + GTUtility.formatNumbers(avgAmp) + EnumChatFormatting.RESET + " A", "Avg Output (20t): " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(avgVoltage) + + GTUtility.formatNumbers(avgVoltage) + EnumChatFormatting.RESET + " EU/t" }; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1); else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @@ -556,7 +556,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb); } @@ -564,7 +564,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean shouldJoinIc2Enet() { - if (!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return false; + if (!GTMod.gregtechproxy.ic2EnergySourceCompat) return false; if (mConnections != 0) { final IGregTechTileEntity baseMeta = getBaseMetaTileEntity(); @@ -594,7 +594,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { if (isConnectedAtSide(side)) { final CoverInfo coverInfo = pipe.getCoverInfoAtSide(side); - if (coverInfo.getCoverBehavior() instanceof GT_Cover_None) continue; + if (coverInfo.getCoverBehavior() instanceof GTCoverNone) continue; if (!letsIn(coverInfo) || !letsOut(coverInfo)) { pipe.addToLock(pipe, side); } else { @@ -607,7 +607,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { if (isConnectedAtSide(side)) { final CoverInfo coverInfo = pipe.getCoverInfoAtSide(side); - if (coverInfo.getCoverBehavior() instanceof GT_Cover_None) continue; + if (coverInfo.getCoverBehavior() instanceof GTCoverNone) continue; if (!letsIn(coverInfo) || !letsOut(coverInfo)) { dontAllow = true; @@ -629,19 +629,19 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile currenttip.add( StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mVoltage) + + GTUtility.formatNumbers(mVoltage) + " (" - + GT_Utility.getColoredTierNameFromVoltage(mVoltage) + + GTUtility.getColoredTierNameFromVoltage(mVoltage) + EnumChatFormatting.GREEN + ")"); currenttip.add( StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mAmperage)); + + GTUtility.formatNumbers(mAmperage)); currenttip.add( StatCollector.translateToLocal("GT5U.item.cable.loss") + ": " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mCableLossPerMeter) + + GTUtility.formatNumbers(mCableLossPerMeter) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.item.cable.eu_volt")); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTECubicMultiBlockBase.java index efb91e3a26..c8b0c8ce3f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTECubicMultiBlockBase.java @@ -4,13 +4,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_HatchElement.InputBus; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.Muffler; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; +import static gregtech.api.enums.HatchElement.Energy; +import static gregtech.api.enums.HatchElement.InputBus; +import static gregtech.api.enums.HatchElement.InputHatch; +import static gregtech.api.enums.HatchElement.Maintenance; +import static gregtech.api.enums.HatchElement.Muffler; +import static gregtech.api.enums.HatchElement.OutputBus; +import static gregtech.api.enums.HatchElement.OutputHatch; import java.util.List; @@ -25,7 +25,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_StructureUtility; +import gregtech.api.util.GTStructureUtility; /** * A simple 3x3x3 hollow cubic multiblock, that can be arbitrarily rotated, made of a single type of machine casing and @@ -41,15 +41,15 @@ import gregtech.api.util.GT_StructureUtility; * * @param <T> */ -public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTileEntity_CubicMultiBlockBase<T>> - extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> implements ISurvivalConstructable { +public abstract class MTECubicMultiBlockBase<T extends MTECubicMultiBlockBase<T>> extends MTEEnhancedMultiBlockBase<T> + implements ISurvivalConstructable { protected static final String STRUCTURE_PIECE_MAIN = "main"; - protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>> STRUCTURE_DEFINITION = new ClassValue<>() { + protected static final ClassValue<IStructureDefinition<MTECubicMultiBlockBase<?>>> STRUCTURE_DEFINITION = new ClassValue<>() { @Override - protected IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>> computeValue(Class<?> type) { - return StructureDefinition.<GT_MetaTileEntity_CubicMultiBlockBase<?>>builder() + protected IStructureDefinition<MTECubicMultiBlockBase<?>> computeValue(Class<?> type) { + return StructureDefinition.<MTECubicMultiBlockBase<?>>builder() .addShape( STRUCTURE_PIECE_MAIN, transpose( @@ -58,24 +58,24 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil 'h', ofChain( lazy( - t -> GT_StructureUtility.<GT_MetaTileEntity_CubicMultiBlockBase<?>>buildHatchAdder() + t -> GTStructureUtility.<MTECubicMultiBlockBase<?>>buildHatchAdder() .atLeastList(t.getAllowedHatches()) .casingIndex(t.getHatchTextureIndex()) .dot(1) .build()), onElementPass( - GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded, - lazy(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement)))) + MTECubicMultiBlockBase::onCorrectCasingAdded, + lazy(MTECubicMultiBlockBase::getCasingElement)))) .build(); } }; private int mCasingAmount = 0; - protected GT_MetaTileEntity_CubicMultiBlockBase(int aID, String aName, String aNameRegional) { + protected MTECubicMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - protected GT_MetaTileEntity_CubicMultiBlockBase(String aName) { + protected MTECubicMultiBlockBase(String aName) { super(aName); } @@ -122,9 +122,9 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil return mMaintenanceHatches.size() == 1; } - protected abstract IStructureElement<GT_MetaTileEntity_CubicMultiBlockBase<?>> getCasingElement(); + protected abstract IStructureElement<MTECubicMultiBlockBase<?>> getCasingElement(); - protected List<IHatchElement<? super GT_MetaTileEntity_CubicMultiBlockBase<?>>> getAllowedHatches() { + protected List<IHatchElement<? super MTECubicMultiBlockBase<?>>> getAllowedHatches() { return ImmutableList.of(InputHatch, OutputHatch, InputBus, OutputBus, Muffler, Maintenance, Energy); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java index 15ce78fae3..2cf4398e87 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java @@ -19,30 +19,30 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.shutdown.ShutDownReasonRegistry; /** - * Enhanced multiblock base class, featuring following improvement over {@link GT_MetaTileEntity_MultiBlockBase} + * Enhanced multiblock base class, featuring following improvement over {@link MTEMultiBlockBase} * <p> * 1. TecTech style declarative structure check utilizing StructureLib. 2. Arbitrarily rotating the whole structure, if * allowed to. * * @param <T> type of this */ -public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>> - extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable { +public abstract class MTEEnhancedMultiBlockBase<T extends MTEEnhancedMultiBlockBase<T>> extends MTETooltipMultiBlockBase + implements IAlignment, IConstructable { private ExtendedFacing mExtendedFacing = ExtendedFacing.DEFAULT; private IAlignmentLimits mLimits = getInitialAlignmentLimits(); - protected GT_MetaTileEntity_EnhancedMultiBlockBase(int aID, String aName, String aNameRegional) { + protected MTEEnhancedMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - protected GT_MetaTileEntity_EnhancedMultiBlockBase(String aName) { + protected MTEEnhancedMultiBlockBase(String aName) { super(aName); } @@ -61,7 +61,7 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta mUpdated = false; mUpdate = 50; if (getBaseMetaTileEntity().isServerSide() - && !GregTech_API.isDummyWorld(getBaseMetaTileEntity().getWorld())) { + && !GregTechAPI.isDummyWorld(getBaseMetaTileEntity().getWorld())) { StructureLibAPI.sendAlignment( (IAlignmentProvider) base, new NetworkRegistry.TargetPoint( @@ -123,7 +123,7 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta */ public abstract IStructureDefinition<T> getStructureDefinition(); - protected abstract GT_Multiblock_Tooltip_Builder createTooltip(); + protected abstract MultiblockTooltipBuilder createTooltip(); @Override public String[] getStructureDescription(ItemStack stackSize) { @@ -184,8 +184,8 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta } @SuppressWarnings("unchecked") - private IStructureDefinition<GT_MetaTileEntity_EnhancedMultiBlockBase<T>> getCastedStructureDefinition() { - return (IStructureDefinition<GT_MetaTileEntity_EnhancedMultiBlockBase<T>>) getStructureDefinition(); + private IStructureDefinition<MTEEnhancedMultiBlockBase<T>> getCastedStructureDefinition() { + return (IStructureDefinition<MTEEnhancedMultiBlockBase<T>>) getStructureDefinition(); } /** diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEExtendedPowerMultiBlockBase.java index f430114319..64bade97e8 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEExtendedPowerMultiBlockBase.java @@ -1,7 +1,7 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.util.GT_Utility.filterValidMTEs; +import static gregtech.api.enums.GTValues.VN; +import static gregtech.api.util.GTUtility.filterValidMTEs; import java.util.ArrayList; import java.util.List; @@ -21,25 +21,25 @@ import org.jetbrains.annotations.NotNull; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.recipe.check.CheckRecipeResult; -import gregtech.api.util.GT_ExoticEnergyInputHelper; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.ExoticEnergyInputHelper; +import gregtech.api.util.GTUtility; +import gregtech.api.util.OverclockCalculator; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; /** * Multiblock base class that allows machine to use power over int. */ -public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>> - extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { +public abstract class MTEExtendedPowerMultiBlockBase<T extends MTEEnhancedMultiBlockBase<T>> + extends MTEEnhancedMultiBlockBase<T> { public long lEUt; - protected GT_MetaTileEntity_ExtendedPowerMultiBlockBase(int aID, String aName, String aNameRegional) { + protected MTEExtendedPowerMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - protected GT_MetaTileEntity_ExtendedPowerMultiBlockBase(String aName) { + protected MTEExtendedPowerMultiBlockBase(String aName) { super(aName); } @@ -59,7 +59,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT @Override protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) { - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(aEUt) + OverclockCalculator calculator = new OverclockCalculator().setRecipeEUt(aEUt) .setEUt(maxInputVoltage * mAmperage) .setDuration(aDuration) .setDurationDecreasePerOC(perfectOC ? 4.0 : 2.0) @@ -94,8 +94,8 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT return (-this.lEUt * 10000) / Math.max(1000, mEfficiency); } - public List<GT_MetaTileEntity_Hatch> getExoticAndNormalEnergyHatchList() { - List<GT_MetaTileEntity_Hatch> tHatches = new ArrayList<>(); + public List<MTEHatch> getExoticAndNormalEnergyHatchList() { + List<MTEHatch> tHatches = new ArrayList<>(); tHatches.addAll(filterValidMTEs(mExoticEnergyHatches)); tHatches.addAll(filterValidMTEs(mEnergyHatches)); return tHatches; @@ -103,7 +103,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT @Override public boolean drainEnergyInput(long aEU) { - return GT_ExoticEnergyInputHelper.drainEnergy(aEU, getExoticAndNormalEnergyHatchList()); + return ExoticEnergyInputHelper.drainEnergy(aEU, getExoticAndNormalEnergyHatchList()); } @Override @@ -145,13 +145,13 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT @Override public String[] getInfoData() { int mPollutionReduction = 0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : filterValidMTEs(mMufflerHatches)) { + for (MTEHatchMuffler tHatch : filterValidMTEs(mMufflerHatches)) { mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } long storedEnergy = 0; long maxEnergy = 0; - for (GT_MetaTileEntity_Hatch tHatch : getExoticAndNormalEnergyHatchList()) { + for (MTEHatch tHatch : getExoticAndNormalEnergyHatchList()) { storedEnergy += tHatch.getBaseMetaTileEntity() .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() @@ -163,30 +163,30 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT return new String[] { /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) + + GTUtility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + GTUtility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) + + GTUtility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) + + GTUtility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(getActualEnergyUsage()) + + GTUtility.formatNumbers(getActualEnergyUsage()) + EnumChatFormatting.RESET + " EU/t", /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(voltage) + + GTUtility.formatNumbers(voltage) + EnumChatFormatting.RESET + " EU/t(*" + amps @@ -194,7 +194,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(voltage)] + + VN[GTUtility.getTier(voltage)] + EnumChatFormatting.RESET, /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED @@ -216,22 +216,22 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT @Override public long getMaxInputVoltage() { - return GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList()); + return ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList()); } @Override public long getAverageInputVoltage() { - return GT_ExoticEnergyInputHelper.getAverageInputVoltageMulti(getExoticAndNormalEnergyHatchList()); + return ExoticEnergyInputHelper.getAverageInputVoltageMulti(getExoticAndNormalEnergyHatchList()); } @Override public long getMaxInputAmps() { - return GT_ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti(getExoticAndNormalEnergyHatchList()); + return ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti(getExoticAndNormalEnergyHatchList()); } @Override public long getMaxInputEu() { - return GT_ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()); + return ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_FilterBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEFilterBase.java index 896cb223f3..32e224e50f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_FilterBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEFilterBase.java @@ -5,11 +5,11 @@ import net.minecraft.nbt.NBTTagCompound; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.util.GT_TooltipDataCache; -public abstract class GT_MetaTileEntity_FilterBase extends GT_MetaTileEntity_Buffer { +public abstract class MTEFilterBase extends MTEBuffer { private static final String INVERT_FILTER_TOOLTIP = "GT5U.machines.invert_filter.tooltip"; protected static final int FILTER_SLOT_INDEX = 9; @@ -17,23 +17,21 @@ public abstract class GT_MetaTileEntity_FilterBase extends GT_MetaTileEntity_Buf private static final String EMIT_REDSTONE_GRADUALLY_TOOLTIP = "GT5U" + ".machines.emit_redstone_gradually.tooltip"; protected boolean invertFilter = false; - public GT_MetaTileEntity_FilterBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + public MTEFilterBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_FilterBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + public MTEFilterBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GT_MetaTileEntity_FilterBase(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTEFilterBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_FilterBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEFilterBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -86,7 +84,7 @@ public abstract class GT_MetaTileEntity_FilterBase extends GT_MetaTileEntity_Buf createToggleButton( () -> bRedstoneIfFull, val -> bRedstoneIfFull = val, - GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE, + GTUITextures.OVERLAY_BUTTON_EMIT_REDSTONE, this::getEmitRedstoneGraduallyButtonTooltip).setUpdateTooltipEveryTick(true)); } @@ -100,7 +98,7 @@ public abstract class GT_MetaTileEntity_FilterBase extends GT_MetaTileEntity_Buf createToggleButton( () -> invertFilter, val -> invertFilter = val, - GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER, + GTUITextures.OVERLAY_BUTTON_INVERT_FILTER, () -> mTooltipCache.getData(INVERT_FILTER_TOOLTIP))); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEFluid.java index cafd1c9cb7..ddc0e28723 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEFluid.java @@ -1,13 +1,13 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; -import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GTValues.ALL_VALID_SIDES; +import static gregtech.api.enums.GTValues.D1; import static gregtech.api.enums.Mods.TinkerConstruct; import static gregtech.api.enums.Mods.Translocator; -import static gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid.Border.BOTTOM; -import static gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid.Border.LEFT; -import static gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid.Border.RIGHT; -import static gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid.Border.TOP; +import static gregtech.api.metatileentity.implementations.MTEFluid.Border.BOTTOM; +import static gregtech.api.metatileentity.implementations.MTEFluid.Border.LEFT; +import static gregtech.api.metatileentity.implementations.MTEFluid.Border.RIGHT; +import static gregtech.api.metatileentity.implementations.MTEFluid.Border.TOP; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import static net.minecraftforge.common.util.ForgeDirection.DOWN; import static net.minecraftforge.common.util.ForgeDirection.EAST; @@ -39,7 +39,7 @@ import net.minecraftforge.fluids.IFluidHandler; import org.apache.commons.lang3.tuple.MutableTriple; import cpw.mods.fml.common.Optional; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; @@ -53,23 +53,23 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import gregtech.common.config.other.ConfigGeneral; +import gregtech.common.covers.CoverDrain; +import gregtech.common.covers.CoverFluidRegulator; import gregtech.common.covers.CoverInfo; -import gregtech.common.covers.GT_Cover_Drain; -import gregtech.common.covers.GT_Cover_FluidRegulator; -public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { +public class MTEFluid extends MetaPipeEntity { protected static final EnumMap<ForgeDirection, EnumMap<Border, ForgeDirection>> FACE_BORDER_MAP = new EnumMap<>( ForgeDirection.class); @@ -114,13 +114,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { */ public byte mDisableInput = 0; - public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aCapacity, int aHeatResistance, boolean aGasProof) { + public MTEFluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, + int aHeatResistance, boolean aGasProof) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } - public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { + public MTEFluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, + int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aID, aName, aNameRegional, 0, false); mThickNess = aThickNess; mMaterial = aMaterial; @@ -132,8 +132,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { addInfo(aID); } - public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, - int aHeatResistance, boolean aGasProof, int aFluidTypes) { + public MTEFluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, + boolean aGasProof, int aFluidTypes) { super(aName, 0); mThickNess = aThickNess; mMaterial = aMaterial; @@ -151,14 +151,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaPipeEntity_Fluid( - mName, - mThickNess, - mMaterial, - mCapacity, - mHeatResistance, - mGasProof, - mPipeAmount); + return new MTEFluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount); } @Override @@ -260,7 +253,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { for (int i = 0; i < mPipeAmount; i++) if (mFluids[i] != null) aNBT.setTag("mFluid" + (i == 0 ? "" : i), mFluids[i].writeToNBT(new NBTTagCompound())); aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom); - if (GT_Mod.gregtechproxy.gt6Pipe) { + if (GTMod.gregtechproxy.gt6Pipe) { aNBT.setByte("mConnections", mConnections); aNBT.setByte("mDisableInput", mDisableInput); } @@ -271,7 +264,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { for (int i = 0; i < mPipeAmount; i++) mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid" + (i == 0 ? "" : i))); mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom"); - if (GT_Mod.gregtechproxy.gt6Pipe) { + if (GTMod.gregtechproxy.gt6Pipe) { mConnections = aNBT.getByte("mConnections"); mDisableInput = aNBT.getByte("mDisableInput"); } @@ -287,11 +280,11 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { .getTemperature(tFluid); if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { - GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); + GTUtility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break; } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { - GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); + GTUtility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break; } } @@ -308,7 +301,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { mLastReceivedFrom = 0; } - if (!GT_Mod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections(); + if (!GTMod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections(); final boolean shouldDistribute = (oLastReceivedFrom == mLastReceivedFrom); for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) { @@ -338,7 +331,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (tTemperature > mHeatResistance) { if (aBaseMetaTileEntity.getRandomNumber(100) == 0) { // Poof - GT_Log.exp.println( + GTLog.exp.println( "Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + " | " + aBaseMetaTileEntity.getYCoord() @@ -351,7 +344,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { } // Mmhmm, Fire aBaseMetaTileEntity.setOnFire(); - GT_Log.exp.println( + GTLog.exp.println( "Set Blocks around Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + " | " + aBaseMetaTileEntity.getYCoord() @@ -376,10 +369,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) { - GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F); + GTUtility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F); } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } else if (tTemperature < 260) { try { @@ -393,10 +386,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) { - GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F); + GTUtility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F); } } catch (Throwable e) { - if (D1) e.printStackTrace(GT_Log.err); + if (D1) e.printStackTrace(GTLog.err); } } } @@ -468,21 +461,21 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public void connectPipeOnSide(ForgeDirection side, EntityPlayer entityPlayer) { if (!isConnectedAtSide(side)) { - if (connect(side) > 0) GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("214", "Connected")); + if (connect(side) > 0) GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("214", "Connected")); } else { disconnect(side); - GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("215", "Disconnected")); + GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("215", "Disconnected")); } } public void blockPipeOnSide(ForgeDirection side, EntityPlayer entityPlayer, byte mask) { if (isInputDisabledAtSide(side)) { mDisableInput &= ~mask; - GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("212", "Input enabled")); + GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("212", "Input enabled")); if (!isConnectedAtSide(side)) connect(side); } else { mDisableInput |= mask; - GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("213", "Input disabled")); + GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("213", "Input disabled")); } } @@ -490,11 +483,11 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool) { - if (GT_Mod.gregtechproxy.gt6Pipe) { - final int mode = GT_MetaGenerated_Tool.getToolMode(aTool); + if (GTMod.gregtechproxy.gt6Pipe) { + final int mode = MetaGeneratedTool.getToolMode(aTool); IGregTechTileEntity currentPipeBase = getBaseMetaTileEntity(); - GT_MetaPipeEntity_Fluid currentPipe = (GT_MetaPipeEntity_Fluid) currentPipeBase.getMetaTileEntity(); - final ForgeDirection tSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + MTEFluid currentPipe = (MTEFluid) currentPipeBase.getMetaTileEntity(); + final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); final byte tMask = (byte) (tSide.flag); if (mode == ToolModes.REGULAR.get()) { @@ -526,10 +519,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { return wasActionPerformed; } - GT_MetaPipeEntity_Fluid nextPipe = nextPipeBase - .getMetaTileEntity() instanceof GT_MetaPipeEntity_Fluid - ? (GT_MetaPipeEntity_Fluid) nextPipeBase.getMetaTileEntity() - : null; + MTEFluid nextPipe = nextPipeBase.getMetaTileEntity() instanceof MTEFluid + ? (MTEFluid) nextPipeBase.getMetaTileEntity() + : null; // if next tile entity is not a pipe if (nextPipe == null) { @@ -580,25 +572,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsIn(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidIn(side, aCoverID, aCoverVariable, null, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsOut(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidOut(side, aCoverID, aCoverVariable, null, aTileEntity); } @Override - public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsIn(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidIn(side, aCoverID, aCoverVariable, null, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsOut(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidOut(side, aCoverID, aCoverVariable, null, aTileEntity); } @@ -621,13 +613,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity(); if (baseMetaTile == null) return false; - final GT_CoverBehaviorBase<?> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(side); + final CoverBehaviorBase<?> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(side); final IGregTechTileEntity gTileEntity = (tileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tileEntity : null; - if (coverBehavior instanceof GT_Cover_Drain - || (TinkerConstruct.isModLoaded() && isTConstructFaucet(tileEntity))) return true; + if (coverBehavior instanceof CoverDrain || (TinkerConstruct.isModLoaded() && isTConstructFaucet(tileEntity))) + return true; final IFluidHandler fTileEntity = (tileEntity instanceof IFluidHandler) ? (IFluidHandler) tileEntity : null; @@ -636,7 +628,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (tInfo != null) { return tInfo.length > 0 || (Translocator.isModLoaded() && isTranslocator(tileEntity)) || gTileEntity != null - && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator; + && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof CoverFluidRegulator; } } return false; @@ -657,14 +649,14 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public boolean getGT6StyleConnection() { // Yes if GT6 pipes are enabled - return GT_Mod.gregtechproxy.gt6Pipe; + return GTMod.gregtechproxy.gt6Pipe; } @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { super.doSound(aIndex, aX, aY, aZ); if (aIndex == 9) { - GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) .setWorld(getBaseMetaTileEntity().getWorld()) @@ -837,12 +829,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { List<String> descriptions = new ArrayList<>(); descriptions.add( EnumChatFormatting.BLUE + "Fluid Capacity: %%%" - + GT_Utility.formatNumbers(mCapacity * 20L) + + GTUtility.formatNumbers(mCapacity * 20L) + "%%% L/sec" + EnumChatFormatting.GRAY); descriptions.add( EnumChatFormatting.RED + "Heat Limit: %%%" - + GT_Utility.formatNumbers(mHeatResistance) + + GTUtility.formatNumbers(mHeatResistance) + "%%% K" + EnumChatFormatting.GRAY); if (!mGasProof) { @@ -856,7 +848,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public float getThickNess() { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F; + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x1) != 0) return 0.0625F; return mThickNess; } @@ -876,7 +868,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1); else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @@ -931,7 +923,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java index 7cb2b3a9bd..ec000b6e9c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEFrame.java @@ -12,22 +12,22 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GTLanguageManager; -public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { +public class MTEFrame extends MetaPipeEntity { - private static final String localizedDescFormat = GT_LanguageManager + private static final String localizedDescFormat = GTLanguageManager .addStringLocalization("gt.blockmachines.gt_frame.desc.format", "Just something you can put covers on."); public final Materials mMaterial; - public GT_MetaPipeEntity_Frame(int aID, String aName, String aNameRegional, Materials aMaterial) { + public MTEFrame(int aID, String aName, String aNameRegional, Materials aMaterial) { super(aID, aName, aNameRegional, 0); mMaterial = aMaterial; // Hide TileEntity frame in NEI, since we have the block version now that should always be used codechicken.nei.api.API.hideItem(this.getStackForm(1)); } - public GT_MetaPipeEntity_Frame(String aName, Materials aMaterial) { + public MTEFrame(String aName, Materials aMaterial) { super(aName, 0); mMaterial = aMaterial; } @@ -39,7 +39,7 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaPipeEntity_Frame(mName, mMaterial); + return new MTEFrame(mName, mMaterial); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatch.java index 1e974f5e9d..bd0b3b6f61 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatch.java @@ -5,7 +5,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.crafting.ICraftingIconProvider; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -13,7 +13,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; /** * Handles texture changes internally. No special calls are necessary other than updateTexture in add***ToMachineList. */ -public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTank implements ICraftingIconProvider { +public abstract class MTEHatch extends MTEBasicTank implements ICraftingIconProvider { public enum ConnectionType { CABLE, @@ -32,23 +32,21 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan private ItemStack ae2CraftingIcon; - public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription, ITexture... aTextures) { + public MTEHatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription, ITexture... aTextures) { + public MTEHatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTEHatch(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatch(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -105,9 +103,9 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan actualTexture = aNBT.getByte("mMachineBlock"); mTexturePage = aNBT.getByte("mTexturePage"); - if (mTexturePage != 0 && GT_Values.GT.isServerSide()) actualTexture |= 0x80; // <- lets just hope no one needs - // the correct value for that on - // server + if (mTexturePage != 0 && GTValues.GT.isServerSide()) actualTexture |= 0x80; // <- lets just hope no one needs + // the correct value for that on + // server mMachineBlock = actualTexture; } @@ -137,7 +135,7 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan /** * Some multiblocks restrict hatches by tier. This method allows hatches to specify custom tier used for * structure check, while keeping {@link #mTier} for other uses. - * + * * @return Tier used for multiblock structure */ public byte getTierForStructure() { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchDataAccess.java index 18344082ea..38c3102ff2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchDataAccess.java @@ -14,20 +14,20 @@ import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_AssemblyLineUtils; +import gregtech.api.util.AssemblyLineUtils; -public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch implements IAddUIWidgets { +public class MTEHatchDataAccess extends MTEHatch implements IAddUIWidgets { private int timeout = 4; - public GT_MetaTileEntity_Hatch_DataAccess(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchDataAccess(int aID, String aName, String aNameRegional, int aTier) { super( aID, aName, @@ -38,12 +38,11 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch "Adds " + (aTier == 4 ? 4 : 16) + " extra slots for Data Sticks" }); } - public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchDataAccess(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatchDataAccess(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures); } @@ -79,12 +78,12 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_DataAccess(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchDataAccess(mName, mTier, mDescriptionArray, mTextures); } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -125,7 +124,7 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch super.loadNBTData(aNBT); if (aNBT.getByte("mSticksUpdated") != 1) { for (int i = 0; i < getSizeInventory(); i++) { - GT_AssemblyLineUtils.processDataStick(getStackInSlot(i)); + AssemblyLineUtils.processDataStick(getStackInSlot(i)); } } } @@ -140,7 +139,7 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) { super.setInventorySlotContents(aIndex, aStack); - GT_AssemblyLineUtils.processDataStick(aStack); + AssemblyLineUtils.processDataStick(aStack); } public List<ItemStack> getInventoryItems(Predicate<ItemStack> filter) { @@ -161,10 +160,10 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { if (mTier == 4) { getBaseMetaTileEntity() - .add2by2Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT); + .add2by2Slots(builder, getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_CIRCUIT); } else { getBaseMetaTileEntity() - .add4by4Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT); + .add4by4Slots(builder, getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_CIRCUIT); } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchDynamo.java index 8e621434db..00f46fe9eb 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchDynamo.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,9 +11,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch { +public class MTEHatchDynamo extends MTEHatch { - public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchDynamo(int aID, String aName, String aNameRegional, int aTier) { super( aID, aName, @@ -23,16 +23,15 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch { new String[] { "Generating electric Energy from Multiblocks", "Puts out up to 1 Amp" }); } - public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTEHatchDynamo(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) { super(aID, aName, aNameRegional, aTier, 0, aDescription); } - public GT_MetaTileEntity_Hatch_Dynamo(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchDynamo(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Dynamo(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchDynamo(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -93,7 +92,7 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Dynamo(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchDynamo(mName, mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchEnergy.java index d9be12671d..12d22d3bc7 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchEnergy.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,14 +11,13 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch { +public class MTEHatchEnergy extends MTEHatch { - public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTEHatchEnergy(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) { super(aID, aName, aNameRegional, aTier, 0, aDescription); } - public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchEnergy(int aID, String aName, String aNameRegional, int aTier) { super( aID, aName, @@ -28,21 +27,20 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch { new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" }); } - public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + public MTEHatchEnergy(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchEnergy(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchEnergy(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatchEnergy(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -108,7 +106,7 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Energy(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchEnergy(mName, mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInput.java index 705a3e6248..c660bcc8f8 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInput.java @@ -9,35 +9,34 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import gregtech.GT_Mod; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.GTMod; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; -public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { +public class MTEHatchInput extends MTEHatch { public RecipeMap<?> mRecipeMap = null; - public GT_MetaTileEntity_Hatch_Input(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchInput(int aID, String aName, String aNameRegional, int aTier) { this( aID, aName, aNameRegional, aTier, new String[] { "Fluid Input for Multiblocks", - "Capacity: " + GT_Utility.formatNumbers(8000L * (1L << aTier)) + "L" }); + "Capacity: " + GTUtility.formatNumbers(8000L * (1L << aTier)) + "L" }); } - public GT_MetaTileEntity_Hatch_Input(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTEHatchInput(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) { this(aID, 3, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_Hatch_Input(int aID, int aSlot, String aName, String aNameRegional, int aTier) { + public MTEHatchInput(int aID, int aSlot, String aName, String aNameRegional, int aTier) { this( aID, aSlot, @@ -45,16 +44,14 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { aNameRegional, aTier, new String[] { "Fluid Input for Multiblocks", "", "Can hold " + aSlot + " types of fluid." }); - mDescriptionArray[1] = "Capacity: " + GT_Utility.formatNumbers(getCapacityPerTank(aTier, aSlot)) + "L"; + mDescriptionArray[1] = "Capacity: " + GTUtility.formatNumbers(getCapacityPerTank(aTier, aSlot)) + "L"; } - public GT_MetaTileEntity_Hatch_Input(int aID, int aSlot, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTEHatchInput(int aID, int aSlot, String aName, String aNameRegional, int aTier, String[] aDescription) { super(aID, aName, aNameRegional, aTier, aSlot, aDescription); } - public GT_MetaTileEntity_Hatch_Input(int aID, String aName, String aNameRegional, int aTier, int allSlotCount, - String[] strings) { + public MTEHatchInput(int aID, String aName, String aNameRegional, int aTier, int allSlotCount, String[] strings) { super(aID, aName, aNameRegional, aTier, allSlotCount, strings); } @@ -62,29 +59,28 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { return (int) (8000L * (1L << aTier) / aSlot); } - public GT_MetaTileEntity_Hatch_Input(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchInput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Input(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Input(String aName, int aSlots, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatchInput(String aName, int aSlots, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aSlots, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @@ -106,7 +102,7 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Input(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchInput(mName, mTier, mDescriptionArray, mTextures); } @Override @@ -125,7 +121,7 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -181,7 +177,7 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { ItemStack aStack) { return side == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0 && (mRecipeMap == null || mRecipeMap.containsInput(aStack) - || mRecipeMap.containsInput(GT_Utility.getFluidForFilledItem(aStack, true))); + || mRecipeMap.containsInput(GTUtility.getFluidForFilledItem(aStack, true))); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java index 8c99e813e2..f4f04c38a3 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java @@ -22,9 +22,9 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; -import gregtech.GT_Mod; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.GTMod; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddUIWidgets; @@ -32,14 +32,13 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_ClientPreference; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTClientPreference; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import gregtech.api.util.GT_TooltipDataCache; -import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; -public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch - implements IConfigurationCircuitSupport, IAddUIWidgets { +public class MTEHatchInputBus extends MTEHatch implements IConfigurationCircuitSupport, IAddUIWidgets { private static final String SORTING_MODE_TOOLTIP = "GT5U.machines.sorting_mode.tooltip"; private static final String ONE_STACK_LIMIT_TOOLTIP = "GT5U.machines.one_stack_limit.tooltip"; @@ -51,16 +50,15 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch public boolean disableLimited = true; private int uiButtonCount = 0; - public GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier) { + public MTEHatchInputBus(int id, String name, String nameRegional, int tier) { this(id, name, nameRegional, tier, getSlots(tier) + 1); } - protected GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier, int slots, - String[] description) { + protected MTEHatchInputBus(int id, String name, String nameRegional, int tier, int slots, String[] description) { super(id, name, nameRegional, tier, slots, description); } - public GT_MetaTileEntity_Hatch_InputBus(int id, String name, String nameRegional, int tier, int slots) { + public MTEHatchInputBus(int id, String name, String nameRegional, int tier, int slots) { super( id, name, @@ -73,25 +71,24 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : ""))); } - public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchInputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { this(aName, aTier, getSlots(aTier) + 1, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, int aSlots, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatchInputBus(String aName, int aTier, int aSlots, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aSlots, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @@ -118,12 +115,12 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_InputBus(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchInputBus(mName, mTier, mDescriptionArray, mTextures); } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -140,7 +137,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch @Override public void initDefaultModes(NBTTagCompound aNBT) { if (!getBaseMetaTileEntity().getWorld().isRemote) { - GT_ClientPreference tPreference = GT_Mod.gregtechproxy + GTClientPreference tPreference = GTMod.gregtechproxy .getClientPreference(getBaseMetaTileEntity().getOwnerUuid()); if (tPreference != null) disableFilter = !tPreference.isInputBusInitialFilterEnabled(); } @@ -161,23 +158,23 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch protected void fillStacksIntoFirstSlots() { final int L = mInventory.length - 1; - HashMap<GT_Utility.ItemId, Integer> slots = new HashMap<>(L); - HashMap<GT_Utility.ItemId, ItemStack> stacks = new HashMap<>(L); - List<GT_Utility.ItemId> order = new ArrayList<>(L); + HashMap<GTUtility.ItemId, Integer> slots = new HashMap<>(L); + HashMap<GTUtility.ItemId, ItemStack> stacks = new HashMap<>(L); + List<GTUtility.ItemId> order = new ArrayList<>(L); List<Integer> validSlots = new ArrayList<>(L); for (int i = 0; i < L; i++) { if (!isValidSlot(i)) continue; validSlots.add(i); ItemStack s = mInventory[i]; if (s == null) continue; - GT_Utility.ItemId sID = GT_Utility.ItemId.createNoCopy(s); + GTUtility.ItemId sID = GTUtility.ItemId.createNoCopy(s); slots.merge(sID, s.stackSize, Integer::sum); if (!stacks.containsKey(sID)) stacks.put(sID, s); order.add(sID); mInventory[i] = null; } int slotindex = 0; - for (GT_Utility.ItemId sID : order) { + for (GTUtility.ItemId sID : order) { int toSet = slots.get(sID); if (toSet == 0) continue; int slot = validSlots.get(slotindex); @@ -227,13 +224,13 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch disableLimited = true; } } - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableSort." + disableSort) + " " + StatCollector.translateToLocal("GT5U.hatch.disableLimited." + disableLimited)); } else { disableFilter = !disableFilter; - GT_Utility + GTUtility .sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter)); } } @@ -255,7 +252,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch protected boolean limitedAllowPutStack(int aIndex, ItemStack aStack) { for (int i = 0; i < getSizeInventory(); i++) - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get_nocopy(aStack), mInventory[i])) return i == aIndex; + if (GTUtility.areStacksEqual(GTOreDictUnificator.get_nocopy(aStack), mInventory[i])) return i == aIndex; return mInventory[aIndex] == null; } @@ -274,7 +271,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch createToggleButton( () -> !disableSort, val -> disableSort = !val, - GT_UITextures.OVERLAY_BUTTON_SORTING_MODE, + GTUITextures.OVERLAY_BUTTON_SORTING_MODE, () -> mTooltipCache.getData(SORTING_MODE_TOOLTIP))); } @@ -282,7 +279,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch builder.widget(createToggleButton(() -> !disableLimited, val -> { disableLimited = !val; updateSlots(); - }, GT_UITextures.OVERLAY_BUTTON_ONE_STACK_LIMIT, () -> mTooltipCache.getData(ONE_STACK_LIMIT_TOOLTIP))); + }, GTUITextures.OVERLAY_BUTTON_ONE_STACK_LIMIT, () -> mTooltipCache.getData(ONE_STACK_LIMIT_TOOLTIP))); } @Override @@ -309,7 +306,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch Supplier<GT_TooltipDataCache.TooltipData> tooltipDataSupplier) { return new CycleButtonWidget().setToggle(getter, setter) .setStaticTexture(picture) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setVariableBackground(GTUITextures.BUTTON_STANDARD_TOGGLE) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(7 + (uiButtonCount++ * BUTTON_SIZE), 62) .setSize(BUTTON_SIZE, BUTTON_SIZE) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MagHatch.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMagnet.java index 8a462d12c6..660894d0df 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MagHatch.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMagnet.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.AuthorFourIsTheNumber; +import static gregtech.api.enums.GTValues.AuthorFourIsTheNumber; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_EMS_HOUSING; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_EMS_HOUSING_GLOW; @@ -13,20 +13,20 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_IndustrialElectromagneticSeparator; +import gregtech.common.tileentities.machines.multi.MTEIndustrialElectromagneticSeparator; -public class GT_MetaTileEntity_MagHatch extends GT_MetaTileEntity_Hatch { +public class MTEHatchMagnet extends MTEHatch { - public GT_MetaTileEntity_MagHatch(int aID, String aName, String aNameRegional) { + public MTEHatchMagnet(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 5, 1, "Holds electromagnet for the Magnetic Flux Exhibitor"); } - public GT_MetaTileEntity_MagHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchMagnet(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription[0], aTextures); } @@ -48,8 +48,7 @@ public class GT_MetaTileEntity_MagHatch extends GT_MetaTileEntity_Hatch { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inventoryHandler, 0) - .setFilter(GT_MetaTileEntity_IndustrialElectromagneticSeparator::isValidElectromagnet) + new SlotWidget(inventoryHandler, 0).setFilter(MTEIndustrialElectromagneticSeparator::isValidElectromagnet) .setAccess(true, true) .setPos(79, 34)); } @@ -61,7 +60,7 @@ public class GT_MetaTileEntity_MagHatch extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -98,6 +97,6 @@ public class GT_MetaTileEntity_MagHatch extends GT_MetaTileEntity_Hatch { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_MagHatch(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchMagnet(mName, mTier, mDescriptionArray, mTextures); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java index 8a4d718244..3a715a541a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMaintenance.java @@ -31,25 +31,25 @@ import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.common.network.NetworkRegistry; -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.enums.OrePrefixes; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTUtility; import ic2.core.IHasGui; import ic2.core.item.ItemToolbox; -public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch implements IAddUIWidgets, IAlignment { +public class MTEHatchMaintenance extends MTEHatch implements IAddUIWidgets, IAlignment { private Rotation rotation = Rotation.NORMAL; @@ -57,23 +57,22 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false, mAuto; - public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchMaintenance(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, "For maintaining Multiblocks"); mAuto = false; } - public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier, boolean aAuto) { + public MTEHatchMaintenance(int aID, String aName, String aNameRegional, int aTier, boolean aAuto) { super(aID, aName, aNameRegional, aTier, 4, "For automatically maintaining Multiblocks"); mAuto = aAuto; } - public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - boolean aAuto) { + public MTEHatchMaintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures, boolean aAuto) { super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures); mAuto = aAuto; } - public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, + public MTEHatchMaintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, boolean aAuto) { super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures); mAuto = aAuto; @@ -81,9 +80,9 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch private static ItemStack[] getAutoMaintenanceInputs() { if (sAutoMaintenanceInputs == null) sAutoMaintenanceInputs = new ItemStack[] { ItemList.Duct_Tape.get(4), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.HV, 2) }; + GTOreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2), + GTOreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4), + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.HV, 2) }; return sAutoMaintenanceInputs; } @@ -164,14 +163,14 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch @Override public boolean isValidSlot(int aIndex) { - return mAuto && GT_Mod.gregtechproxy.mAMHInteraction; + return mAuto && GTMod.gregtechproxy.mAMHInteraction; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { if (aTileEntity.getMetaTileID() == 111) - return new GT_MetaTileEntity_Hatch_Maintenance(mName, mTier, mDescriptionArray, mTextures, true); - return new GT_MetaTileEntity_Hatch_Maintenance(mName, mTier, mDescriptionArray, mTextures, false); + return new MTEHatchMaintenance(mName, mTier, mDescriptionArray, mTextures, true); + return new MTEHatchMaintenance(mName, mTier, mDescriptionArray, mTextures, false); } @Override @@ -193,9 +192,9 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch if (--tStack.stackSize == 0) { aPlayer.inventory.mainInventory[aPlayer.inventory.currentItem] = null; } - } else GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + } else GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); } else { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); } return true; } @@ -248,8 +247,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch amt = tStack.stackSize; boolean temp = true; for (ItemStack aStack : mInventory) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) - || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) { + if ((GTUtility.areUnificationsEqual(aStack, tStack, true) + || GTUtility.areUnificationsEqual(GTOreDictUnificator.get(false, aStack), tStack, true))) { amt -= aStack.stackSize; if (amt < 1) { temp = false; @@ -266,8 +265,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch if (tStack != null) { amt = tStack.stackSize; for (ItemStack aStack : mInventory) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility - .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) { + if ((GTUtility.areUnificationsEqual(aStack, tStack, true) + || GTUtility.areUnificationsEqual(GTOreDictUnificator.get(false, aStack), tStack, true))) { if (aStack.stackSize < amt) { amt -= aStack.stackSize; aStack.stackSize = 0; @@ -300,26 +299,25 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch return; } - if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList) && !mWrench - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mWrench = true; - if (GT_Utility.isStackInList(aStack, GregTech_API.sScrewdriverList) && !mScrewdriver - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mScrewdriver = true; - if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList) && !mSoftHammer - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mSoftHammer = true; - if (GT_Utility.isStackInList(aStack, GregTech_API.sHardHammerList) && !mHardHammer - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mHardHammer = true; - if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList) && !mCrowbar - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true; - if (!mSolderingTool && GT_ModHandler.useSolderingIron(aStack, aPlayer, aToolboxInventory)) - mSolderingTool = true; - if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "craftingDuctTape")) { + if (GTUtility.isStackInList(aStack, GregTechAPI.sWrenchList) && !mWrench + && GTModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mWrench = true; + if (GTUtility.isStackInList(aStack, GregTechAPI.sScrewdriverList) && !mScrewdriver + && GTModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mScrewdriver = true; + if (GTUtility.isStackInList(aStack, GregTechAPI.sSoftHammerList) && !mSoftHammer + && GTModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mSoftHammer = true; + if (GTUtility.isStackInList(aStack, GregTechAPI.sHardHammerList) && !mHardHammer + && GTModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mHardHammer = true; + if (GTUtility.isStackInList(aStack, GregTechAPI.sCrowbarList) && !mCrowbar + && GTModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true; + if (!mSolderingTool && GTModHandler.useSolderingIron(aStack, aPlayer, aToolboxInventory)) mSolderingTool = true; + if (GTOreDictUnificator.isItemStackInstanceOf(aStack, "craftingDuctTape")) { mWrench = mScrewdriver = mSoftHammer = mHardHammer = mCrowbar = mSolderingTool = true; getBaseMetaTileEntity().setActive(false); aStack.stackSize--; } if (mSolderingTool && aPlayer instanceof EntityPlayerMP tPlayer) { try { - GT_Mod.achievements.issueAchievement(tPlayer, "maintainance"); + GTMod.achievements.issueAchievement(tPlayer, "maintainance"); } catch (Exception ignored) {} } } @@ -343,20 +341,18 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { - return mAuto && GT_Mod.gregtechproxy.mAMHInteraction; + return mAuto && GTMod.gregtechproxy.mAMHInteraction; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { - if (mAuto && GT_Mod.gregtechproxy.mAMHInteraction) { - for (int i = 0; i < getSizeInventory(); i++) if (GT_Utility.areStacksEqual( - GT_OreDictUnificator.get(false, aStack), - GT_OreDictUnificator.get(false, getStackInSlot(i)))) return i == aIndex; - for (ItemStack tInput : getAutoMaintenanceInputs()) - if (GT_Utility.areUnificationsEqual(tInput, aStack, true) - || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true)) - return true; + if (mAuto && GTMod.gregtechproxy.mAMHInteraction) { + for (int i = 0; i < getSizeInventory(); i++) if (GTUtility.areStacksEqual( + GTOreDictUnificator.get(false, aStack), + GTOreDictUnificator.get(false, getStackInSlot(i)))) return i == aIndex; + for (ItemStack tInput : getAutoMaintenanceInputs()) if (GTUtility.areUnificationsEqual(tInput, aStack, true) + || GTUtility.areUnificationsEqual(GTOreDictUnificator.get(false, aStack), tInput, true)) return true; } return false; } @@ -367,7 +363,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch getBaseMetaTileEntity().add2by2Slots(builder); } else { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE) + new DrawableWidget().setDrawable(GTUITextures.SLOT_MAINTENANCE) .setPos(78, 33) .setSize(20, 20)) .widget(new SlotWidget(BaseSlot.empty()) { @@ -389,7 +385,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } } }.disableShiftInsert() - .setBackground(GT_UITextures.TRANSPARENT) + .setBackground(GTUITextures.TRANSPARENT) .setPos(79, 34)) .widget( new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get()) @@ -427,7 +423,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch changed = true; } if (changed) { - if (base.isServerSide() && !GregTech_API.isDummyWorld(base.getWorld())) { + if (base.isServerSide() && !GregTechAPI.isDummyWorld(base.getWorld())) { StructureLibAPI.sendAlignment( (IAlignmentProvider) base, new NetworkRegistry.TargetPoint( diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java index 8707d0f804..179ba56254 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java @@ -10,20 +10,20 @@ import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GTLanguageManager; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.GT_Pollution; +import gregtech.common.Pollution; @SuppressWarnings("unused") // Unused API is expected within scope -public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { +public class MTEHatchMuffler extends MTEHatch { - private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( + private static final String localizedDescFormat = GTLanguageManager.addStringLocalization( "gt.blockmachines.hatch.muffler.desc.format", "Outputs the Pollution (Might cause ... things)%n" + "DO NOT OBSTRUCT THE OUTPUT!%n" + "Reduces Pollution to %d%%%n" @@ -33,24 +33,24 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { private final String[] description = String.format(localizedDescFormat, pollutionReduction, pollutionRecover) .split("\\R"); - public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchMuffler(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, ""); } - public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + public MTEHatchMuffler(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchMuffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { this(aName, aTier, new String[] { aDescription }, aTextures); } - public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchMuffler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { this(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, int aInvSlotCount, String[] aDescription, + public MTEHatchMuffler(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Muffler(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchMuffler(mName, mTier, mDescriptionArray, mTextures); } @Override @@ -124,7 +124,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { boolean chk1, chk2, chk3; float ran1 = XSTR_INSTANCE.nextFloat(), ran2, ran3; chk1 = ran1 * 100 < calculatePollutionReduction(100); - if (GT_Pollution.getPollution(getBaseMetaTileEntity()) >= GT_Mod.gregtechproxy.mPollutionSmogLimit) { + if (Pollution.getPollution(getBaseMetaTileEntity()) >= GTMod.gregtechproxy.mPollutionSmogLimit) { ran2 = XSTR_INSTANCE.nextFloat(); ran3 = XSTR_INSTANCE.nextFloat(); chk2 = ran2 * 100 < calculatePollutionReduction(100); @@ -200,7 +200,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { */ public boolean polluteEnvironment(MetaTileEntity mte) { if (getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing())) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), calculatePollutionReduction(10000)); + Pollution.addPollution(getBaseMetaTileEntity(), calculatePollutionReduction(10000)); return true; } return false; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMultiInput.java index 267c2d0f1c..9bf061573b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMultiInput.java @@ -20,20 +20,20 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_Input implements IAddUIWidgets { +public class MTEHatchMultiInput extends MTEHatchInput implements IAddUIWidgets { private final FluidStack[] mStoredFluid; private final FluidStackTank[] fluidTanks; public final int mCapacityPer; - public GT_MetaTileEntity_Hatch_MultiInput(int aID, int aSlot, String aName, String aNameRegional, int aTier) { + public MTEHatchMultiInput(int aID, int aSlot, String aName, String aNameRegional, int aTier) { super(aID, aSlot, aName, aNameRegional, aTier); this.mStoredFluid = new FluidStack[aSlot]; fluidTanks = new FluidStackTank[aSlot]; mCapacityPer = getCapacityPerTank(aTier, aSlot); } - public GT_MetaTileEntity_Hatch_MultiInput(int aID, int aSlot, String aName, String aNameRegional, int aTier, + public MTEHatchMultiInput(int aID, int aSlot, String aName, String aNameRegional, int aTier, String[] aDescription) { super(aID, aSlot, aName, aNameRegional, aTier, aDescription); this.mStoredFluid = new FluidStack[aSlot]; @@ -41,8 +41,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_ mCapacityPer = getCapacityPerTank(aTier, aSlot); } - public GT_MetaTileEntity_Hatch_MultiInput(String aName, int aSlot, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + public MTEHatchMultiInput(String aName, int aSlot, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aSlot, aTier, aDescription, aTextures); this.mStoredFluid = new FluidStack[aSlot]; fluidTanks = new FluidStackTank[aSlot]; @@ -58,7 +57,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_ @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_MultiInput(mName, getMaxType(), mTier, mDescriptionArray, mTextures); + return new MTEHatchMultiInput(mName, getMaxType(), mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java index 2aa2410bd1..3a9dd0dc96 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java @@ -26,9 +26,9 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; -import gregtech.GT_Mod; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.GTMod; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.fluid.IFluidStore; import gregtech.api.interfaces.metatileentity.IFluidLockable; @@ -36,18 +36,17 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; import gregtech.common.gui.modularui.widget.FluidLockWidget; -public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch - implements IFluidStore, IFluidLockable, IAddUIWidgets { +public class MTEHatchOutput extends MTEHatch implements IFluidStore, IFluidLockable, IAddUIWidgets { private String lockedFluidName = null; private WeakReference<EntityPlayer> playerThatLockedfluid = null; public byte mMode = 0; - public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchOutput(int aID, String aName, String aNameRegional, int aTier) { super( aID, aName, @@ -55,40 +54,39 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch aTier, 4, new String[] { "Fluid Output for Multiblocks", - "Capacity: " + GT_Utility.formatNumbers(8000L * (1L << aTier)) + "L", + "Capacity: " + GTUtility.formatNumbers(8000L * (1L << aTier)) + "L", "Right click with screwdriver to restrict output", "Can be restricted to put out Items and/or Steam/No Steam/1 specific Fluid", "Restricted Output Hatches are given priority for Multiblock Fluid output" }); } - public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTEHatchOutput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchOutput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + public MTEHatchOutput(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, int inventorySize) { super(aID, aName, aNameRegional, aTier, inventorySize, aDescription); } - public GT_MetaTileEntity_Hatch_Output(String name, int tier, int slots, String[] description, - ITexture[][][] textures) { + public MTEHatchOutput(String name, int tier, int slots, String[] description, ITexture[][][] textures) { super(name, tier, slots, description, textures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @@ -115,12 +113,12 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Output(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchOutput(mName, mTier, mDescriptionArray, mTextures); } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -131,7 +129,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch IFluidHandler tTileEntity = aBaseMetaTileEntity .getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); if (tTileEntity != null) { - GT_Utility.moveFluid( + GTUtility.moveFluid( aBaseMetaTileEntity, tTileEntity, aBaseMetaTileEntity.getFrontFacing(), @@ -157,7 +155,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch if (isFluidLocked()) { lockedFluidName = aNBT.getString("lockedFluidName"); } - lockedFluidName = GT_Utility.isStringInvalid(lockedFluidName) ? null : lockedFluidName; + lockedFluidName = GTUtility.isStringInvalid(lockedFluidName) ? null : lockedFluidName; } @Override @@ -229,42 +227,42 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch final String inBrackets; switch (mMode) { case 0 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("108", "Outputs misc. Fluids, Steam and Items")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("108", "Outputs misc. Fluids, Steam and Items")); this.setLockedFluidName(null); } case 1 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("109", "Outputs Steam and Items")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("109", "Outputs Steam and Items")); this.setLockedFluidName(null); } case 2 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("110", "Outputs Steam and misc. Fluids")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("110", "Outputs Steam and misc. Fluids")); this.setLockedFluidName(null); } case 3 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("111", "Outputs Steam")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("111", "Outputs Steam")); this.setLockedFluidName(null); } case 4 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("112", "Outputs misc. Fluids and Items")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("112", "Outputs misc. Fluids and Items")); this.setLockedFluidName(null); } case 5 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("113", "Outputs only Items")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("113", "Outputs only Items")); this.setLockedFluidName(null); } case 6 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("114", "Outputs only misc. Fluids")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("114", "Outputs only misc. Fluids")); this.setLockedFluidName(null); } case 7 -> { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("115", "Outputs nothing")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("115", "Outputs nothing")); this.setLockedFluidName(null); } case 8 -> { playerThatLockedfluid = new WeakReference<>(aPlayer); if (mFluid == null) { this.setLockedFluidName(null); - inBrackets = GT_Utility.trans( + inBrackets = GTUtility.trans( "115.3", "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); } else { @@ -275,18 +273,16 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch inBrackets = this.getDrainableStack() .getLocalizedName(); } - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - String.format( - "%s (%s)", - GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), - inBrackets)); + String + .format("%s (%s)", GTUtility.trans("151.1", "Outputs items and 1 specific Fluid"), inBrackets)); } case 9 -> { playerThatLockedfluid = new WeakReference<>(aPlayer); if (mFluid == null) { this.setLockedFluidName(null); - inBrackets = GT_Utility.trans( + inBrackets = GTUtility.trans( "115.3", "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); } else { @@ -297,9 +293,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch inBrackets = this.getDrainableStack() .getLocalizedName(); } - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - String.format("%s (%s)", GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets)); + String.format("%s (%s)", GTUtility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets)); } } } @@ -317,11 +313,11 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch if (getLockedFluidName() != null && !getLockedFluidName().equals( tFluid.getFluid() .getName())) { - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, String.format( "%s %s", - GT_Utility.trans( + GTUtility.trans( "151.3", "Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"), StatCollector.translateToLocal(getLockedFluidName()))); @@ -329,17 +325,17 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch setLockedFluidName( tFluid.getFluid() .getName()); - if (mMode == 8) GT_Utility.sendChatToPlayer( + if (mMode == 8) GTUtility.sendChatToPlayer( aPlayer, String.format( "%s (%s)", - GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), + GTUtility.trans("151.1", "Outputs items and 1 specific Fluid"), tFluid.getLocalizedName())); - else GT_Utility.sendChatToPlayer( + else GTUtility.sendChatToPlayer( aPlayer, String.format( "%s (%s)", - GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), + GTUtility.trans("151.2", "Outputs 1 specific Fluid"), tFluid.getLocalizedName())); } return true; @@ -412,7 +408,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch @Override public boolean canStoreFluid(@Nonnull FluidStack fluidStack) { - if (mFluid != null && !GT_Utility.areFluidsEqual(mFluid, fluidStack)) { + if (mFluid != null && !GTUtility.areFluidsEqual(mFluid, fluidStack)) { return false; } if (isFluidLocked()) { @@ -423,7 +419,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch fluidStack.getFluid() .getName()); } - if (GT_ModHandler.isSteam(fluidStack)) { + if (GTModHandler.isSteam(fluidStack)) { return outputsSteam(); } return outputsLiquids(); @@ -442,9 +438,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch .getName()); final EntityPlayer player; if (playerThatLockedfluid == null || (player = playerThatLockedfluid.get()) == null) return; - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( player, - String.format(GT_Utility.trans("151.4", "Successfully locked Fluid to %s"), mFluid.getLocalizedName())); + String.format(GTUtility.trans("151.4", "Successfully locked Fluid to %s"), mFluid.getLocalizedName())); playerThatLockedfluid = null; } } @@ -459,12 +455,12 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch return new String[] { EnumChatFormatting.BLUE + "Output Hatch" + EnumChatFormatting.RESET, "Stored Fluid:", EnumChatFormatting.GOLD + (mFluid == null ? "No Fluid" : mFluid.getLocalizedName()) + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid == null ? 0 : mFluid.amount) + EnumChatFormatting.GREEN + GTUtility.formatNumbers(mFluid == null ? 0 : mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) + + GTUtility.formatNumbers(getCapacity()) + " L" + EnumChatFormatting.RESET, (!isFluidLocked() || lockedFluidName == null) ? "Not Locked" @@ -477,7 +473,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_SCREEN_BLACK) .setPos(98, 16) .setSize(71, 45)) .widget(new FluidLockWidget(this).setPos(149, 41)) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutputBus.java index 0bfe55cac1..31973f935b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutputBus.java @@ -2,7 +2,7 @@ package gregtech.api.metatileentity.implementations; import static gregtech.api.enums.Textures.BlockIcons.ITEM_OUT_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; +import static gregtech.api.util.GTUtility.moveMultipleItemStacks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -18,10 +18,10 @@ import com.gtnewhorizons.modularui.api.forge.ItemHandlerHelper; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.ItemList; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.widgets.GT_PhantomItemButton; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.widgets.PhantomItemButton; import gregtech.api.interfaces.IDataCopyable; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IItemLockable; @@ -29,22 +29,21 @@ import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.extensions.ArrayExt; -public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch - implements IAddUIWidgets, IItemLockable, IDataCopyable { +public class MTEHatchOutputBus extends MTEHatch implements IAddUIWidgets, IItemLockable, IDataCopyable { private static final String DATA_STICK_DATA_TYPE = "outputBusFilter"; private static final String LOCKED_ITEM_NBT_KEY = "lockedItem"; protected ItemStack lockedItem = null; - public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier) { + public MTEHatchOutputBus(int aID, String aName, String aNameRegional, int aTier) { this(aID, aName, aNameRegional, aTier, getSlots(aTier)); } - public GT_MetaTileEntity_Hatch_OutputBus(int id, String name, String nameRegional, int tier, int slots) { + public MTEHatchOutputBus(int id, String name, String nameRegional, int tier, int slots) { super( id, name, @@ -58,35 +57,33 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch "Right click with data stick to load filter config")); } - public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTEHatchOutputBus(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) { super(aID, aName, aNameRegional, aTier, getSlots(aTier), aDescription); } - public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, int inventorySize) { + public MTEHatchOutputBus(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + int inventorySize) { super(aID, aName, aNameRegional, aTier, inventorySize, aDescription); } - public GT_MetaTileEntity_Hatch_OutputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEHatchOutputBus(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, getSlots(aTier), aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_OutputBus(String name, int tier, int slots, String[] description, - ITexture[][][] textures) { + public MTEHatchOutputBus(String name, int tier, int slots, String[] description, ITexture[][][] textures) { super(name, tier, slots, description, textures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch + return GTMod.gregtechproxy.mRenderIndicatorsOnHatch ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @@ -113,19 +110,19 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OutputBus(mName, mTier, mDescriptionArray, mTextures); + return new MTEHatchOutputBus(mName, mTier, mDescriptionArray, mTextures); } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (!acceptsItemLock() || !(aPlayer instanceof EntityPlayerMP)) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return super.onRightclick(aBaseMetaTileEntity, aPlayer); } final ItemStack dataStick = aPlayer.inventory.getCurrentItem(); if (!ItemList.Tool_DataStick.isStackEqual(dataStick, false, true)) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return super.onRightclick(aBaseMetaTileEntity, aPlayer); } @@ -197,7 +194,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch for (int i = 0, mInventoryLength = mInventory.length; i < mInventoryLength && aStack.stackSize > 0; i++) { ItemStack tSlot = mInventory[i]; - if (GT_Utility.isStackInvalid(tSlot)) { + if (GTUtility.isStackInvalid(tSlot)) { int tRealStackLimit = Math.min(getInventoryStackLimit(), aStack.getMaxStackSize()); if (aStack.stackSize <= tRealStackLimit) { mInventory[i] = aStack; @@ -286,8 +283,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch if (acceptsItemLock()) { builder.widget( - new GT_PhantomItemButton(this).setPos(getGUIWidth() - 25, 40) - .setBackground(GT_PhantomItemButton.FILTER_BACKGROUND)); + new PhantomItemButton(this).setPos(getGUIWidth() - 25, 40) + .setBackground(PhantomItemButton.FILTER_BACKGROUND)); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_QuadrupleHumongous.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchQuadrupleHumongous.java index e0ab7acf95..b0040d0c6a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_QuadrupleHumongous.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchQuadrupleHumongous.java @@ -4,13 +4,13 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -public class GT_MetaTileEntity_Hatch_QuadrupleHumongous extends GT_MetaTileEntity_Hatch_MultiInput { +public class MTEHatchQuadrupleHumongous extends MTEHatchMultiInput { - public GT_MetaTileEntity_Hatch_QuadrupleHumongous(int aID, int aSlot, String aName, String aNameRegional) { + public MTEHatchQuadrupleHumongous(int aID, int aSlot, String aName, String aNameRegional) { super(aID, aSlot, aName, aNameRegional, 13); } - public GT_MetaTileEntity_Hatch_QuadrupleHumongous(String aName, int aSlot, int aTier, String[] aDescription, + public MTEHatchQuadrupleHumongous(String aName, int aSlot, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aSlot, aTier, aDescription, aTextures); } @@ -22,6 +22,6 @@ public class GT_MetaTileEntity_Hatch_QuadrupleHumongous extends GT_MetaTileEntit @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_QuadrupleHumongous(mName, getMaxType(), mTier, mDescriptionArray, mTextures); + return new MTEHatchQuadrupleHumongous(mName, getMaxType(), mTier, mDescriptionArray, mTextures); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java index 660230660e..ba804e834e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; +import static gregtech.api.enums.GTValues.ALL_VALID_SIDES; import static gregtech.api.enums.Textures.BlockIcons.PIPE_RESTRICTOR; import java.util.ArrayList; @@ -20,9 +20,9 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -33,14 +33,14 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_CoverBehaviorBase; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.CoverBehaviorBase; +import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import gregtech.common.covers.CoverInfo; -public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileEntityItemPipe { +public class MTEItem extends MetaPipeEntity implements IMetaTileEntityItemPipe { public final float mThickNess; public final Materials mMaterial; @@ -52,7 +52,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE public boolean mIsRestrictive = false; private int[] cacheSides; - public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, + public MTEItem(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) { super(aID, aName, aNameRegional, aInvSlotCount, false); mIsRestrictive = aIsRestrictive; @@ -63,12 +63,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE addInfo(aID); } - public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, + public MTEItem(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aInvSlotCount, aStepSize, aIsRestrictive, 20); } - public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, + public MTEItem(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) { super(aName, aInvSlotCount); mIsRestrictive = aIsRestrictive; @@ -85,14 +85,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaPipeEntity_Item( - mName, - mThickNess, - mMaterial, - mInventory.length, - mStepSize, - mIsRestrictive, - mTickTime); + return new MTEItem(mName, mThickNess, mMaterial, mInventory.length, mStepSize, mIsRestrictive, mTickTime); } @Override @@ -191,13 +184,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setByte("mLastReceivedFrom", (byte) mLastReceivedFrom.ordinal()); - if (GT_Mod.gregtechproxy.gt6Pipe) aNBT.setByte("mConnections", mConnections); + if (GTMod.gregtechproxy.gt6Pipe) aNBT.setByte("mConnections", mConnections); } @Override public void loadNBTData(NBTTagCompound aNBT) { mLastReceivedFrom = ForgeDirection.getOrientation(aNBT.getByte("mLastReceivedFrom")); - if (GT_Mod.gregtechproxy.gt6Pipe) { + if (GTMod.gregtechproxy.gt6Pipe) { mConnections = aNBT.getByte("mConnections"); } } @@ -211,7 +204,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE mCurrentTransferStartTick = 0; } - if (!GT_Mod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections(); + if (!GTMod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections(); if (oLastReceivedFrom == mLastReceivedFrom) { doTickProfilingInThisTick = false; @@ -221,7 +214,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck();) { temp = false; tPipeList.clear(); - for (IMetaTileEntityItemPipe tTileEntity : GT_Utility + for (IMetaTileEntityItemPipe tTileEntity : GTUtility .sortMapByValuesAcending( IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false)) .keySet()) { @@ -242,13 +235,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ) { - if (GT_Mod.gregtechproxy.gt6Pipe) { - final ForgeDirection tSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + if (GTMod.gregtechproxy.gt6Pipe) { + final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); if (isConnectedAtSide(tSide)) { disconnect(tSide); - GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("215", "Disconnected")); + GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("215", "Disconnected")); } else { - if (connect(tSide) > 0) GT_Utility.sendChatToPlayer(entityPlayer, GT_Utility.trans("214", "Connected")); + if (connect(tSide) > 0) GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("214", "Connected")); } return true; } @@ -256,25 +249,25 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsIn(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsIn(side, aCoverID, aCoverVariable, -1, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, + public boolean letsOut(CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsOut(side, aCoverID, aCoverVariable, -1, aTileEntity); } @Override - public boolean letsIn(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsIn(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsIn(side, aCoverID, aCoverVariable, -1, aTileEntity); } @Override - public boolean letsOut(GT_CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, + public boolean letsOut(CoverBehaviorBase<?> coverBehavior, ForgeDirection side, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsOut(side, aCoverID, aCoverVariable, -1, aTileEntity); } @@ -294,7 +287,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (tileEntity == null) return false; final ForgeDirection oppositeSide = side.getOpposite(); - boolean connectable = GT_Utility.isConnectableNonInventoryPipe(tileEntity, oppositeSide); + boolean connectable = GTUtility.isConnectableNonInventoryPipe(tileEntity, oppositeSide); final IGregTechTileEntity gTileEntity = (tileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tileEntity @@ -322,7 +315,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public boolean getGT6StyleConnection() { // Yes if GT6 pipes are enabled - return GT_Mod.gregtechproxy.gt6Pipe; + return GTMod.gregtechproxy.gt6Pipe; } @Override @@ -356,7 +349,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser)) || getBaseMetaTileEntity().getMetaIDAtSide(side) != side.getOpposite() .ordinal()) { - return GT_Utility.moveMultipleItemStacks( + return GTUtility.moveMultipleItemStacks( aSender, tInventory, ForgeDirection.UNKNOWN, @@ -419,7 +412,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (cacheSides == null) cacheSides = super.getAccessibleSlotsFromSide(ordinalSide); return cacheSides; } else { - return GT_Values.emptyIntArray; + return GTValues.emptyIntArray; } } @@ -440,13 +433,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public String[] getDescription() { if (mTickTime == 20) return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Routing Value: %%%" + GTUtility.formatNumbers(mStepSize) }; else if (mTickTime % 20 == 0) return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Routing Value: %%%" + GTUtility.formatNumbers(mStepSize) }; else return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Routing Value: %%%" + GTUtility.formatNumbers(mStepSize) }; } private boolean isInventoryEmpty() { @@ -456,13 +449,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public float getThickNess() { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F; + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x1) != 0) return 0.0625F; return mThickNess; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1); else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @@ -522,7 +515,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); - if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { + if (GTMod.instance.isClientSide() && (GTClient.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 6c2df9b082..ab70cf25ae 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -1,9 +1,9 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; -import static gregtech.api.util.GT_Utility.filterValidMTEs; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.enums.GTValues.VN; +import static gregtech.api.util.GTUtility.filterValidMTEs; +import static gregtech.api.util.GTUtility.formatNumbers; import static mcp.mobius.waila.api.SpecialChars.GREEN; import static mcp.mobius.waila.api.SpecialChars.RED; import static mcp.mobius.waila.api.SpecialChars.RESET; @@ -59,63 +59,63 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.SoundResource; import gregtech.api.enums.VoidingMode; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.fluid.IFluidStore; import gregtech.api.interfaces.metatileentity.IItemLockable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.modularui.ControllerWithOptionalFeatures; import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.modularui.IBindPlayerInventoryUI; +import gregtech.api.interfaces.modularui.IControllerWithOptionalFeatures; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTItemStack; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SingleRecipeCheck; -import gregtech.api.util.GT_ClientPreference; -import gregtech.api.util.GT_ExoticEnergyInputHelper; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Waila; +import gregtech.api.util.ExoticEnergyInputHelper; +import gregtech.api.util.GTClientPreference; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; +import gregtech.api.util.GTWaila; import gregtech.api.util.OutputHatchWrapper; +import gregtech.api.util.OverclockCalculator; +import gregtech.api.util.ParallelHelper; import gregtech.api.util.VoidProtectionHelper; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; -import gregtech.client.GT_SoundLoop; -import gregtech.common.GT_Pollution; +import gregtech.client.GTSoundLoop; +import gregtech.common.Pollution; import gregtech.common.config.machinestats.ConfigMachines; import gregtech.common.gui.modularui.widget.CheckRecipeResultSyncer; import gregtech.common.gui.modularui.widget.ShutDownReasonSyncer; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_CraftingInput_ME; -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.GT_MetaTileEntity_Hatch_OutputBus_ME; -import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME; +import gregtech.common.items.MetaGeneratedTool01; import gregtech.common.tileentities.machines.IDualInputHatch; import gregtech.common.tileentities.machines.IDualInputInventory; import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; import gregtech.common.tileentities.machines.ISmartInputHatch; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; +import gregtech.common.tileentities.machines.MTEHatchCraftingInputME; +import gregtech.common.tileentities.machines.MTEHatchInputBusME; +import gregtech.common.tileentities.machines.MTEHatchInputME; +import gregtech.common.tileentities.machines.MTEHatchOutputBusME; +import gregtech.common.tileentities.machines.MTEHatchOutputME; +import gregtech.common.tileentities.machines.multi.MTELargeTurbine; import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap; import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; -public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity - implements ControllerWithOptionalFeatures, IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI { +public abstract class MTEMultiBlockBase extends MetaTileEntity + implements IControllerWithOptionalFeatures, IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI { public static boolean disableMaintenance; public boolean hasMaintenanceChecks = getDefaultHasMaintenanceChecks(); @@ -146,20 +146,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity protected static final String BATCH_MODE_NBT_KEY = "batchMode"; protected SingleRecipeCheck mSingleRecipeCheck = null; - public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<>(); + public ArrayList<MTEHatchInput> mInputHatches = new ArrayList<>(); + public ArrayList<MTEHatchOutput> mOutputHatches = new ArrayList<>(); + public ArrayList<MTEHatchInputBus> mInputBusses = new ArrayList<>(); + public ArrayList<MTEHatchOutputBus> mOutputBusses = new ArrayList<>(); public ArrayList<IDualInputHatch> mDualInputHatches = new ArrayList<>(); public ArrayList<ISmartInputHatch> mSmartInputHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<>(); - public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<>(); - protected List<GT_MetaTileEntity_Hatch> mExoticEnergyHatches = new ArrayList<>(); + public ArrayList<MTEHatchDynamo> mDynamoHatches = new ArrayList<>(); + public ArrayList<MTEHatchMuffler> mMufflerHatches = new ArrayList<>(); + public ArrayList<MTEHatchEnergy> mEnergyHatches = new ArrayList<>(); + public ArrayList<MTEHatchMaintenance> mMaintenanceHatches = new ArrayList<>(); + protected List<MTEHatch> mExoticEnergyHatches = new ArrayList<>(); protected final ProcessingLogic processingLogic; @SideOnly(Side.CLIENT) - protected GT_SoundLoop activitySoundLoop; + protected GTSoundLoop activitySoundLoop; protected long mLastWorkingTick = 0, mTotalRunTime = 0; private static final int CHECK_INTERVAL = 100; // How often should we check for a new recipe on an idle machine? @@ -168,27 +168,27 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity protected static final byte INTERRUPT_SOUND_INDEX = 8; protected static final byte PROCESS_START_SOUND_INDEX = 1; - public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) { + public MTEMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 2); this.processingLogic = null; - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; + MTEMultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; this.damageFactorLow = ConfigMachines.damageFactorLow; this.damageFactorHigh = ConfigMachines.damageFactorHigh; this.mNEI = ""; if (!shouldCheckMaintenance()) fixAllIssues(); } - public GT_MetaTileEntity_MultiBlockBase(String aName) { + public MTEMultiBlockBase(String aName) { super(aName, 2); this.processingLogic = createProcessingLogic(); - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; + MTEMultiBlockBase.disableMaintenance = ConfigMachines.disableMaintenanceChecks; this.damageFactorLow = ConfigMachines.damageFactorLow; this.damageFactorHigh = ConfigMachines.damageFactorHigh; if (!shouldCheckMaintenance()) fixAllIssues(); } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { return side != getBaseMetaTileEntity().getFrontFacing(); } @@ -197,11 +197,11 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (supportsSingleRecipeLocking()) { mLockedToSingleRecipe = !mLockedToSingleRecipe; if (mLockedToSingleRecipe) { - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - GT_Utility.trans("223", "Single recipe locking enabled. Will lock to next recipe.")); + GTUtility.trans("223", "Single recipe locking enabled. Will lock to next recipe.")); } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("220", "Single recipe locking disabled.")); + GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("220", "Single recipe locking disabled.")); mSingleRecipeCheck = null; } } @@ -273,7 +273,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (mOutputItems != null) { aNBT.setInteger("mOutputItemsLength", mOutputItems.length); for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) { - GT_Utility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]); + GTUtility.saveItem(aNBT, "mOutputItem" + i, mOutputItems[i]); } } if (mOutputFluids != null) { @@ -342,15 +342,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity int aOutputItemsLength = aNBT.getInteger("mOutputItemsLength"); if (aOutputItemsLength > 0) { mOutputItems = new ItemStack[aOutputItemsLength]; - for (int i = 0; i < mOutputItems.length; i++) - mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GTUtility.loadItem(aNBT, "mOutputItem" + i); } int aOutputFluidsLength = aNBT.getInteger("mOutputFluidsLength"); if (aOutputFluidsLength > 0) { mOutputFluids = new FluidStack[aOutputFluidsLength]; for (int i = 0; i < mOutputFluids.length; i++) - mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i); + mOutputFluids[i] = GTUtility.loadFluid(aNBT, "mOutputFluids" + i); } if (shouldCheckMaintenance()) { mWrench = aNBT.getBoolean("mWrench"); @@ -376,7 +375,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isServerSide() && GT_Util.saveMultiblockInputConfiguration(this, aPlayer)) { + if (aBaseMetaTileEntity.isServerSide() && GTUtil.saveMultiblockInputConfiguration(this, aPlayer)) { aPlayer.addChatComponentMessage(new ChatComponentTranslation("GT5U.MULTI_MACHINE_CONFIG.SAVE")); return; } @@ -385,9 +384,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (GT_Util.hasMultiblockInputConfiguration(aPlayer.getHeldItem())) { + if (GTUtil.hasMultiblockInputConfiguration(aPlayer.getHeldItem())) { if (aBaseMetaTileEntity.isServerSide()) { - if (GT_Util.loadMultiblockInputConfiguration(this, aPlayer)) { + if (GTUtil.loadMultiblockInputConfiguration(this, aPlayer)) { aPlayer.addChatComponentMessage(new ChatComponentTranslation("GT5U.MULTI_MACHINE_CONFIG.LOAD")); } else { aPlayer @@ -396,7 +395,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } return true; } - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -508,7 +507,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (!shouldCheckMaintenance()) return; if (getRepairStatus() != getIdealStatus()) { - for (GT_MetaTileEntity_Hatch_Maintenance tHatch : filterValidMTEs(mMaintenanceHatches)) { + for (MTEHatchMaintenance tHatch : filterValidMTEs(mMaintenanceHatches)) { if (tHatch.mAuto) tHatch.autoMaintainance(); if (tHatch.mWrench) mWrench = true; if (tHatch.mScrewdriver) mScrewdriver = true; @@ -593,7 +592,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (ItemStack tStack : mOutputItems) { if (tStack != null) { try { - GT_Mod.achievements.issueAchivementHatch( + GTMod.achievements.issueAchivementHatch( aBaseMetaTileEntity.getWorld() .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); @@ -607,7 +606,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity addFluidOutputs(mOutputFluids); if (mOutputFluids.length > 1) { try { - GT_Mod.achievements.issueAchievement( + GTMod.achievements.issueAchievement( aBaseMetaTileEntity.getWorld() .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "oilplant"); @@ -647,7 +646,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public boolean polluteEnvironment(int aPollutionLevel) { mPollution += aPollutionLevel; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : filterValidMTEs(mMufflerHatches)) { + for (MTEHatchMuffler tHatch : filterValidMTEs(mMufflerHatches)) { if (mPollution >= 10000) { if (tHatch.polluteEnvironment(this)) { mPollution -= 10000; @@ -671,9 +670,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity switch (aIndex) { case PROCESS_START_SOUND_INDEX -> { if (getProcessStartSound() != null) - GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } - case INTERRUPT_SOUND_INDEX -> GT_Utility + case INTERRUPT_SOUND_INDEX -> GTUtility .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } } @@ -683,7 +682,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == PROCESS_START_SOUND_INDEX) { if (getProcessStartSound() != null) - GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } } @@ -691,7 +690,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity protected void doActivitySound(ResourceLocation activitySound) { if (getBaseMetaTileEntity().isActive() && activitySound != null) { if (activitySoundLoop == null) { - activitySoundLoop = new GT_SoundLoop(activitySound, getBaseMetaTileEntity(), false, true); + activitySoundLoop = new GTSoundLoop(activitySound, getBaseMetaTileEntity(), false, true); Minecraft.getMinecraft() .getSoundHandler() .playSound(activitySoundLoop); @@ -865,8 +864,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity result = foundResult; } } else { - for (GT_MetaTileEntity_Hatch_InputBus bus : mInputBusses) { - if (bus instanceof GT_MetaTileEntity_Hatch_CraftingInput_ME) { + for (MTEHatchInputBus bus : mInputBusses) { + if (bus instanceof MTEHatchCraftingInputME) { continue; } List<ItemStack> inputItems = new ArrayList<>(); @@ -1047,9 +1046,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 && !mInventory[1].getUnlocalizedName() .startsWith("gt.blockmachines.basicmachine.")) { - if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { + if (mInventory[1].getItem() instanceof MetaGeneratedTool01) { NBTTagCompound tNBT = mInventory[1].getTagCompound(); - ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage( + ((MetaGeneratedTool) mInventory[1].getItem()).doDamage( mInventory[1], (long) getDamageToComponent(mInventory[1]) * (long) Math.min(mEUt / this.damageFactorLow, Math.pow(mEUt, this.damageFactorHigh))); @@ -1073,7 +1072,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public void explodeMultiblock() { - GT_Log.exp.println( + GTLog.exp.println( "MultiBlockExplosion at: " + this.getBaseMetaTileEntity() .getXCoord() + " | " @@ -1087,7 +1086,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .getWorld().provider.dimensionId + "."); - GT_Pollution.addPollution(getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionOnExplosion); + Pollution.addPollution(getBaseMetaTileEntity(), GTMod.gregtechproxy.mPollutionOnExplosion); mInventory[1] = null; // noinspection unchecked // In this case, the inspection only indicates that the array can be abused in runtime Iterable<MetaTileEntity> allHatches = Iterables.concat( @@ -1123,7 +1122,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity long totalOutput = 0; long aFirstVoltageFound = -1; boolean aFoundMixedDynamos = false; - for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : filterValidMTEs(mDynamoHatches)) { + for (MTEHatchDynamo aDynamo : filterValidMTEs(mDynamoHatches)) { long aVoltage = aDynamo.maxEUOutput(); long aTotal = aDynamo.maxAmperesOut() * aVoltage; // Check against voltage to check when hatch mixing @@ -1147,7 +1146,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity int aAmpsToInject; int aRemainder; int ampsOnCurrentHatch; - for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : filterValidMTEs(mDynamoHatches)) { + for (MTEHatchDynamo aDynamo : filterValidMTEs(mDynamoHatches)) { leftToInject = aEU - injected; aVoltage = aDynamo.maxEUOutput(); aAmpsToInject = (int) (leftToInject / aVoltage); @@ -1172,22 +1171,21 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity */ public long getMaxInputVoltage() { long rVoltage = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : filterValidMTEs(mEnergyHatches)) - rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + for (MTEHatchEnergy tHatch : filterValidMTEs(mEnergyHatches)) rVoltage += tHatch.getBaseMetaTileEntity() + .getInputVoltage(); return rVoltage; } public long getAverageInputVoltage() { - return GT_ExoticEnergyInputHelper.getAverageInputVoltageMulti(mEnergyHatches); + return ExoticEnergyInputHelper.getAverageInputVoltageMulti(mEnergyHatches); } public long getMaxInputAmps() { - return GT_ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti(mEnergyHatches); + return ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti(mEnergyHatches); } public long getMaxInputEu() { - return GT_ExoticEnergyInputHelper.getTotalEuMulti(mEnergyHatches); + return ExoticEnergyInputHelper.getTotalEuMulti(mEnergyHatches); } /** @@ -1195,7 +1193,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity */ public long getMaxInputPower() { long eut = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : filterValidMTEs(mEnergyHatches)) { + for (MTEHatchEnergy tHatch : filterValidMTEs(mEnergyHatches)) { IGregTechTileEntity baseTile = tHatch.getBaseMetaTileEntity(); eut += baseTile.getInputVoltage() * baseTile.getInputAmperage(); } @@ -1230,8 +1228,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity */ protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) { - byte tier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(aEUt) + byte tier = (byte) Math.max(0, GTUtility.getTier(maxInputVoltage)); + OverclockCalculator calculator = new OverclockCalculator().setRecipeEUt(aEUt) .setEUt(V[tier] * mAmperage) .setDuration(aDuration) .setDurationDecreasePerOC(perfectOC ? 4.0 : 2.0) @@ -1260,16 +1258,16 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; - for (GT_MetaTileEntity_Hatch_Energy tHatch : filterValidMTEs(mEnergyHatches)) { + for (MTEHatchEnergy tHatch : filterValidMTEs(mEnergyHatches)) { if (tHatch.getBaseMetaTileEntity() .decreaseStoredEnergyUnits(aEU, false)) return true; } return false; } - protected static boolean dumpFluid(List<GT_MetaTileEntity_Hatch_Output> aOutputHatches, FluidStack copiedFluidStack, + protected static boolean dumpFluid(List<MTEHatchOutput> aOutputHatches, FluidStack copiedFluidStack, boolean restrictiveHatchesOnly) { - for (GT_MetaTileEntity_Hatch_Output tHatch : filterValidMTEs(aOutputHatches)) { + for (MTEHatchOutput tHatch : filterValidMTEs(aOutputHatches)) { if (restrictiveHatchesOnly && tHatch.mMode == 0) { continue; } @@ -1308,7 +1306,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public boolean depleteInput(FluidStack aLiquid, boolean simulate) { if (aLiquid == null) return false; - for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) { setHatchRecipeMap(tHatch); FluidStack tLiquid = tHatch.drain(ForgeDirection.UNKNOWN, aLiquid, false); if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { @@ -1323,10 +1321,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } public boolean addOutput(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return false; - aStack = GT_Utility.copyOrNull(aStack); + if (GTUtility.isStackInvalid(aStack)) return false; + aStack = GTUtility.copyOrNull(aStack); - final List<GT_MetaTileEntity_Hatch_OutputBus> filteredBuses = filterValidMTEs(mOutputBusses); + final List<MTEHatchOutputBus> filteredBuses = filterValidMTEs(mOutputBusses); if (dumpItem(filteredBuses, aStack, true) || dumpItem(filteredBuses, aStack, false)) { return true; } @@ -1336,7 +1334,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity while (outputSuccess && aStack.stackSize > 0) { outputSuccess = false; ItemStack single = aStack.splitStack(1); - for (GT_MetaTileEntity_Hatch_Output tHatch : filterValidMTEs(mOutputHatches)) { + for (MTEHatchOutput tHatch : filterValidMTEs(mOutputHatches)) { if (!outputSuccess && tHatch.outputsItems()) { if (tHatch.getBaseMetaTileEntity() .addStackToSlot(1, single)) outputSuccess = true; @@ -1346,9 +1344,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity return outputSuccess; } - private boolean dumpItem(List<GT_MetaTileEntity_Hatch_OutputBus> outputBuses, ItemStack itemStack, - boolean restrictiveBusesOnly) { - for (GT_MetaTileEntity_Hatch_OutputBus outputBus : outputBuses) { + private boolean dumpItem(List<MTEHatchOutputBus> outputBuses, ItemStack itemStack, boolean restrictiveBusesOnly) { + for (MTEHatchOutputBus outputBus : outputBuses) { if (restrictiveBusesOnly && !outputBus.isLocked()) { continue; } @@ -1362,12 +1359,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } public boolean depleteInput(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return false; - FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true); + if (GTUtility.isStackInvalid(aStack)) return false; + FluidStack aLiquid = GTUtility.getFluidForFilledItem(aStack, true); if (aLiquid != null) return depleteInput(aLiquid); - for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) { setHatchRecipeMap(tHatch); - if (GT_Utility.areStacksEqual( + if (GTUtility.areStacksEqual( aStack, tHatch.getBaseMetaTileEntity() .getStackInSlot(0))) { @@ -1379,11 +1376,11 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } } - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { + for (MTEHatchInputBus tHatch : filterValidMTEs(mInputBusses)) { tHatch.mRecipeMap = getRecipeMap(); for (int i = tHatch.getBaseMetaTileEntity() .getSizeInventory() - 1; i >= 0; i--) { - if (GT_Utility.areStacksEqual( + if (GTUtility.areStacksEqual( aStack, tHatch.getBaseMetaTileEntity() .getStackInSlot(i))) { @@ -1401,7 +1398,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public ArrayList<ItemStack> getStoredOutputs() { ArrayList<ItemStack> rList = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_OutputBus tHatch : filterValidMTEs(mOutputBusses)) { + for (MTEHatchOutputBus tHatch : filterValidMTEs(mOutputBusses)) { for (int i = tHatch.getBaseMetaTileEntity() .getSizeInventory() - 1; i >= 0; i--) { rList.add( @@ -1415,15 +1412,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public ArrayList<FluidStack> getStoredFluids() { ArrayList<FluidStack> rList = new ArrayList<>(); Map<Fluid, FluidStack> inputsFromME = new HashMap<>(); - for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) { setHatchRecipeMap(tHatch); - if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput multiInputHatch) { + if (tHatch instanceof MTEHatchMultiInput multiInputHatch) { for (FluidStack tFluid : multiInputHatch.getStoredFluid()) { if (tFluid != null) { rList.add(tFluid); } } - } else if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + } else if (tHatch instanceof MTEHatchInputME meHatch) { for (FluidStack fluidStack : meHatch.getStoredFluids()) { if (fluidStack != null) { // Prevent the same fluid from different ME hatches from being recognized @@ -1449,7 +1446,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity * @param doDrain If false, fluid will not actually be consumed * @return Whether the hatch contains enough fluid to drain */ - public boolean drain(GT_MetaTileEntity_Hatch hatch, FluidStack fluid, boolean doDrain) { + public boolean drain(MTEHatch hatch, FluidStack fluid, boolean doDrain) { if (fluid == null || hatch == null) return false; if (supportsCraftingMEBuffer() && hatch instanceof IDualInputHatch tHatch && tHatch.supportsFluids()) { Optional<IDualInputInventory> inventory = tHatch.getFirstNonEmptyInventory(); @@ -1465,8 +1462,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } - if (hatch instanceof GT_MetaTileEntity_Hatch_Input tHatch && tHatch.isValid()) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + if (hatch instanceof MTEHatchInput tHatch && tHatch.isValid()) { + if (tHatch instanceof MTEHatchInputME meHatch) { meHatch.startRecipeProcessing(); FluidStack tFluid = meHatch.drain(ForgeDirection.UNKNOWN, fluid, doDrain); meHatch.endRecipeProcessing(this); @@ -1482,20 +1479,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public ArrayList<ItemStack> getStoredInputs() { ArrayList<ItemStack> rList = new ArrayList<>(); - Map<GT_Utility.ItemId, ItemStack> inputsFromME = new HashMap<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_CraftingInput_ME) { + Map<GTUtility.ItemId, ItemStack> inputsFromME = new HashMap<>(); + for (MTEHatchInputBus tHatch : filterValidMTEs(mInputBusses)) { + if (tHatch instanceof MTEHatchCraftingInputME) { continue; } tHatch.mRecipeMap = getRecipeMap(); IGregTechTileEntity tileEntity = tHatch.getBaseMetaTileEntity(); - boolean isMEBus = tHatch instanceof GT_MetaTileEntity_Hatch_InputBus_ME; + boolean isMEBus = tHatch instanceof MTEHatchInputBusME; for (int i = tileEntity.getSizeInventory() - 1; i >= 0; i--) { ItemStack itemStack = tileEntity.getStackInSlot(i); if (itemStack != null) { if (isMEBus) { // Prevent the same item from different ME buses from being recognized - inputsFromME.put(GT_Utility.ItemId.createNoCopy(itemStack), itemStack); + inputsFromME.put(GTUtility.ItemId.createNoCopy(itemStack), itemStack); } else { rList.add(itemStack); } @@ -1537,20 +1534,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } - Map<GT_Utility.ItemId, ItemStack> inputsFromME = new HashMap<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_CraftingInput_ME) { + Map<GTUtility.ItemId, ItemStack> inputsFromME = new HashMap<>(); + for (MTEHatchInputBus tHatch : filterValidMTEs(mInputBusses)) { + if (tHatch instanceof MTEHatchCraftingInputME) { continue; } tHatch.mRecipeMap = getRecipeMap(); IGregTechTileEntity tileEntity = tHatch.getBaseMetaTileEntity(); - boolean isMEBus = tHatch instanceof GT_MetaTileEntity_Hatch_InputBus_ME; + boolean isMEBus = tHatch instanceof MTEHatchInputBusME; for (int i = tileEntity.getSizeInventory() - 1; i >= 0; i--) { ItemStack itemStack = tileEntity.getStackInSlot(i); if (itemStack != null) { if (isMEBus) { // Prevent the same item from different ME buses from being recognized - inputsFromME.put(GT_Utility.ItemId.createNoCopy(itemStack), itemStack); + inputsFromME.put(GTUtility.ItemId.createNoCopy(itemStack), itemStack); } else { rList.add(itemStack); } @@ -1566,15 +1563,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity return rList; } - public Map<GT_Utility.ItemId, ItemStack> getStoredInputsFromME() { - Map<GT_Utility.ItemId, ItemStack> inputsFromME = new Object2ReferenceOpenHashMap<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_InputBus_ME meBus) { + public Map<GTUtility.ItemId, ItemStack> getStoredInputsFromME() { + Map<GTUtility.ItemId, ItemStack> inputsFromME = new Object2ReferenceOpenHashMap<>(); + for (MTEHatchInputBus tHatch : filterValidMTEs(mInputBusses)) { + if (tHatch instanceof MTEHatchInputBusME meBus) { for (int i = meBus.getSizeInventory() - 1; i >= 0; i--) { ItemStack itemStack = meBus.getStackInSlot(i); if (itemStack != null) { // Prevent the same item from different ME buses from being recognized - inputsFromME.put(GT_Utility.ItemId.createNoCopy(itemStack), itemStack); + inputsFromME.put(GTUtility.ItemId.createNoCopy(itemStack), itemStack); } } } @@ -1584,8 +1581,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public Map<Fluid, FluidStack> getStoredFluidsFromME() { Map<Fluid, FluidStack> fluidsFromME = new Reference2ReferenceOpenHashMap<>(); - for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) { + if (tHatch instanceof MTEHatchInputME meHatch) { for (FluidStack fluid : meHatch.getStoredFluids()) { if (fluid != null) { // Prevent the same fluid from different ME hatches from being recognized @@ -1613,17 +1610,17 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } public void updateSlots() { - for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) tHatch.updateSlots(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) tHatch.updateSlots(); + for (MTEHatchInput tHatch : filterValidMTEs(mInputHatches)) tHatch.updateSlots(); + for (MTEHatchInputBus tHatch : filterValidMTEs(mInputBusses)) tHatch.updateSlots(); } protected void startRecipeProcessing() { - for (GT_MetaTileEntity_Hatch_InputBus hatch : filterValidMTEs(mInputBusses)) { + for (MTEHatchInputBus hatch : filterValidMTEs(mInputBusses)) { if (hatch instanceof IRecipeProcessingAwareHatch aware) { aware.startRecipeProcessing(); } } - for (GT_MetaTileEntity_Hatch_Input hatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput hatch : filterValidMTEs(mInputHatches)) { if (hatch instanceof IRecipeProcessingAwareHatch aware) { aware.startRecipeProcessing(); } @@ -1637,12 +1634,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } protected void endRecipeProcessing() { - for (GT_MetaTileEntity_Hatch_InputBus hatch : filterValidMTEs(mInputBusses)) { + for (MTEHatchInputBus hatch : filterValidMTEs(mInputBusses)) { if (hatch instanceof IRecipeProcessingAwareHatch aware) { setResultIfFailure(aware.endRecipeProcessing(this)); } } - for (GT_MetaTileEntity_Hatch_Input hatch : filterValidMTEs(mInputHatches)) { + for (MTEHatchInput hatch : filterValidMTEs(mInputHatches)) { if (hatch instanceof IRecipeProcessingAwareHatch aware) { setResultIfFailure(aware.endRecipeProcessing(this)); } @@ -1653,7 +1650,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch hatch) { + if (aMetaTileEntity instanceof MTEHatch hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); } @@ -1667,26 +1664,21 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity mSmartInputHatches.add(hatch); } } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - setHatchRecipeMap((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = getRecipeMap(); - return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) - return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) - return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) - return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchInput) { + setHatchRecipeMap((MTEHatchInput) aMetaTileEntity); + return mInputHatches.add((MTEHatchInput) aMetaTileEntity); + } + if (aMetaTileEntity instanceof MTEHatchInputBus) { + ((MTEHatchInputBus) aMetaTileEntity).mRecipeMap = getRecipeMap(); + return mInputBusses.add((MTEHatchInputBus) aMetaTileEntity); + } + if (aMetaTileEntity instanceof MTEHatchOutput) return mOutputHatches.add((MTEHatchOutput) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchOutputBus) return mOutputBusses.add((MTEHatchOutputBus) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchEnergy) return mEnergyHatches.add((MTEHatchEnergy) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchDynamo) return mDynamoHatches.add((MTEHatchDynamo) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchMaintenance) + return mMaintenanceHatches.add((MTEHatchMaintenance) aMetaTileEntity); + if (aMetaTileEntity instanceof MTEHatchMuffler) return mMufflerHatches.add((MTEHatchMuffler) aMetaTileEntity); return false; } @@ -1694,7 +1686,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance hatch) { + if (aMetaTileEntity instanceof MTEHatchMaintenance hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mMaintenanceHatches.add(hatch); @@ -1708,7 +1700,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy hatch) { + if (aMetaTileEntity instanceof MTEHatchEnergy hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mEnergyHatches.add(hatch); @@ -1720,8 +1712,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch hatch - && GT_ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) { + if (aMetaTileEntity instanceof MTEHatch hatch && ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mExoticEnergyHatches.add(hatch); @@ -1733,7 +1724,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo hatch) { + if (aMetaTileEntity instanceof MTEHatchDynamo hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mDynamoHatches.add(hatch); @@ -1745,7 +1736,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler hatch) { + if (aMetaTileEntity instanceof MTEHatchMuffler hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mMufflerHatches.add(hatch); @@ -1776,7 +1767,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aMetaTileEntity instanceof ISmartInputHatch hatch) { mSmartInputHatches.add(hatch); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus hatch) { + if (aMetaTileEntity instanceof MTEHatchInputBus hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); hatch.mRecipeMap = getRecipeMap(); @@ -1789,7 +1780,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus hatch) { + if (aMetaTileEntity instanceof MTEHatchOutputBus hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mOutputBusses.add(hatch); @@ -1804,7 +1795,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aMetaTileEntity instanceof ISmartInputHatch hatch) { mSmartInputHatches.add(hatch); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input hatch) { + if (aMetaTileEntity instanceof MTEHatchInput hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); setHatchRecipeMap(hatch); @@ -1817,7 +1808,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output hatch) { + if (aMetaTileEntity instanceof MTEHatchOutput hatch) { hatch.updateTexture(aBaseCasingIndex); hatch.updateCraftingIcon(this.getMachineCraftingIcon()); return mOutputHatches.add(hatch); @@ -1825,7 +1816,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity return false; } - protected void setHatchRecipeMap(GT_MetaTileEntity_Hatch_Input hatch) { + protected void setHatchRecipeMap(MTEHatchInput hatch) { if (filtersFluid()) { hatch.mRecipeMap = getRecipeMap(); } @@ -1841,13 +1832,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public String[] getInfoData() { int mPollutionReduction = 0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : filterValidMTEs(mMufflerHatches)) { + for (MTEHatchMuffler tHatch : filterValidMTEs(mMufflerHatches)) { mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } long storedEnergy = 0; long maxEnergy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : filterValidMTEs(mEnergyHatches)) { + for (MTEHatchEnergy tHatch : filterValidMTEs(mEnergyHatches)) { storedEnergy += tHatch.getBaseMetaTileEntity() .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() @@ -1886,7 +1877,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(getMaxInputVoltage())] + + VN[GTUtility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED @@ -1929,7 +1920,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { - if (!GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) continue; + if (!GTUtility.areStacksEqual(tInputList.get(i), tInputList.get(j))) continue; if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { tInputList.remove(j--); tInputList_sS = tInputList.size(); @@ -1949,7 +1940,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { - if (!GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) continue; + if (!GTUtility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) continue; if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { tFluidList.remove(j--); @@ -1989,15 +1980,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity StatCollector.translateToLocalFormatted( "GT5U.waila.energy.use_with_amperage", formatNumbers(actualEnergyUsage), - GT_Utility.getAmperageForTier(actualEnergyUsage, (byte) energyTier), - GT_Utility.getColoredTierNameFromTier((byte) energyTier))); + GTUtility.getAmperageForTier(actualEnergyUsage, (byte) energyTier), + GTUtility.getColoredTierNameFromTier((byte) energyTier))); } else if (actualEnergyUsage < 0) { currentTip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.produce_with_amperage", formatNumbers(-actualEnergyUsage), - GT_Utility.getAmperageForTier(-actualEnergyUsage, (byte) energyTier), - GT_Utility.getColoredTierNameFromTier((byte) energyTier))); + GTUtility.getAmperageForTier(-actualEnergyUsage, (byte) energyTier), + GTUtility.getColoredTierNameFromTier((byte) energyTier))); } } else { if (actualEnergyUsage > 0) { @@ -2005,20 +1996,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity StatCollector.translateToLocalFormatted( "GT5U.waila.energy.use", formatNumbers(actualEnergyUsage), - GT_Utility.getColoredTierNameFromVoltage(actualEnergyUsage))); + GTUtility.getColoredTierNameFromVoltage(actualEnergyUsage))); } else if (actualEnergyUsage < 0) { currentTip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.produce", formatNumbers(-actualEnergyUsage), - GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage))); + GTUtility.getColoredTierNameFromVoltage(-actualEnergyUsage))); } } } - currentTip.add( - GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); + currentTip + .add(GTWaila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); // Show ns on the tooltip - if (GT_Mod.gregtechproxy.wailaAverageNS && tag.hasKey("averageNS")) { + if (GTMod.gregtechproxy.wailaAverageNS && tag.hasKey("averageNS")) { int tAverageTime = tag.getInteger("averageNS"); currentTip.add("Average CPU load of ~" + formatNumbers(tAverageTime) + " ns"); } @@ -2051,7 +2042,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } - final GT_ClientPreference preference = GT_Mod.gregtechproxy.getClientPreference(player.getUniqueID()); + final GTClientPreference preference = GTMod.gregtechproxy.getClientPreference(player.getUniqueID()); if (preference != null && preference.isWailaAverageNSEnabled()) { getBaseMetaTileEntity().startTimeStatistics(); int tAverageTime = 0; @@ -2073,7 +2064,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } protected void setMufflers(boolean state) { - for (GT_MetaTileEntity_Hatch_Muffler aMuffler : mMufflerHatches) { + for (MTEHatchMuffler aMuffler : mMufflerHatches) { final IGregTechTileEntity iGTTileEntity = aMuffler.getBaseMetaTileEntity(); if (iGTTileEntity != null && !iGTTileEntity.isDead()) { iGTTileEntity.setActive(state); @@ -2088,7 +2079,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity setMufflers(false); } - public List<GT_MetaTileEntity_Hatch> getExoticEnergyHatches() { + public List<MTEHatch> getExoticEnergyHatches() { return mExoticEnergyHatches; } @@ -2118,10 +2109,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity * If void protection is enabled, it also checks for {@link #protectsExcessItem()} and * {@link #protectsExcessFluid()}, so you don't need to call them along with this method. * <p> - * If you're using {@link GT_ParallelHelper}, it will handle void protection and return 0 parallel + * If you're using {@link ParallelHelper}, it will handle void protection and return 0 parallel * if all the output cannot be dumped into buses / hatches. In that case you won't use this method. */ - protected boolean canOutputAll(@Nonnull GT_Recipe recipe) { + protected boolean canOutputAll(@Nonnull GTRecipe recipe) { return canOutputAll(recipe.mOutputs, recipe.mFluidOutputs); } @@ -2231,8 +2222,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public List<ItemStack> getItemOutputSlots(ItemStack[] toOutput) { List<ItemStack> ret = new ArrayList<>(); - for (final GT_MetaTileEntity_Hatch tBus : filterValidMTEs(mOutputBusses)) { - if (!(tBus instanceof GT_MetaTileEntity_Hatch_OutputBus_ME)) { + for (final MTEHatch tBus : filterValidMTEs(mOutputBusses)) { + if (!(tBus instanceof MTEHatchOutputBusME)) { final IInventory tBusInv = tBus.getBaseMetaTileEntity(); for (int i = 0; i < tBusInv.getSizeInventory(); i++) { final ItemStack stackInSlot = tBus.getStackInSlot(i); @@ -2263,18 +2254,18 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity /** * Util method for DT-like structure to collect list of output hatches. */ - protected <T extends GT_MetaTileEntity_Hatch_Output> List<? extends IFluidStore> getFluidOutputSlotsByLayer( - FluidStack[] toOutput, List<List<T>> hatchesByLayer) { + protected <T extends MTEHatchOutput> List<? extends IFluidStore> getFluidOutputSlotsByLayer(FluidStack[] toOutput, + List<List<T>> hatchesByLayer) { List<IFluidStore> ret = new ArrayList<>(); for (int i = 0; i < toOutput.length; i++) { if (i >= hatchesByLayer.size()) { break; } FluidStack fluidOutputForLayer = toOutput[i]; - for (GT_MetaTileEntity_Hatch_Output hatch : hatchesByLayer.get(i)) { + for (MTEHatchOutput hatch : hatchesByLayer.get(i)) { if (!hatch.isValid()) continue; if (fluidOutputForLayer != null) { - ret.add(new OutputHatchWrapper(hatch, f -> GT_Utility.areFluidsEqual(f, fluidOutputForLayer))); + ret.add(new OutputHatchWrapper(hatch, f -> GTUtility.areFluidsEqual(f, fluidOutputForLayer))); } else { ret.add(hatch); } @@ -2285,9 +2276,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public boolean canDumpItemToME() { - for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(mOutputBusses)) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { - if ((((GT_MetaTileEntity_Hatch_OutputBus_ME) tHatch).canAcceptItem())) { + for (MTEHatch tHatch : filterValidMTEs(mOutputBusses)) { + if (tHatch instanceof MTEHatchOutputBusME) { + if ((((MTEHatchOutputBusME) tHatch).canAcceptItem())) { return true; } } @@ -2298,8 +2289,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public boolean canDumpFluidToME() { for (IFluidStore tHatch : getFluidOutputSlots(new FluidStack[0])) { - if (tHatch instanceof GT_MetaTileEntity_Hatch_Output_ME) { - if ((((GT_MetaTileEntity_Hatch_Output_ME) tHatch).canAcceptFluid())) { + if (tHatch instanceof MTEHatchOutputME) { + if ((((MTEHatchOutputME) tHatch).canAcceptFluid())) { return true; } } @@ -2336,8 +2327,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity * Creates the icon list for this machine. Override this and add the overlays to machineModeIcons in order. */ public void setMachineModeIcons() { - machineModeIcons.add(GT_UITextures.OVERLAY_BUTTON_MACHINEMODE_DEFAULT); - machineModeIcons.add(GT_UITextures.OVERLAY_BUTTON_MACHINEMODE_DEFAULT); + machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_DEFAULT); + machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_DEFAULT); } /** @@ -2447,13 +2438,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_SCREEN_BLACK) .setPos(4, 4) .setSize(190, 85)); final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); builder.widget( inventorySlot.setPos(173, 167) - .setBackground(GT_UITextures.SLOT_DARK_GRAY)); + .setBackground(GTUITextures.SLOT_DARK_GRAY)); final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); drawTexts(screenElements, inventorySlot); @@ -2563,44 +2554,42 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (supportsMachineModeSwitch()) { screenElements.widget( TextWidget.dynamicString( - () -> EnumChatFormatting.WHITE + GT_Utility.trans("400", "Running mode: ") + () -> EnumChatFormatting.WHITE + GTUtility.trans("400", "Running mode: ") + EnumChatFormatting.GOLD + getMachineModeName())); } screenElements .widget( - new TextWidget(GT_Utility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mWrench)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); screenElements .widget( - new TextWidget(GT_Utility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mScrewdriver)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); screenElements .widget( - new TextWidget(GT_Utility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSoftHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); screenElements .widget( - new TextWidget(GT_Utility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mHardHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); screenElements .widget( - new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mSolderingTool)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mCrowbar)) + screenElements.widget( + new TextWidget(GTUtility.trans("137", "That doesn't belong there.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mCrowbar)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); screenElements .widget( - new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); screenElements.widget( @@ -2611,7 +2600,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 256) != 0)); screenElements.widget( - new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())) .widget( @@ -2623,15 +2612,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity () -> getBaseMetaTileEntity().isActive(), val -> getBaseMetaTileEntity().setActive(val))); screenElements.widget( - new TextWidget(GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled( widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && getBaseMetaTileEntity().isActive())); @@ -2656,7 +2645,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .setTextAlignment(Alignment.CenterLeft) .setEnabled( widget -> shouldDisplayShutDownReason() && !getBaseMetaTileEntity().isActive() - && GT_Utility.isStringValid( + && GTUtility.isStringValid( getBaseMetaTileEntity().getLastShutDownReason() .getDisplayString()) && getBaseMetaTileEntity().wasShutdown())) @@ -2675,7 +2664,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .setTextAlignment(Alignment.CenterLeft) .setEnabled( widget -> shouldDisplayCheckRecipeResult() - && GT_Utility.isStringValid(checkRecipeResult.getDisplayString()) + && GTUtility.isStringValid(checkRecipeResult.getDisplayString()) && (isAllowedToWork() || getBaseMetaTileEntity().isActive() || checkRecipeResult.persistsOnShutdown()))) .widget(new CheckRecipeResultSyncer(() -> checkRecipeResult, (result) -> checkRecipeResult = result)); @@ -2706,15 +2695,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } screenElements.widget( - new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get()) + new TextWidget(GTUtility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get()) .setEnabled(widget -> { if (getBaseMetaTileEntity().isAllowedToWork()) return false; - if (getBaseMetaTileEntity().getErrorDisplayID() == 0 - && this instanceof GT_MetaTileEntity_LargeTurbine) { + if (getBaseMetaTileEntity().getErrorDisplayID() == 0 && this instanceof MTELargeTurbine) { final ItemStack tItem = inventorySlot.getMcSlot() .getStack(); return tItem == null - || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 + || !(tItem.getItem() == MetaGeneratedTool01.INSTANCE && tItem.getItemDamage() >= 170 && tItem.getItemDamage() <= 177); } return false; @@ -2726,12 +2714,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } @TestOnly - protected void setEnergyHatches(ArrayList<GT_MetaTileEntity_Hatch_Energy> EnergyHatches) { + protected void setEnergyHatches(ArrayList<MTEHatchEnergy> EnergyHatches) { this.mEnergyHatches = EnergyHatches; } @TestOnly - protected void setExoticEnergyHatches(List<GT_MetaTileEntity_Hatch> ExoticEnergyHatches) { + protected void setExoticEnergyHatches(List<MTEHatch> ExoticEnergyHatches) { this.mExoticEnergyHatches = ExoticEnergyHatches; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java b/src/main/java/gregtech/api/metatileentity/implementations/MTESpecialFilter.java index 1a71f17ec8..c93b542805 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTESpecialFilter.java @@ -15,27 +15,25 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_FilterBase { +public abstract class MTESpecialFilter extends MTEFilterBase { private static final String ALLOW_NBT_TOOLTIP = "GT5U.machines.allow_nbt.tooltip"; private boolean allowNbt = false; - public GT_MetaTileEntity_SpecialFilter(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + public MTESpecialFilter(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) { // 9 buffer slot, 1 representation slot, 1 holo slot. last seems not needed... super(aID, aName, aNameRegional, aTier, 11, aDescription); } - public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + public MTESpecialFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, + public MTESpecialFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -75,21 +73,21 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_ super.addUIWidgets(builder, buildContext); addAllowNbtButton(builder); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false)) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_ARROW_24_WHITE.apply(27, false)) .setPos(6, 19) .setSize(27, 24)) .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true)) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_ARROW_24_BLUE.apply(42, true)) .setPos(53, 19) .setSize(42, 24)) .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true)) + new DrawableWidget().setDrawable(GTUITextures.PICTURE_ARROW_24_RED.apply(19, true)) .setPos(152, 19) .setSize(19, 24)) .widget( createFilterIconSlot(BaseSlot.phantom(inventoryHandler, 9)).disableShiftInsert() .setPos(34, 22) - .setBackground(GT_UITextures.BUTTON_STANDARD)) + .setBackground(GTUITextures.BUTTON_STANDARD)) .widget( SlotGroup.ofItemHandler(inventoryHandler, 3) .endAtSlot(8) @@ -102,7 +100,7 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_ createToggleButton( () -> allowNbt, val -> allowNbt = val, - GT_UITextures.OVERLAY_BUTTON_NBT, + GTUITextures.OVERLAY_BUTTON_NBT, () -> mTooltipCache.getData(ALLOW_NBT_TOOLTIP))); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/MTETieredMachineBlock.java index a08e49fd6c..8bffeaf17e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTETieredMachineBlock.java @@ -1,19 +1,19 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GTValues.GT; import static gregtech.api.metatileentity.BaseTileEntity.BATTERY_SLOT_TOOLTIP; import static gregtech.api.metatileentity.BaseTileEntity.BATTERY_SLOT_TOOLTIP_ALT; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.enums.GT_Values; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.enums.GTValues; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; -public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntity { +public abstract class MTETieredMachineBlock extends MetaTileEntity { /** * Value between [0 - 9] to describe the Tier of this Machine. PLZ [0-15] works - READ! GT_Values class. @@ -30,8 +30,8 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit */ public final ITexture[][][] mTextures; - public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, - int aInvSlotCount, String aDescription, ITexture... aTextures) { + public MTETieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 14)); mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; @@ -40,8 +40,8 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit else mTextures = null; } - public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, - int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + public MTETieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 15)); mDescriptionArray = aDescription == null ? new String[0] : aDescription; @@ -51,7 +51,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit else mTextures = null; } - public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, + public MTETieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; @@ -59,7 +59,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit mTextures = aTextures; } - public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, + public MTETieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; @@ -98,13 +98,13 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit protected SlotWidget createChargerSlot(int x, int y) { final String batterySlotTooltipKey; final Object[] batterySlotTooltipArgs; - final String pTier1 = GT_Utility.getColoredTierNameFromTier(mTier); - if (mTier == GT_Values.VN.length - 1) { + final String pTier1 = GTUtility.getColoredTierNameFromTier(mTier); + if (mTier == GTValues.VN.length - 1) { batterySlotTooltipKey = BATTERY_SLOT_TOOLTIP_ALT; batterySlotTooltipArgs = new String[] { pTier1 }; } else { batterySlotTooltipKey = BATTERY_SLOT_TOOLTIP; - batterySlotTooltipArgs = new String[] { pTier1, GT_Utility.getColoredTierNameFromTier((byte) (mTier + 1)) }; + batterySlotTooltipArgs = new String[] { pTier1, GTUtility.getColoredTierNameFromTier((byte) (mTier + 1)) }; } return createChargerSlot(x, y, batterySlotTooltipKey, batterySlotTooltipArgs); } @@ -113,7 +113,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit return (SlotWidget) new SlotWidget(inventoryHandler, rechargerSlotStartIndex()).disableShiftInsert() .setGTTooltip(() -> mTooltipCache.getData(tooltipKey, tooltipArgs)) .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) + .setBackground(getGUITextureSet().getItemSlot(), GTUITextures.OVERLAY_SLOT_CHARGER) .setPos(x, y); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTETooltipMultiBlockBase.java index c12c7c1442..71fce08c7e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTETooltipMultiBlockBase.java @@ -4,30 +4,29 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import org.lwjgl.input.Keyboard; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.ISecondaryDescribable; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.MultiblockTooltipBuilder; /** - * A multiblock with tooltip {@link GT_Multiblock_Tooltip_Builder} + * A multiblock with tooltip {@link MultiblockTooltipBuilder} */ -public abstract class GT_MetaTileEntity_TooltipMultiBlockBase extends GT_MetaTileEntity_MultiBlockBase - implements ISecondaryDescribable { +public abstract class MTETooltipMultiBlockBase extends MTEMultiBlockBase implements ISecondaryDescribable { - private static final AtomicReferenceArray<GT_Multiblock_Tooltip_Builder> tooltips = new AtomicReferenceArray<>( - GregTech_API.METATILEENTITIES.length); + private static final AtomicReferenceArray<MultiblockTooltipBuilder> tooltips = new AtomicReferenceArray<>( + GregTechAPI.METATILEENTITIES.length); - public GT_MetaTileEntity_TooltipMultiBlockBase(int aID, String aName, String aNameRegional) { + public MTETooltipMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_MetaTileEntity_TooltipMultiBlockBase(String aName) { + public MTETooltipMultiBlockBase(String aName) { super(aName); } - protected GT_Multiblock_Tooltip_Builder getTooltip() { + protected MultiblockTooltipBuilder getTooltip() { int tId = getBaseMetaTileEntity().getMetaTileID(); - GT_Multiblock_Tooltip_Builder tooltip = tooltips.get(tId); + MultiblockTooltipBuilder tooltip = tooltips.get(tId); if (tooltip == null) { tooltip = createTooltip(); tooltips.set(tId, tooltip); @@ -35,7 +34,7 @@ public abstract class GT_MetaTileEntity_TooltipMultiBlockBase extends GT_MetaTil return tooltip; } - protected abstract GT_Multiblock_Tooltip_Builder createTooltip(); + protected abstract MultiblockTooltipBuilder createTooltip(); @Override public String[] getDescription() { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/MTETransformer.java index de7019b292..d2b88d26bc 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTETransformer.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import static gregtech.api.enums.Mods.EnderIO; import static mcp.mobius.waila.api.SpecialChars.BLUE; import static mcp.mobius.waila.api.SpecialChars.GOLD; @@ -23,13 +23,13 @@ import cofh.api.energy.IEnergyStorage; import crazypants.enderio.machine.capbank.TileCapBank; import crazypants.enderio.machine.capbank.network.ICapBankNetwork; import crazypants.enderio.power.IPowerContainer; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -39,17 +39,17 @@ import mcp.mobius.waila.api.IWailaDataAccessor; * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple * Machine */ -public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachineBlock { +public class MTETransformer extends MTETieredMachineBlock { - public GT_MetaTileEntity_Transformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + public MTETransformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, 0, aDescription); } - public GT_MetaTileEntity_Transformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public MTETransformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Transformer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTETransformer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Transformer(mName, mTier, mDescriptionArray, mTextures); + return new MTETransformer(mName, mTier, mDescriptionArray, mTextures); } @Override @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide() && GregTech_API.mInputRF) { + if (aBaseMetaTileEntity.isServerSide() && GregTechAPI.mInputRF) { aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()); for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { if (aBaseMetaTileEntity.getStoredEU() >= aBaseMetaTileEntity.getEUCapacity()) break; @@ -185,20 +185,20 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi && energyProvider.extractEnergy(side.getOpposite(), 1, true) == 1) { long tEU = ((IEnergyProvider) tTileEntity).extractEnergy( side.getOpposite(), - GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), + GTUtility.safeInt(maxEUInput() * 100L / GregTechAPI.mRFtoEU), false); - tEU = tEU * GregTech_API.mRFtoEU / 100; + tEU = tEU * GregTechAPI.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits(ForgeDirection.UNKNOWN, Math.min(tEU, maxEUInput()), 1); } else if (tTileEntity instanceof IEnergyStorage energyStorage && energyStorage.extractEnergy(1, true) == 1) { long tEU = ((IEnergyStorage) tTileEntity) - .extractEnergy(GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false); - tEU = tEU * GregTech_API.mRFtoEU / 100; + .extractEnergy(GTUtility.safeInt(maxEUInput() * 100L / GregTechAPI.mRFtoEU), false); + tEU = tEU * GregTechAPI.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits(ForgeDirection.UNKNOWN, Math.min(tEU, maxEUInput()), 1); } else if (EnderIO.isModLoaded() && tTileEntity instanceof IPowerContainer powerContainer && powerContainer.getEnergyStored() > 0) { final int storedRF = powerContainer.getEnergyStored(); - final int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU); + final int extractRF = GTUtility.safeInt(maxEUInput() * 100L / GregTechAPI.mRFtoEU); long tEU = 0; if (tTileEntity instanceof TileCapBank capBank) { ICapBankNetwork network = capBank.getNetwork(); @@ -206,9 +206,9 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi tEU = Math.min( (Math.min( Math.min(network.getEnergyStoredL(), storedRF - extractRF), - network.getMaxOutput())) * (long) GregTech_API.mRFtoEU / 100L, + network.getMaxOutput())) * (long) GregTechAPI.mRFtoEU / 100L, maxEUInput()); - network.addEnergy(GT_Utility.safeInt(-(tEU * 100 / GregTech_API.mRFtoEU))); + network.addEnergy(GTUtility.safeInt(-(tEU * 100 / GregTechAPI.mRFtoEU))); } } else { if (storedRF > extractRF) { @@ -216,7 +216,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi tEU = maxEUInput(); } else { powerContainer.setEnergyStored(0); - tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L; + tEU = storedRF * (long) GregTechAPI.mRFtoEU / 100L; } } aBaseMetaTileEntity @@ -255,15 +255,15 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public String getAlternativeModeText() { - return (getBaseMetaTileEntity().isAllowedToWork() ? GT_Utility.trans("145", "Step Down, In: ") - : GT_Utility.trans("146", "Step Up, In: ")) + maxEUInput() - + GT_Utility.trans("148", "V ") + return (getBaseMetaTileEntity().isAllowedToWork() ? GTUtility.trans("145", "Step Down, In: ") + : GTUtility.trans("146", "Step Up, In: ")) + maxEUInput() + + GTUtility.trans("148", "V ") + maxAmperesIn() - + GT_Utility.trans("147", "A, Out: ") + + GTUtility.trans("147", "A, Out: ") + maxEUOutput() - + GT_Utility.trans("148", "V ") + + GTUtility.trans("148", "V ") + maxAmperesOut() - + GT_Utility.trans("149", "A"); + + GTUtility.trans("149", "A"); } @Override @@ -279,17 +279,17 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi final ForgeDirection side = accessor.getSide(); final boolean allowedToWork = tag.getBoolean("isAllowedToWork"); - final byte inputTier = GT_Utility.getTier(tag.getLong("maxEUInput")); - final byte outputTier = GT_Utility.getTier(tag.getLong("maxEUOutput")); + final byte inputTier = GTUtility.getTier(tag.getLong("maxEUInput")); + final byte outputTier = GTUtility.getTier(tag.getLong("maxEUOutput")); currenttip.add( String.format( "%s %s(%dA) -> %s(%dA)", (allowedToWork ? (GREEN + "Step Down") : (RED + "Step Up")) + RESET, - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier) + GTMod.gregtechproxy.mWailaTransformerVoltageTier ? GTUtility.getColoredTierNameFromTier(inputTier) : tag.getLong("maxEUInput"), tag.getLong("maxAmperesIn"), - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(outputTier) + GTMod.gregtechproxy.mWailaTransformerVoltageTier ? GTUtility.getColoredTierNameFromTier(outputTier) : tag.getLong("maxEUOutput"), tag.getLong("maxAmperesOut"))); @@ -297,15 +297,14 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi currenttip.add( String.format( GOLD + "Input:" + RESET + " %s(%dA)", - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier) + GTMod.gregtechproxy.mWailaTransformerVoltageTier ? GTUtility.getColoredTierNameFromTier(inputTier) : tag.getLong("maxEUInput"), tag.getLong("maxAmperesIn"))); } else { currenttip.add( String.format( BLUE + "Output:" + RESET + " %s(%dA)", - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier - ? GT_Utility.getColoredTierNameFromTier(outputTier) + GTMod.gregtechproxy.mWailaTransformerVoltageTier ? GTUtility.getColoredTierNameFromTier(outputTier) : tag.getLong("maxEUOutput"), tag.getLong("maxAmperesOut"))); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_WetTransformer.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEWetTransformer.java index f865a5ea8a..e2c2437311 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_WetTransformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEWetTransformer.java @@ -1,6 +1,6 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.V; import net.minecraft.util.EnumChatFormatting; @@ -11,20 +11,19 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transformer { +public class MTEWetTransformer extends MTETransformer { - public GT_MetaTileEntity_WetTransformer(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + public MTEWetTransformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_WetTransformer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEWetTransformer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_WetTransformer(mName, mTier, mDescriptionArray, mTextures); + return new MTEWetTransformer(mName, mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEWirelessDynamo.java index a04f5cd986..fc7bc3fae2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEWirelessDynamo.java @@ -1,7 +1,7 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.AuthorColen; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.AuthorColen; +import static gregtech.api.enums.GTValues.V; import static gregtech.common.misc.WirelessNetworkManager.addEUToGlobalEnergyMap; import static gregtech.common.misc.WirelessNetworkManager.strongCheckOrAddUser; @@ -18,17 +18,15 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation; import gregtech.api.metatileentity.MetaTileEntity; -public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_Dynamo - implements IWirelessEnergyHatchInformation { +public class MTEWirelessDynamo extends MTEHatchDynamo implements IWirelessEnergyHatchInformation { private UUID owner_uuid; - public GT_MetaTileEntity_Wireless_Dynamo(String aName, byte aTier, String[] aDescription, - ITexture[][][] aTextures) { + public MTEWirelessDynamo(String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Wireless_Dynamo(int aID, String aName, String aNameRegional, int aTier) { + public MTEWirelessDynamo(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[] { "" }); } @@ -106,7 +104,7 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Wireless_Dynamo(mName, mTier, new String[] { "" }, mTextures); + return new MTEWirelessDynamo(mName, mTier, new String[] { "" }, mTextures); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEWirelessEnergy.java index bf624eadd7..e195b4ab08 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEWirelessEnergy.java @@ -1,7 +1,7 @@ package gregtech.api.metatileentity.implementations; -import static gregtech.api.enums.GT_Values.AuthorColen; -import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GTValues.AuthorColen; +import static gregtech.api.enums.GTValues.V; import static gregtech.common.misc.WirelessNetworkManager.addEUToGlobalEnergyMap; import static java.lang.Long.min; @@ -20,8 +20,7 @@ import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.common.misc.spaceprojects.SpaceProjectManager; -public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy - implements IWirelessEnergyHatchInformation { +public class MTEWirelessEnergy extends MTEHatchEnergy implements IWirelessEnergyHatchInformation { private final BigInteger eu_transferred_per_operation = BigInteger .valueOf(2 * V[mTier] * ticks_between_energy_addition); @@ -29,11 +28,11 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En private UUID owner_uuid; - public GT_MetaTileEntity_Wireless_Hatch(String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) { + public MTEWirelessEnergy(String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Wireless_Hatch(int aID, String aName, String aNameRegional, int aTier) { + public MTEWirelessEnergy(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[] { "" }); } @@ -111,7 +110,7 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Wireless_Hatch(mName, mTier, new String[] { "" }, mTextures); + return new MTEWirelessEnergy(mName, mTier, new String[] { "" }, mTextures); } @Override diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java index f5cf261be1..f1f4b8591a 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java @@ -1,11 +1,11 @@ package gregtech.api.multitileentity; -import static gregtech.api.enums.GT_Values.OFFX; -import static gregtech.api.enums.GT_Values.OFFY; -import static gregtech.api.enums.GT_Values.OFFZ; -import static gregtech.api.util.GT_Util.LAST_BROKEN_TILEENTITY; -import static gregtech.api.util.GT_Util.getTileEntity; -import static gregtech.api.util.GT_Util.setTileEntity; +import static gregtech.api.enums.GTValues.OFFX; +import static gregtech.api.enums.GTValues.OFFY; +import static gregtech.api.enums.GTValues.OFFZ; +import static gregtech.api.util.GTUtil.LAST_BROKEN_TILEENTITY; +import static gregtech.api.util.GTUtil.getTileEntity; +import static gregtech.api.util.GTUtil.setTileEntity; import java.util.ArrayList; import java.util.List; @@ -44,7 +44,7 @@ import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IDebugableBlock; @@ -53,10 +53,10 @@ import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.CoverableTileEntity; import gregtech.api.multitileentity.interfaces.IMultiTileEntity; import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Util; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtil; import gregtech.common.covers.CoverInfo; -import gregtech.common.render.GT_MultiTile_Renderer; +import gregtech.common.render.MultiTileRenderer; /* * MultiTileEntityBlock ported from GT6 @@ -85,7 +85,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl public MultiTileEntityBlock(Material material) { super(material); - if (GregTech_API.sPreloadFinished) + if (GregTechAPI.sPreloadFinished) throw new IllegalStateException("Blocks can only be initialized within preInit!"); } @@ -121,7 +121,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl public MultiTileEntityBlock register() { if (registered) throw new IllegalStateException("Block already registered " + internalName); - if (GregTech_API.sPreloadFinished) + if (GregTechAPI.sPreloadFinished) throw new IllegalStateException("Blocks can only be initialized within preInit!"); registered = true; @@ -141,7 +141,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl // spotless:off // if (aTileEntity instanceof IMTE_HasMultiBlockMachineRelevantData // && ((IMTE_HasMultiBlockMachineRelevantData) aTileEntity).hasMultiBlockMachineRelevantData()) - // GregTech_API.causeMachineUpdate(world, x, y, z); + // GregTechAPI.causeMachineUpdate(world, x, y, z); // spotless:on world.removeTileEntity(x, y, z); @@ -160,8 +160,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl @Override public int getRenderType() { - return GT_MultiTile_Renderer.INSTANCE == null ? super.getRenderType() - : GT_MultiTile_Renderer.INSTANCE.getRenderId(); + return MultiTileRenderer.INSTANCE == null ? super.getRenderType() : MultiTileRenderer.INSTANCE.getRenderId(); } @Override @@ -455,7 +454,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl @Override public boolean removedByPlayer(World world, EntityPlayer aPlayer, int x, int y, int z, boolean aWillHarvest) { - final TileEntity tileEntity = GT_Util.getTileEntity(world, x, y, z, true); + final TileEntity tileEntity = GTUtil.getTileEntity(world, x, y, z, true); if (tileEntity != null) LAST_BROKEN_TILEENTITY.set(tileEntity); return super.removedByPlayer(world, aPlayer, x, y, z, aWillHarvest); } @@ -467,7 +466,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl @Override public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - return GregTech_API.sMachineFlammable && (world.getBlockMetadata(x, y, z) == 0) ? 100 : 0; + return GregTechAPI.sMachineFlammable && (world.getBlockMetadata(x, y, z) == 0) ? 100 : 0; } @Override @@ -502,7 +501,7 @@ public class MultiTileEntityBlock extends BlockContainer implements IDebugableBl final TileEntity tileEntity = getTileEntity(world, x, y, z, true); if (tileEntity != null) LAST_BROKEN_TILEENTITY.set(tileEntity); if (tileEntity instanceof IMultiTileEntity mute) { - GT_Log.exp.printf( + GTLog.exp.printf( "Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", x, y, diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java index 325f583149..ca265e529e 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity; -import static gregtech.api.enums.GT_Values.NBT; +import static gregtech.api.enums.GTValues.NBT; import java.lang.ref.WeakReference; @@ -11,7 +11,7 @@ import gregtech.api.enums.Materials; import gregtech.api.multitileentity.base.MultiTileEntity; import gregtech.api.multitileentity.multiblock.casing.FunctionalCasing; import gregtech.api.multitileentity.multiblock.casing.UpgradeCasing; -import gregtech.api.util.GT_Util; +import gregtech.api.util.GTUtil; import gregtech.common.tileentities.casings.upgrade.Inventory; import gregtech.common.tileentities.casings.upgrade.Tank; @@ -43,7 +43,7 @@ public class MultiTileEntityClassContainer { if (parameters.hasKey(NBT.MATERIAL) && !parameters.hasKey(NBT.COLOR)) parameters.setInteger( NBT.COLOR, - GT_Util.getRGBInt( + GTUtil.getRGBInt( Materials.get(parameters.getString(NBT.MATERIAL)) .getRGBA())); @@ -80,7 +80,7 @@ public class MultiTileEntityClassContainer { public MultiTileEntityClassContainer material(Materials material) { // Sets the material, and the color from the material, if not already set parameters.setString(NBT.MATERIAL, material.toString()); - if (!parameters.hasKey(NBT.COLOR)) parameters.setInteger(NBT.COLOR, GT_Util.getRGBInt(material.getRGBA())); + if (!parameters.hasKey(NBT.COLOR)) parameters.setInteger(NBT.COLOR, GTUtil.getRGBInt(material.getRGBA())); return this; } @@ -90,7 +90,7 @@ public class MultiTileEntityClassContainer { } public MultiTileEntityClassContainer color(short[] rgba) { - parameters.setInteger(NBT.COLOR, GT_Util.getRGBInt(rgba)); + parameters.setInteger(NBT.COLOR, GTUtil.getRGBInt(rgba)); return this; } @@ -154,7 +154,7 @@ public class MultiTileEntityClassContainer { * Merge in arbitrary NBT tuples of (key, value). Useful for anything for which a custom method has not yet been * exposed */ - parameters = GT_Util.fuseNBT(parameters, GT_Util.makeNBT(aTags)); + parameters = GTUtil.fuseNBT(parameters, GTUtil.makeNBT(aTags)); return this; } diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityItem.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityItem.java index e67ab61e96..bf7259626f 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityItem.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityItem.java @@ -1,7 +1,7 @@ package gregtech.api.multitileentity; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.SIDE_TOP; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.SIDE_TOP; import java.util.List; @@ -132,7 +132,7 @@ public class MultiTileEntityItem extends ItemBlock { * Add back if needed */ // try { - // GregTech_API.causeMachineUpdate(world, x, y, z); + // GregTechAPI.causeMachineUpdate(world, x, y, z); // } catch (Throwable e) { // GT_FML_LOGGER.error("causeMachineUpdate", e); // } diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java index 0b5afbb043..186110abb7 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import java.util.ArrayList; import java.util.HashMap; @@ -21,12 +21,12 @@ import com.gtnewhorizon.gtnhlib.util.map.ItemStackMap; import appeng.core.CreativeTab; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.LoaderState; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.multitileentity.base.MultiTileEntity; import gregtech.api.multitileentity.interfaces.IMultiTileEntity; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; import it.unimi.dsi.fastutil.shorts.Short2ObjectMap; import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap; @@ -61,7 +61,7 @@ public class MultiTileEntityRegistry { this.block = block; GT_FML_LOGGER.info(internalName + " " + Block.getIdFromBlock(block) + " This is the answer"); this.block.setRegistry(this); - REGISTRIES.put(new ItemStack(Item.getItemById(Block.getIdFromBlock(block)), 1, GT_Values.W), this); + REGISTRIES.put(new ItemStack(Item.getItemById(Block.getIdFromBlock(block)), 1, GTValues.W), this); NAMED_REGISTRIES.put(internalName, this); } @@ -84,7 +84,7 @@ public class MultiTileEntityRegistry { } public static MultiTileEntityRegistry getRegistry(int aRegistryID) { - return REGISTRIES.get(new ItemStack(Item.getItemById(aRegistryID), 1, GT_Values.W)); + return REGISTRIES.get(new ItemStack(Item.getItemById(aRegistryID), 1, GTValues.W)); } public static MultiTileEntityRegistry getRegistry(String aRegistryName) { @@ -101,7 +101,7 @@ public class MultiTileEntityRegistry { */ public ItemStack add(String aLocalised, MultiTileEntityClassContainer aClassContainer) { boolean tFailed = false; - if (GT_Utility.isStringInvalid(aLocalised)) { + if (GTUtility.isStringInvalid(aLocalised)) { GT_FML_LOGGER.error("MULTI-TILE REGISTRY ERROR: Localisation Missing!"); tFailed = true; } @@ -113,7 +113,7 @@ public class MultiTileEntityRegistry { GT_FML_LOGGER.error("MULTI-TILE REGISTRY ERROR: Class inside Class Container is null!"); tFailed = true; } - if (aClassContainer.getMuteID() == GT_Values.W) { + if (aClassContainer.getMuteID() == GTValues.W) { GT_FML_LOGGER.error("MULTI-TILE REGISTRY ERROR: Class Container uses Wildcard MetaData!"); tFailed = true; } @@ -138,8 +138,7 @@ public class MultiTileEntityRegistry { return null; } - GT_LanguageManager - .addStringLocalization(internalName + "." + aClassContainer.getMuteID() + ".name", aLocalised); + GTLanguageManager.addStringLocalization(internalName + "." + aClassContainer.getMuteID() + ".name", aLocalised); registry.put(aClassContainer.getMuteID(), aClassContainer); mLastRegisteredID = aClassContainer.getMuteID(); registrations.add(aClassContainer); @@ -154,7 +153,7 @@ public class MultiTileEntityRegistry { return getItem(aClassContainer.getMuteID()); } - public short mLastRegisteredID = GT_Values.W; + public short mLastRegisteredID = GTValues.W; public ItemStack getItem() { return getItem(mLastRegisteredID, 1, null); @@ -206,14 +205,14 @@ public class MultiTileEntityRegistry { public TileEntity getNewTileEntity(World aWorld, int x, int y, int z, int metaID, NBTTagCompound nbt) { final MultiTileEntityClassContainer container = registry.get((short) metaID); if (container == null) return null; - final MultiTileEntity te = (MultiTileEntity) GT_Utility + final MultiTileEntity te = (MultiTileEntity) GTUtility .callConstructor(container.getMuteClass(), -1, null, true); te.setWorldObj(aWorld); te.xCoord = x; te.yCoord = y; te.zCoord = z; nbt = (nbt == null || nbt.hasNoTags()) ? container.getParameters() - : GT_Util.fuseNBT(nbt, container.getParameters()); + : GTUtil.fuseNBT(nbt, container.getParameters()); te.initFromNBT(nbt, (short) metaID, (short) Block.getIdFromBlock(block)); return te; } diff --git a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java index eeadfe7602..24163f9c20 100644 --- a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java @@ -1,7 +1,7 @@ package gregtech.api.multitileentity.base; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_Values.VALID_SIDES; +import static gregtech.GTMod.GT_FML_LOGGER; +import static gregtech.api.enums.GTValues.VALID_SIDES; import java.io.IOException; import java.util.ArrayList; @@ -35,15 +35,15 @@ import net.minecraftforge.fluids.Fluid; import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GT_Values.NBT; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.GTValues; +import gregtech.api.enums.GTValues.NBT; import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons.CustomIcon; -import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GTUIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.CoverableTileEntity; import gregtech.api.metatileentity.GregTechTileClientEvents; @@ -52,18 +52,18 @@ import gregtech.api.multitileentity.MultiTileEntityClassContainer; import gregtech.api.multitileentity.MultiTileEntityRegistry; import gregtech.api.multitileentity.interfaces.IMultiTileEntity; import gregtech.api.multitileentity.interfaces.SyncedMultiTileEntity; -import gregtech.api.net.GT_Packet_MultiTileEntity; -import gregtech.api.net.GT_Packet_New; +import gregtech.api.net.GTPacketMultiTileEntity; +import gregtech.api.net.GTPacketNew; import gregtech.api.net.data.CommonData; import gregtech.api.net.data.CoordinateData; import gregtech.api.net.data.MultiTileEntityData; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GTItemStack; import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Util; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtil; +import gregtech.api.util.GTUtility; import gregtech.common.render.MultiTileBasicRender; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -98,16 +98,16 @@ public abstract class MultiTileEntity extends CoverableTileEntity protected ForgeDirection facing = ForgeDirection.WEST; // Default to WEST, so it renders facing Left in the // inventory protected byte color; - protected int rgba = GT_Values.UNCOLORED; - private short mteID = GT_Values.W, mteRegistry = GT_Values.W; + protected int rgba = GTValues.UNCOLORED; + private short mteID = GTValues.W, mteRegistry = GTValues.W; private String customName = null; private String ownerName = ""; - private UUID ownerUUID = GT_Utility.defaultUuid; + private UUID ownerUUID = GTUtility.defaultUuid; private boolean lockUpgrade = false; - private final GT_Packet_MultiTileEntity fullPacket = new GT_Packet_MultiTileEntity(false); - private final GT_Packet_MultiTileEntity timedPacket = new GT_Packet_MultiTileEntity(false); - private final GT_Packet_MultiTileEntity graphicPacket = new GT_Packet_MultiTileEntity(false); + private final GTPacketMultiTileEntity fullPacket = new GTPacketMultiTileEntity(false); + private final GTPacketMultiTileEntity timedPacket = new GTPacketMultiTileEntity(false); + private final GTPacketMultiTileEntity graphicPacket = new GTPacketMultiTileEntity(false); public MultiTileEntity(boolean isTicking) { this.isTicking = isTicking; @@ -213,7 +213,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity @Override public void readFromNBT(NBTTagCompound nbt) { // Check if it is a World/Chunk-Loading Process calling readFromNBT - if (mteID == GT_Values.W || mteRegistry == GT_Values.W) { + if (mteID == GTValues.W || mteRegistry == GTValues.W) { // Read the ID Tags first mteID = nbt.getShort(NBT.MTE_ID); mteRegistry = nbt.getShort(NBT.MTE_REG); @@ -224,7 +224,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity if (tClass != null) { // Add the Default Parameters. Useful for things that differ between different tiers/types of the // same machine - nbt = GT_Util.fuseNBT(nbt, tClass.getParameters()); + nbt = GTUtil.fuseNBT(nbt, tClass.getParameters()); } } } @@ -255,7 +255,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity readMultiTileNBT(nbt); if (NetworkUtils.isDedicatedClient()) { - if (GregTech_API.sBlockIcons == null && nbt.hasKey(NBT.TEXTURE_FOLDER)) { + if (GregTechAPI.sBlockIcons == null && nbt.hasKey(NBT.TEXTURE_FOLDER)) { loadTextures(nbt.getString(NBT.TEXTURE_FOLDER)); } else { copyTextures(); @@ -284,7 +284,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity nbt.setShort(NBT.MTE_ID, mteID); nbt.setShort(NBT.MTE_REG, mteRegistry); // write the Custom Name - if (GT_Utility.isStringValid(customName)) { + if (GTUtility.isStringValid(customName)) { final NBTTagCompound displayNBT; if (nbt.hasKey(NBT.DISPLAY)) { displayNBT = nbt.getCompoundTag(NBT.DISPLAY); @@ -349,7 +349,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity public TileEntity getTileEntity(int aX, int aY, int aZ) { if (worldObj == null || (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ))) return null; - return GT_Util.getTileEntity(worldObj, aX, aY, aZ, true); + return GTUtil.getTileEntity(worldObj, aX, aY, aZ, true); } @Override @@ -410,7 +410,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity @Override public String getCustomName() { - return GT_Utility.isStringValid(customName) ? customName : null; + return GTUtility.isStringValid(customName) ? customName : null; } @Override @@ -468,7 +468,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity if (shouldTriggerBlockUpdate()) { // If we're triggering a block update this will call onMachineBlockUpdate() - GregTech_API.causeMachineUpdate(worldObj, xCoord, yCoord, zCoord); + GregTechAPI.causeMachineUpdate(worldObj, xCoord, yCoord, zCoord); } else { // If we're not trigger a cascading one, call the update here. onMachineBlockUpdate(); @@ -653,7 +653,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { return true; } @@ -696,13 +696,13 @@ public abstract class MultiTileEntity extends CoverableTileEntity @Override public String getOwnerName() { - if (GT_Utility.isStringInvalid(ownerName)) return "Player"; + if (GTUtility.isStringInvalid(ownerName)) return "Player"; return ownerName; } @Override public String setOwnerName(String aName) { - if (GT_Utility.isStringInvalid(aName)) return ownerName = "Player"; + if (GTUtility.isStringInvalid(aName)) return ownerName = "Player"; return ownerName = aName; } @@ -741,7 +741,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity return allowRightclick(aPlayer) && onRightClick(aPlayer, side, aX, aY, aZ); } catch (Throwable e) { GT_FML_LOGGER.error("onBlockActivated Failed", e); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); return true; } } @@ -752,7 +752,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final ForgeDirection tSide = (getCoverIDAtSide(side) == 0) - ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) + ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(side).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { @@ -764,37 +764,37 @@ public abstract class MultiTileEntity extends CoverableTileEntity if (!privateAccess() || aPlayer.getDisplayName() .equalsIgnoreCase(getOwnerName())) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - final ForgeDirection wrenchSide = GT_Utility.determineWrenchingSide(side, aX, aY, aZ); + final ForgeDirection wrenchSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GTUtility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { // TODO (Colorization) } - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) return onWrenchRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList)) return onScrewdriverRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sHardHammerList)) return onHammerRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSoftHammerList)) return onMalletRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) return onSolderingRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList)) return onWireCutterRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ, tCurrentItem); final ForgeDirection coverSide = getCoverIDAtSide(side) == 0 ? wrenchSide : side; if (getCoverIDAtSide(coverSide) == 0) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { - if (GregTech_API.getCoverBehaviorNew(tCurrentItem) + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { + if (GregTechAPI.getCoverBehaviorNew(tCurrentItem) .isCoverPlaceable(coverSide, tCurrentItem, this) - && allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + && allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; - GT_Utility.sendSoundToPlayers( + GTUtility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -808,9 +808,9 @@ public abstract class MultiTileEntity extends CoverableTileEntity return true; } } else { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - GT_Utility.sendSoundToPlayers( + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCrowbarList)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + GTUtility.sendSoundToPlayers( worldObj, SoundResource.RANDOM_BREAK, 1.0F, @@ -825,7 +825,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity } } } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. - side = (getCoverIDAtSide(side) == 0) ? GT_Utility.determineWrenchingSide(side, aX, aY, aZ) : side; + side = (getCoverIDAtSide(side) == 0) ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; return getCoverIDAtSide(side) > 0 && getCoverBehaviorAtSideNew(side).onCoverShiftRightClick( side, getCoverIDAtSide(side), @@ -867,7 +867,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity return false; } - GT_UIInfos.openGTTileEntityUI(this, aPlayer); + GTUIInfos.openGTTileEntityUI(this, aPlayer); System.out.println("Trying to open a UI"); return true; } @@ -875,15 +875,15 @@ public abstract class MultiTileEntity extends CoverableTileEntity public boolean onWrenchRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, ForgeDirection wrenchSide, float aX, float aY, float aZ, ItemStack aTool) { if (setMainFacing(wrenchSide)) { - GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); + GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GTUtility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); } return onWrenchRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ); } public boolean onScrewdriverRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, ForgeDirection wrenchSide, float aX, float aY, float aZ, ItemStack aTool) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { + if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( wrenchSide, getCoverBehaviorAtSideNew(wrenchSide).onCoverScrewdriverClick( @@ -896,7 +896,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity aY, aZ)); // TODO: Update connections! - GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); + GTUtility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); } return onScrewdriverRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ); } @@ -1033,20 +1033,20 @@ public abstract class MultiTileEntity extends CoverableTileEntity /** * @return a Packet containing all Data which has to be synchronised to the Client - Override as needed */ - public GT_Packet_MultiTileEntity getClientDataPacket() { + public GTPacketMultiTileEntity getClientDataPacket() { - final GT_Packet_MultiTileEntity packet = new GT_Packet_MultiTileEntity(false); + final GTPacketMultiTileEntity packet = new GTPacketMultiTileEntity(false); return packet; } @Override public void sendClientData(EntityPlayerMP aPlayer) { if (worldObj == null || worldObj.isRemote) return; - final GT_Packet_New tPacket = getClientDataPacket(); + final GTPacketNew tPacket = getClientDataPacket(); if (aPlayer == null) { - GT_Values.NW.sendPacketToAllPlayersInRange(worldObj, tPacket, getXCoord(), getZCoord()); + GTValues.NW.sendPacketToAllPlayersInRange(worldObj, tPacket, getXCoord(), getZCoord()); } else { - GT_Values.NW.sendToPlayer(tPacket, aPlayer); + GTValues.NW.sendToPlayer(tPacket, aPlayer); } sendCoverDataIfNeeded(); } @@ -1339,20 +1339,20 @@ public abstract class MultiTileEntity extends CoverableTileEntity } @Override - public void getFullPacketData(GT_Packet_MultiTileEntity packet) { + public void getFullPacketData(GTPacketMultiTileEntity packet) { packet.addData(new CoordinateData(getCoords())); packet.addData(new CommonData(mStrongRedstone, color, (byte) 0)); packet.addData(new MultiTileEntityData(mteRegistry, mteID)); } @Override - public void getGraphicPacketData(GT_Packet_MultiTileEntity packet) { + public void getGraphicPacketData(GTPacketMultiTileEntity packet) { packet.addData(new CoordinateData(getCoords())); packet.addData(new MultiTileEntityData(mteRegistry, mteID)); } @Override - public void getTimedPacketData(GT_Packet_MultiTileEntity packet) { + public void getTimedPacketData(GTPacketMultiTileEntity packet) { packet.addData(new CoordinateData(getCoords())); packet.addData(new MultiTileEntityData(mteRegistry, mteID)); } @@ -1361,21 +1361,21 @@ public abstract class MultiTileEntity extends CoverableTileEntity public void sendFullPacket(@Nonnull EntityPlayerMP player) { fullPacket.clearData(); getFullPacketData(fullPacket); - GT_Values.NW.sendToPlayer(fullPacket, player); + GTValues.NW.sendToPlayer(fullPacket, player); } @Override public void sendGraphicPacket() { graphicPacket.clearData(); getGraphicPacketData(graphicPacket); - GT_Values.NW.sendPacketToAllPlayersInRange(worldObj, graphicPacket, getXCoord(), getZCoord()); + GTValues.NW.sendPacketToAllPlayersInRange(worldObj, graphicPacket, getXCoord(), getZCoord()); } @Override public void sendTimedPacket() { timedPacket.clearData(); getTimedPacketData(timedPacket); - GT_Values.NW.sendPacketToAllPlayersInRange(worldObj, timedPacket, getXCoord(), getZCoord()); + GTValues.NW.sendPacketToAllPlayersInRange(worldObj, timedPacket, getXCoord(), getZCoord()); } @Override diff --git a/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java index 2837a88180..7866ad69dc 100644 --- a/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java @@ -1,12 +1,12 @@ package gregtech.api.multitileentity.base; -import static gregtech.api.enums.GT_Values.NW; +import static gregtech.api.enums.GTValues.NW; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.Packet; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.net.GT_Packet_SendCoverData; +import gregtech.api.net.GTPacketSendCoverData; import gregtech.api.util.ISerializableObject; import gregtech.common.covers.CoverInfo; @@ -45,7 +45,7 @@ public abstract class NonTickableMultiTileEntity extends MultiTileEntity { } else { // Otherwise, send the data right away final CoverInfo coverInfo = getCoverInfoAtSide(side); - NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_SendCoverData(coverInfo, this), xCoord, zCoord); + NW.sendPacketToAllPlayersInRange(worldObj, new GTPacketSendCoverData(coverInfo, this), xCoord, zCoord); // Just in case coverInfo.setNeedsUpdate(false); diff --git a/src/main/java/gregtech/api/multitileentity/base/TickableMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/TickableMultiTileEntity.java index 987a4c18b3..dfc600483b 100644 --- a/src/main/java/gregtech/api/multitileentity/base/TickableMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/base/TickableMultiTileEntity.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity.base; -import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.GTMod.GT_FML_LOGGER; import java.util.HashMap; import java.util.Map; @@ -14,11 +14,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.task.TaskHost; import gregtech.api.task.TickableTask; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Util; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtil; public abstract class TickableMultiTileEntity extends MultiTileEntity implements TaskHost { @@ -57,7 +57,7 @@ public abstract class TickableMultiTileEntity extends MultiTileEntity implements try { if (timer++ == 0) { markDirty(); - GT_Util.markChunkDirty(this); + GTUtil.markChunkDirty(this); onFirstTick(isServerSide); } if (isDead()) { @@ -80,7 +80,7 @@ public abstract class TickableMultiTileEntity extends MultiTileEntity implements } catch (Throwable e) { GT_FML_LOGGER.error("UpdateEntity Failed", e); - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); try { onTickFailed(timer, isServerSide); } catch (Throwable e2) { @@ -133,8 +133,8 @@ public abstract class TickableMultiTileEntity extends MultiTileEntity implements @Override protected final void readTasksNBT(NBTTagCompound nbt) { - if (nbt.hasKey(GT_Values.NBT.TASKS)) { - NBTTagCompound tasksTag = nbt.getCompoundTag(GT_Values.NBT.TASKS); + if (nbt.hasKey(GTValues.NBT.TASKS)) { + NBTTagCompound tasksTag = nbt.getCompoundTag(GTValues.NBT.TASKS); for (TickableTask<?> task : tasks.values()) { if (tasksTag.hasKey(task.getName())) { task.readFromNBT(tasksTag.getCompoundTag(task.getName())); @@ -151,7 +151,7 @@ public abstract class TickableMultiTileEntity extends MultiTileEntity implements task.writeToNBT(tag); tasksTag.setTag(task.getName(), tag); } - aNBT.setTag(GT_Values.NBT.TASKS, tasksTag); + aNBT.setTag(GTValues.NBT.TASKS, tasksTag); } @Override diff --git a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileCasing.java b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileCasing.java index 73bd55738a..4efaff34d7 100644 --- a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileCasing.java +++ b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileCasing.java @@ -3,7 +3,7 @@ package gregtech.api.multitileentity.enums; import static gregtech.api.util.GT_StructureUtilityMuTE.createMuTEStructureCasing; import static gregtech.loaders.preload.GT_Loader_MultiTileEntities.CASING_REGISTRY_NAME; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.util.GT_StructureUtilityMuTE; public enum GT_MultiTileCasing { @@ -19,7 +19,7 @@ public enum GT_MultiTileCasing { LaserEngraverUpgrade2(8), LaserEngraverUpgrade3(9), LaserEngraverUpgrade4(10), - NONE(GT_Values.W); + NONE(GTValues.W); private final int meta; private final GT_StructureUtilityMuTE.MuTEStructureCasing casing; diff --git a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileComponentCasing.java b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileComponentCasing.java index e062ecc705..431da32353 100644 --- a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileComponentCasing.java +++ b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileComponentCasing.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity.enums; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; public enum GT_MultiTileComponentCasing { @@ -116,7 +116,7 @@ public enum GT_MultiTileComponentCasing { UMV_FieldGenerator(109), UXV_FieldGenerator(110), MAX_FieldGenerator(111), - NONE(GT_Values.W); + NONE(GTValues.W); private final int meta; diff --git a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileMachine.java b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileMachine.java index 7cdde78986..6787ab00d7 100644 --- a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileMachine.java +++ b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileMachine.java @@ -1,11 +1,11 @@ package gregtech.api.multitileentity.enums; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; public enum GT_MultiTileMachine { CokeOven(0), - NONE(GT_Values.W); + NONE(GTValues.W); private final int meta; diff --git a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileUpgradeCasing.java b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileUpgradeCasing.java index 296bae546d..5acdd5aeef 100644 --- a/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileUpgradeCasing.java +++ b/src/main/java/gregtech/api/multitileentity/enums/GT_MultiTileUpgradeCasing.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity.enums; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; public enum GT_MultiTileUpgradeCasing { @@ -57,7 +57,7 @@ public enum GT_MultiTileUpgradeCasing { Insulator_NextGen(107), Insulator_Omnipotent(108), Insulator_OmegaType(109), - NONE(GT_Values.W); + NONE(GTValues.W); private final int meta; diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/SyncedMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/interfaces/SyncedMultiTileEntity.java index 2045f28d67..0f959c6bce 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/SyncedMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/SyncedMultiTileEntity.java @@ -4,7 +4,7 @@ import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayerMP; -import gregtech.api.net.GT_Packet_MultiTileEntity; +import gregtech.api.net.GTPacketMultiTileEntity; public interface SyncedMultiTileEntity { @@ -19,10 +19,10 @@ public interface SyncedMultiTileEntity { /** * Should always collect all the data that the controller or casing has and should send * Called by {@link #sendFullPacket()} - * + * * @param packet The packet which will be sent */ - void getFullPacketData(GT_Packet_MultiTileEntity packet); + void getFullPacketData(GTPacketMultiTileEntity packet); /** * Will send a packet at a certain period of time, defined by {@link #getTimedPacketPeriod()}, to all players around @@ -35,10 +35,10 @@ public interface SyncedMultiTileEntity { * Collects all the data that should be sent out at a certain period of time defined by * {@link #getTimedPacketPeriod()} * Called by {@link #sendTimedPacket()} - * + * * @param packet The packet which will be sent */ - void getTimedPacketData(GT_Packet_MultiTileEntity packet); + void getTimedPacketData(GTPacketMultiTileEntity packet); /** * Defines the period of time at which a timed packet should be sent out. Default 20 ticks @@ -56,8 +56,8 @@ public interface SyncedMultiTileEntity { /** * Collects all the data that is needed to be send every single tick * Called by {@link #sendGraphicPacket()} - * + * * @param packet The packet which will be sent */ - void getGraphicPacketData(GT_Packet_MultiTileEntity packet); + void getGraphicPacketData(GTPacketMultiTileEntity packet); } diff --git a/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java b/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java index 0953b4905c..32b87126ca 100644 --- a/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java +++ b/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity.machine; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GTValues.*; import static gregtech.api.enums.TickTime.MINUTE; import java.io.IOException; @@ -30,8 +30,8 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GT_Values.NBT; +import gregtech.api.enums.GTValues; +import gregtech.api.enums.GTValues.NBT; import gregtech.api.enums.InventoryType; import gregtech.api.enums.Mods; import gregtech.api.enums.SoundResource; @@ -55,8 +55,8 @@ import gregtech.api.multitileentity.base.TickableMultiTileEntity; import gregtech.api.multitileentity.interfaces.IMultiTileMachine; import gregtech.api.render.TextureFactory; import gregtech.api.task.tasks.ProcessingTask; -import gregtech.api.util.GT_Utility; -import gregtech.client.GT_SoundLoop; +import gregtech.api.util.GTUtility; +import gregtech.client.GTSoundLoop; import gregtech.common.gui.MachineGUIProvider; public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> extends TickableMultiTileEntity @@ -106,7 +106,7 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex protected GUIProvider<?> guiProvider = createGUIProvider(); @SideOnly(Side.CLIENT) - protected GT_SoundLoop activitySoundLoop; + protected GTSoundLoop activitySoundLoop; public MultiTileBasicMachine() { new ProcessingTask<>(this); @@ -388,16 +388,16 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex switch (aIndex) { case PROCESS_START_SOUND_INDEX -> { if (getProcessStartSound() != null) - GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } - case INTERRUPT_SOUND_INDEX -> GT_Utility + case INTERRUPT_SOUND_INDEX -> GTUtility .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { if (aIndex == PROCESS_START_SOUND_INDEX && getProcessStartSound() != null) { - GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); + GTUtility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } } @@ -412,7 +412,7 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex @SideOnly(Side.CLIENT) protected void doActivitySound(ResourceLocation activitySound) { if (isActive() && activitySound != null && activitySoundLoop == null) { - activitySoundLoop = new GT_SoundLoop(activitySound, this, false, true); + activitySoundLoop = new GTSoundLoop(activitySound, this, false, true); Minecraft.getMinecraft() .getSoundHandler() .playSound(activitySoundLoop); @@ -549,7 +549,7 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex @Override protected void addDebugInfo(EntityPlayer player, int logLevel, ArrayList<String> list) { list.add( - GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + GTUtility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + getOwnerName() + EnumChatFormatting.RESET + " (" @@ -567,30 +567,30 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex list.add( StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(logic.getStoredEnergy()) + + GTUtility.formatNumbers(logic.getStoredEnergy()) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(logic.getCapacity()) + + GTUtility.formatNumbers(logic.getCapacity()) + EnumChatFormatting.RESET + " EU"); list.add( StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(getProcessingLogic().getCalculatedEut()) + + GTUtility.formatNumbers(getProcessingLogic().getCalculatedEut()) + EnumChatFormatting.RESET + " EU/t"); list.add( StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(logic.getVoltage()) + + GTUtility.formatNumbers(logic.getVoltage()) + EnumChatFormatting.RESET // TODO: Put ampere getter here, once that's variable + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(logic.getVoltage())] + + VN[GTUtility.getTier(logic.getVoltage())] + EnumChatFormatting.RESET); } @@ -598,11 +598,11 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex // TODO: Add CPU load calculator list.add( - "Average CPU load of ~" + GT_Utility.formatNumbers(0) + "Average CPU load of ~" + GTUtility.formatNumbers(0) + "ns over " - + GT_Utility.formatNumbers(0) + + GTUtility.formatNumbers(0) + " ticks with worst time of " - + GT_Utility.formatNumbers(0) + + GTUtility.formatNumbers(0) + "ns."); } @@ -613,11 +613,11 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex list.add( StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(progressTime > 20 ? progressTime / 20 : progressTime) + + GTUtility.formatNumbers(progressTime > 20 ? progressTime / 20 : progressTime) + EnumChatFormatting.RESET + (progressTime > 20 ? " s / " : " ticks / ") + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxProgressTime > 20 ? maxProgressTime / 20 : maxProgressTime) + + GTUtility.formatNumbers(maxProgressTime > 20 ? maxProgressTime / 20 : maxProgressTime) + EnumChatFormatting.RESET + (maxProgressTime > 20 ? " s" : " ticks")); } @@ -678,7 +678,7 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex switch (soundEventValue) { case PROCESS_START_SOUND_INDEX -> { - if (getProcessStartSound() != null) GT_Utility.doSoundAtClient( + if (getProcessStartSound() != null) GTUtility.doSoundAtClient( getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, @@ -686,7 +686,7 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex getYCoord(), getZCoord()); } - case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient( + case INTERRUPT_SOUND_INDEX -> GTUtility.doSoundAtClient( SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, @@ -765,8 +765,8 @@ public abstract class MultiTileBasicMachine<P extends MuTEProcessingLogic<P>> ex } protected void updatePowerLogic() { - power.setEnergyCapacity(GT_Values.V[tier] * power.getMaxAmperage() * 2 * MINUTE); - power.setMaxVoltage(GT_Values.V[tier]); + power.setEnergyCapacity(GTValues.V[tier] * power.getMaxAmperage() * 2 * MINUTE); + power.setMaxVoltage(GTValues.V[tier]); power.setMaxAmperage(1); } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/ComplexParallelController.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/ComplexParallelController.java index cdcb77d6e5..3abb69dd51 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/ComplexParallelController.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/ComplexParallelController.java @@ -15,8 +15,8 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import gregtech.api.logic.ComplexParallelProcessingLogic; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Waila; +import gregtech.api.util.GTUtility; +import gregtech.api.util.GTWaila; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -56,12 +56,12 @@ public abstract class ComplexParallelController<C extends ComplexParallelControl + (i + 1) + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers( + + GTUtility.formatNumbers( processing.getProgress(i) > 20 ? processing.getProgress(i) / 20 : processing.getProgress(i)) + EnumChatFormatting.RESET + (processing.getProgress(i) > 20 ? " s / " : " ticks / ") + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers( + + GTUtility.formatNumbers( processing.getDuration(i) > 20 ? processing.getDuration(i) / 20 : processing.getDuration(i)) + EnumChatFormatting.RESET + (processing.getDuration(i) > 20 ? " s" : " ticks")); @@ -92,7 +92,7 @@ public abstract class ComplexParallelController<C extends ComplexParallelControl currentTip.add( "Process " + (i + 1) + ": " - + GT_Waila + + GTWaila .getMachineProgressString(maxProgress > 0 && maxProgress >= progress, maxProgress, progress)); } } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java index 552cf6d94e..1eaae5997d 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java @@ -1,6 +1,6 @@ package gregtech.api.multitileentity.multiblock.base; -import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; +import static gregtech.api.util.GTUtility.moveMultipleItemStacks; import static gregtech.common.misc.WirelessNetworkManager.strongCheckOrAddUser; import static mcp.mobius.waila.api.SpecialChars.*; @@ -46,7 +46,7 @@ import com.gtnewhorizon.structurelib.util.Vec3Impl; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.enums.GT_Values.NBT; +import gregtech.api.enums.GTValues.NBT; import gregtech.api.enums.InventoryType; import gregtech.api.enums.VoidingMode; import gregtech.api.interfaces.IDescribable; @@ -64,11 +64,11 @@ import gregtech.api.multitileentity.interfaces.IMultiBlockPart; import gregtech.api.multitileentity.machine.MultiTileBasicMachine; import gregtech.api.multitileentity.multiblock.casing.FunctionalCasing; import gregtech.api.multitileentity.multiblock.casing.UpgradeCasing; -import gregtech.api.net.GT_Packet_MultiTileEntity; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Waila; +import gregtech.api.net.GTPacketMultiTileEntity; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTUtility; +import gregtech.api.util.GTWaila; +import gregtech.api.util.MultiblockTooltipBuilder; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -81,7 +81,7 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce public static final String ALL_INVENTORIES_NAME = "all"; protected static final int AUTO_OUTPUT_FREQUENCY_TICK = 20; - private static final Map<Integer, GT_Multiblock_Tooltip_Builder> tooltip = new ConcurrentHashMap<>(); + private static final Map<Integer, MultiblockTooltipBuilder> tooltip = new ConcurrentHashMap<>(); private final List<WeakTargetRef<UpgradeCasing>> upgradeCasings = new ArrayList<>(); private final List<WeakTargetRef<FunctionalCasing>> functionalCasings = new ArrayList<>(); protected BuildState buildState = new BuildState(); @@ -131,7 +131,7 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce /** * Create the tooltip for this multi block controller. */ - protected abstract GT_Multiblock_Tooltip_Builder createTooltip(); + protected abstract MultiblockTooltipBuilder createTooltip(); /** * @return The starting offset for the structure builder @@ -269,8 +269,8 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce return getMultiTileEntityRegistryID() << 16 + getMultiTileEntityID(); } - protected GT_Multiblock_Tooltip_Builder getTooltip() { - GT_Multiblock_Tooltip_Builder builder = tooltip.get(getToolTipID()); + protected MultiblockTooltipBuilder getTooltip() { + MultiblockTooltipBuilder builder = tooltip.get(getToolTipID()); if (builder == null) { builder = createTooltip(); tooltip.put(getToolTipID(), builder); @@ -423,7 +423,7 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce if (aPlayer.isSneaking()) { // we won't be allowing horizontal flips, as it can be perfectly emulated by rotating twice and flipping // horizontally allowing an extra round of flip make it hard to draw meaningful flip markers in - // GT_Proxy#drawGrid + // GTProxy#drawGrid toolSetFlip(getFlip().isHorizontallyFlipped() ? Flip.NONE : Flip.HORIZONTAL); } else { toolSetRotation(null); @@ -615,7 +615,7 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce } @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) { + public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { return side != facing; } @@ -992,7 +992,7 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce if (isSimpleMachine) { boolean isActive = tag.getBoolean("isActive"); currentTip.add( - GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); + GTWaila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); } boolean isActive = tag.getBoolean("isActive"); if (isActive) { @@ -1002,23 +1002,23 @@ public abstract class Controller<C extends Controller<C, P>, P extends MuTEProce currentTip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.use_with_amperage", - GT_Utility.formatNumbers(actualEnergyUsage), - GT_Utility.getAmperageForTier(actualEnergyUsage, (byte) energyTier), - GT_Utility.getColoredTierNameFromTier((byte) energyTier))); + GTUtility.formatNumbers(actualEnergyUsage), + GTUtility.getAmperageForTier(actualEnergyUsage, (byte) energyTier), + GTUtility.getColoredTierNameFromTier((byte) energyTier))); } else if (actualEnergyUsage < 0) { currentTip.add( StatCollector.translateToLocalFormatted( "GT5U.waila.energy.produce_with_amperage", - GT_Utility.formatNumbers(-actualEnergyUsage), - GT_Utility.getAmperageForTier(-actualEnergyUsage, (byte) energyTier), - GT_Utility.getColoredTierNameFromTier((byte) energyTier))); + GTUtility.formatNumbers(-actualEnergyUsage), + GTUtility.getAmperageForTier(-actualEnergyUsage, (byte) energyTier), + GTUtility.getColoredTierNameFromTier((byte) energyTier))); } } } @Override - public GT_Packet_MultiTileEntity getClientDataPacket() { - final GT_Packet_MultiTileEntity packet = super.getClientDataPacket(); + public GTPacketMultiTileEntity getClientDataPacket() { + final GTPacketMultiTileEntity packet = super.getClientDataPacket(); return packet; diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java index 5a16ed4b38..2c3cafc67d 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java @@ -1,7 +1,7 @@ package gregtech.api.multitileentity.multiblock.base; import static com.google.common.math.LongMath.log2; -import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GTValues.B; import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN; import static gregtech.api.enums.Textures.BlockIcons.FLUID_OUT_SIGN; import static gregtech.api.enums.Textures.BlockIcons.ITEM_IN_SIGN; @@ -36,9 +36,9 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import gregtech.api.enums.GT_Values.NBT; +import gregtech.api.enums.GTValues.NBT; import gregtech.api.enums.InventoryType; -import gregtech.api.fluid.FluidTankGT; +import gregtech.api.fluid.GTFluidTank; import gregtech.api.gui.GUIHost; import gregtech.api.gui.GUIProvider; import gregtech.api.interfaces.ITexture; @@ -54,7 +54,7 @@ import gregtech.api.multitileentity.enums.MultiTileCasingPurpose; import gregtech.api.multitileentity.interfaces.IMultiBlockController; import gregtech.api.multitileentity.interfaces.IMultiBlockPart; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.common.covers.CoverInfo; import gregtech.common.gui.PartGUIProvider; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -80,7 +80,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity protected UUID lockedInventory; protected int mLockedInventoryIndex = 0; - protected FluidTankGT configurationTank = new FluidTankGT(); + protected GTFluidTank configurationTank = new GTFluidTank(); @Nonnull protected final GUIProvider<?> guiProvider = createGUIProvider(); @@ -436,7 +436,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity if (aPlayer.isSneaking()) { facing = wrenchSide; } - GT_Utility.sendChatToPlayer(aPlayer, "Mode set to `" + getModeName(mode) + "' (" + mode + ")"); + GTUtility.sendChatToPlayer(aPlayer, "Mode set to `" + getModeName(mode) + "' (" + mode + ")"); sendClientData((EntityPlayerMP) aPlayer); return true; } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/casing/FunctionalCasing.java b/src/main/java/gregtech/api/multitileentity/multiblock/casing/FunctionalCasing.java index bc3c857fd6..d48bbd03fd 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/casing/FunctionalCasing.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/casing/FunctionalCasing.java @@ -2,7 +2,7 @@ package gregtech.api.multitileentity.multiblock.casing; import net.minecraft.nbt.NBTTagCompound; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.multitileentity.multiblock.base.MultiBlockPart; public abstract class FunctionalCasing extends MultiBlockPart { @@ -19,7 +19,7 @@ public abstract class FunctionalCasing extends MultiBlockPart { @Override public void readMultiTileNBT(NBTTagCompound nbt) { super.readMultiTileNBT(nbt); - tier = nbt.getInteger(GT_Values.NBT.TIER); + tier = nbt.getInteger(GTValues.NBT.TIER); } @Override diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/casing/UpgradeCasing.java b/src/main/java/gregtech/api/multitileentity/multiblock/casing/UpgradeCasing.java index 566afcd770..ae5b36c1e0 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/casing/UpgradeCasing.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/casing/UpgradeCasing.java @@ -2,7 +2,7 @@ package gregtech.api.multitileentity.multiblock.casing; import net.minecraft.nbt.NBTTagCompound; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.multitileentity.interfaces.IMultiBlockController; import gregtech.api.multitileentity.multiblock.base.MultiBlockPart; @@ -27,7 +27,7 @@ public abstract class UpgradeCasing extends MultiBlockPart { @Override public void readMultiTileNBT(NBTTagCompound aNBT) { super.readMultiTileNBT(aNBT); - tier = aNBT.getInteger(GT_Values.NBT.TIER); + tier = aNBT.getInteger(GTValues.NBT.TIER); } protected abstract void customWork(IMultiBlockController aTarget); diff --git a/src/main/java/gregtech/api/net/GT_Packet.java b/src/main/java/gregtech/api/net/GTPacket.java index d06ea7d0d3..1d2de3303b 100644 --- a/src/main/java/gregtech/api/net/GT_Packet.java +++ b/src/main/java/gregtech/api/net/GTPacket.java @@ -8,12 +8,12 @@ import com.google.common.io.ByteArrayDataInput; import io.netty.buffer.ByteBuf; /** - * @deprecated Use {@link GT_Packet_New} instead + * @deprecated Use {@link GTPacketNew} instead */ @Deprecated -public abstract class GT_Packet { +public abstract class GTPacket { - public GT_Packet(boolean aIsReference) { + public GTPacket(boolean aIsReference) { // } @@ -42,7 +42,7 @@ public abstract class GT_Packet { /** * @return encoded byte Stream */ - public abstract GT_Packet decode(ByteArrayDataInput aData); + public abstract GTPacket decode(ByteArrayDataInput aData); /** * Process the packet diff --git a/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java b/src/main/java/gregtech/api/net/GTPacketBlockEvent.java index 9adf583698..a2164f4f07 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java +++ b/src/main/java/gregtech/api/net/GTPacketBlockEvent.java @@ -10,17 +10,17 @@ import io.netty.buffer.ByteBuf; /** * Used to transfer Block Events in a much better fashion */ -public class GT_Packet_Block_Event extends GT_Packet_New { +public class GTPacketBlockEvent extends GTPacketNew { private int mX, mZ; private short mY; private byte mID, mValue; - public GT_Packet_Block_Event() { + public GTPacketBlockEvent() { super(true); } - public GT_Packet_Block_Event(int aX, short aY, int aZ, byte aID, byte aValue) { + public GTPacketBlockEvent(int aX, short aY, int aZ, byte aID, byte aValue) { super(false); mX = aX; mY = aY; @@ -39,8 +39,8 @@ public class GT_Packet_Block_Event extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_Block_Event( + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketBlockEvent( aData.readInt(), aData.readShort(), aData.readInt(), @@ -58,6 +58,6 @@ public class GT_Packet_Block_Event extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.BLOCK_EVENT.id; + return GTPacketTypes.BLOCK_EVENT.id; } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java b/src/main/java/gregtech/api/net/GTPacketClientPreference.java index a5fd8a2e08..ea5d9ec476 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java +++ b/src/main/java/gregtech/api/net/GTPacketClientPreference.java @@ -7,27 +7,27 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.GT_Mod; -import gregtech.api.util.GT_ClientPreference; +import gregtech.GTMod; +import gregtech.api.util.GTClientPreference; import io.netty.buffer.ByteBuf; -public class GT_Packet_ClientPreference extends GT_Packet_New { +public class GTPacketClientPreference extends GTPacketNew { - private GT_ClientPreference mPreference; + private GTClientPreference mPreference; private EntityPlayerMP mPlayer; - public GT_Packet_ClientPreference() { + public GTPacketClientPreference() { super(true); } - public GT_Packet_ClientPreference(GT_ClientPreference mPreference) { + public GTPacketClientPreference(GTClientPreference mPreference) { super(false); this.mPreference = mPreference; } @Override public byte getPacketID() { - return GT_PacketTypes.CLIENT_PREFERENCE.id; + return GTPacketTypes.CLIENT_PREFERENCE.id; } @Override @@ -39,7 +39,7 @@ public class GT_Packet_ClientPreference extends GT_Packet_New { @Override public void process(IBlockAccess aWorld) { - if (mPlayer != null) GT_Mod.gregtechproxy.setClientPreference(mPlayer.getUniqueID(), mPreference); + if (mPlayer != null) GTMod.gregtechproxy.setClientPreference(mPlayer.getUniqueID(), mPreference); } @Override @@ -51,12 +51,8 @@ public class GT_Packet_ClientPreference extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_ClientPreference( - new GT_ClientPreference( - aData.readBoolean(), - aData.readBoolean(), - aData.readBoolean(), - aData.readBoolean())); + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketClientPreference( + new GTClientPreference(aData.readBoolean(), aData.readBoolean(), aData.readBoolean(), aData.readBoolean())); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java b/src/main/java/gregtech/api/net/GTPacketMultiTileEntity.java index 33cb4f2dcf..b151f8eb5f 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java +++ b/src/main/java/gregtech/api/net/GTPacketMultiTileEntity.java @@ -1,6 +1,6 @@ package gregtech.api.net; -import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GTValues.B; import java.util.HashSet; import java.util.Objects; @@ -18,13 +18,13 @@ import gregtech.api.net.data.MultiTileEntityProcess; import gregtech.api.net.data.PacketData; import io.netty.buffer.ByteBuf; -public class GT_Packet_MultiTileEntity extends GT_Packet_New { +public class GTPacketMultiTileEntity extends GTPacketNew { private final Set<PacketData<MultiTileEntityProcess>> data = new HashSet<>(); public static final int COVERS = B[0], REDSTONE = B[1], MODES = B[2], CONTROLLER = B[3], INVENTORY_INDEX = B[4], INVENTORY_NAME_ID = B[5], BOOLEANS = B[6], SOUND = B[7]; - public GT_Packet_MultiTileEntity(boolean reference) { + public GTPacketMultiTileEntity(boolean reference) { super(reference); } @@ -97,11 +97,11 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput in) { + public GTPacketNew decode(ByteArrayDataInput in) { Objects.requireNonNull(in); final int packetFeatures = in.readInt(); - final GT_Packet_MultiTileEntity packet = new GT_Packet_MultiTileEntity(false); + final GTPacketMultiTileEntity packet = new GTPacketMultiTileEntity(false); if (containsBit(packetFeatures, CoordinateData.COORDINATE_DATA_ID)) { packet.addData(new CoordinateData()); @@ -225,7 +225,7 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { * } * } catch (Exception e) { * e.printStackTrace(); - * GT_Mod.GT_FML_LOGGER.error( + * GTMod.GT_FML_LOGGER.error( * "Exception setting tile entity data for tile entity {} at ({}, {}, {})", * tTileEntity, * mX, @@ -237,7 +237,7 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.MULTI_TILE_ENTITY.id; + return GTPacketTypes.MULTI_TILE_ENTITY.id; } public void clearData() { diff --git a/src/main/java/gregtech/api/net/GT_Packet_MusicSystemData.java b/src/main/java/gregtech/api/net/GTPacketMusicSystemData.java index 13ebf49205..c650188594 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_MusicSystemData.java +++ b/src/main/java/gregtech/api/net/GTPacketMusicSystemData.java @@ -4,26 +4,26 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.util.GT_MusicSystem; +import gregtech.api.util.GTMusicSystem; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -public class GT_Packet_MusicSystemData extends GT_Packet_New { +public class GTPacketMusicSystemData extends GTPacketNew { ByteBuf storedData; - public GT_Packet_MusicSystemData() { + public GTPacketMusicSystemData() { super(true); } - public GT_Packet_MusicSystemData(ByteBuf data) { + public GTPacketMusicSystemData(ByteBuf data) { super(false); this.storedData = data; } @Override public byte getPacketID() { - return GT_PacketTypes.MUSIC_SYSTEM_DATA.id; + return GTPacketTypes.MUSIC_SYSTEM_DATA.id; } @Override @@ -39,11 +39,11 @@ public class GT_Packet_MusicSystemData extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { + public GTPacketNew decode(ByteArrayDataInput aData) { final int len = aData.readInt(); final byte[] fullData = new byte[len]; aData.readFully(fullData); - return new GT_Packet_MusicSystemData(Unpooled.wrappedBuffer(fullData)); + return new GTPacketMusicSystemData(Unpooled.wrappedBuffer(fullData)); } @Override @@ -52,7 +52,7 @@ public class GT_Packet_MusicSystemData extends GT_Packet_New { return; } storedData.markReaderIndex(); - GT_MusicSystem.ClientSystem.loadUpdatedSources(storedData); + GTMusicSystem.ClientSystem.loadUpdatedSources(storedData); storedData.resetReaderIndex(); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_New.java b/src/main/java/gregtech/api/net/GTPacketNew.java index 41eb1740b3..d3fee800c6 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_New.java +++ b/src/main/java/gregtech/api/net/GTPacketNew.java @@ -6,9 +6,9 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @SuppressWarnings("deprecation") -public abstract class GT_Packet_New extends GT_Packet { +public abstract class GTPacketNew extends GTPacket { - public GT_Packet_New(boolean aIsReference) { + public GTPacketNew(boolean aIsReference) { super(aIsReference); } @@ -26,5 +26,5 @@ public abstract class GT_Packet_New extends GT_Packet { public abstract void encode(ByteBuf aOut); @Override - public abstract GT_Packet_New decode(ByteArrayDataInput aData); + public abstract GTPacketNew decode(ByteArrayDataInput aData); } diff --git a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java b/src/main/java/gregtech/api/net/GTPacketPollution.java index 9b4a367dc4..2f4805aad8 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java +++ b/src/main/java/gregtech/api/net/GTPacketPollution.java @@ -5,19 +5,19 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.common.GT_Client; +import gregtech.common.GTClient; import io.netty.buffer.ByteBuf; -public class GT_Packet_Pollution extends GT_Packet_New { +public class GTPacketPollution extends GTPacketNew { private ChunkCoordIntPair chunk; private int pollution; - public GT_Packet_Pollution() { + public GTPacketPollution() { super(true); } - public GT_Packet_Pollution(ChunkCoordIntPair chunk, int pollution) { + public GTPacketPollution(ChunkCoordIntPair chunk, int pollution) { super(false); this.chunk = chunk; this.pollution = pollution; @@ -31,17 +31,17 @@ public class GT_Packet_Pollution extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_Pollution(new ChunkCoordIntPair(aData.readInt(), aData.readInt()), aData.readInt()); + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketPollution(new ChunkCoordIntPair(aData.readInt(), aData.readInt()), aData.readInt()); } @Override public void process(IBlockAccess aWorld) { - GT_Client.recieveChunkPollutionPacket(chunk, pollution); + GTClient.recieveChunkPollutionPacket(chunk, pollution); } @Override public byte getPacketID() { - return GT_PacketTypes.POLLUTION.id; + return GTPacketTypes.POLLUTION.id; } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java b/src/main/java/gregtech/api/net/GTPacketRequestCoverData.java index bca97b69a5..4679643624 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java +++ b/src/main/java/gregtech/api/net/GTPacketRequestCoverData.java @@ -19,7 +19,7 @@ import io.netty.buffer.ByteBuf; /** * Client -> Server : ask for cover data */ -public class GT_Packet_RequestCoverData extends GT_Packet_New { +public class GTPacketRequestCoverData extends GTPacketNew { protected int mX; protected short mY; @@ -30,11 +30,11 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { protected EntityPlayerMP mPlayer; - public GT_Packet_RequestCoverData() { + public GTPacketRequestCoverData() { super(true); } - public GT_Packet_RequestCoverData(CoverInfo info, ICoverable tile) { + public GTPacketRequestCoverData(CoverInfo info, ICoverable tile) { super(false); this.mX = tile.getXCoord(); this.mY = tile.getYCoord(); @@ -44,7 +44,7 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { this.coverID = info.getCoverID(); } - public GT_Packet_RequestCoverData(int mX, short mY, int mZ, ForgeDirection coverSide, int coverID) { + public GTPacketRequestCoverData(int mX, short mY, int mZ, ForgeDirection coverSide, int coverID) { super(false); this.mX = mX; this.mY = mY; @@ -54,7 +54,7 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { this.coverID = coverID; } - public GT_Packet_RequestCoverData(ForgeDirection coverSide, int coverID, ICoverable tile) { + public GTPacketRequestCoverData(ForgeDirection coverSide, int coverID, ICoverable tile) { super(false); this.mX = tile.getXCoord(); this.mY = tile.getYCoord(); @@ -66,7 +66,7 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.REQUEST_COVER_DATA.id; + return GTPacketTypes.REQUEST_COVER_DATA.id; } @Override @@ -80,8 +80,8 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_RequestCoverData( + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketRequestCoverData( aData.readInt(), aData.readShort(), aData.readInt(), diff --git a/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java b/src/main/java/gregtech/api/net/GTPacketSendCoverData.java index 268aaab803..76adb75d31 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java +++ b/src/main/java/gregtech/api/net/GTPacketSendCoverData.java @@ -6,7 +6,7 @@ import net.minecraftforge.common.util.ForgeDirection; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.metatileentity.CoverableTileEntity; import gregtech.api.util.ISerializableObject; @@ -16,7 +16,7 @@ import io.netty.buffer.ByteBuf; /** * Server -> Client : Update cover data */ -public class GT_Packet_SendCoverData extends GT_Packet_New { +public class GTPacketSendCoverData extends GTPacketNew { protected int mX; protected short mY; @@ -26,11 +26,11 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { protected int coverID; protected ISerializableObject coverData; - public GT_Packet_SendCoverData() { + public GTPacketSendCoverData() { super(true); } - public GT_Packet_SendCoverData(int mX, short mY, int mZ, ForgeDirection coverSide, int coverID, + public GTPacketSendCoverData(int mX, short mY, int mZ, ForgeDirection coverSide, int coverID, ISerializableObject coverData) { super(false); this.mX = mX; @@ -42,7 +42,7 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { this.coverData = coverData; } - public GT_Packet_SendCoverData(CoverInfo info, ICoverable tile) { + public GTPacketSendCoverData(CoverInfo info, ICoverable tile) { super(false); this.mX = tile.getXCoord(); this.mY = tile.getYCoord(); @@ -53,7 +53,7 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { this.coverData = info.getCoverData(); } - public GT_Packet_SendCoverData(ForgeDirection coverSide, int coverID, ISerializableObject coverData, + public GTPacketSendCoverData(ForgeDirection coverSide, int coverID, ISerializableObject coverData, ICoverable tile) { super(false); this.mX = tile.getXCoord(); @@ -67,7 +67,7 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.SEND_COVER_DATA.id; + return GTPacketTypes.SEND_COVER_DATA.id; } @Override @@ -82,15 +82,15 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { + public GTPacketNew decode(ByteArrayDataInput aData) { final int coverId; - return new GT_Packet_SendCoverData( + return new GTPacketSendCoverData( aData.readInt(), aData.readShort(), aData.readInt(), ForgeDirection.getOrientation(aData.readByte()), coverId = aData.readInt(), - GregTech_API.getCoverBehaviorNew(coverId) + GregTechAPI.getCoverBehaviorNew(coverId) .createDataObject() .readFromPacket(aData, null)); } diff --git a/src/main/java/gregtech/api/net/GT_Packet_SendOregenPattern.java b/src/main/java/gregtech/api/net/GTPacketSendOregenPattern.java index 8213ee9c71..9db0e9a471 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SendOregenPattern.java +++ b/src/main/java/gregtech/api/net/GTPacketSendOregenPattern.java @@ -4,20 +4,20 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.util.GT_Log; -import gregtech.common.GT_Worldgenerator; -import gregtech.common.GT_Worldgenerator.OregenPattern; +import gregtech.api.util.GTLog; +import gregtech.common.GTWorldgenerator; +import gregtech.common.GTWorldgenerator.OregenPattern; import io.netty.buffer.ByteBuf; -public class GT_Packet_SendOregenPattern extends GT_Packet_New { +public class GTPacketSendOregenPattern extends GTPacketNew { protected OregenPattern pattern = OregenPattern.AXISSYMMETRICAL; - public GT_Packet_SendOregenPattern() { + public GTPacketSendOregenPattern() { super(true); } - public GT_Packet_SendOregenPattern(OregenPattern pattern) { + public GTPacketSendOregenPattern(OregenPattern pattern) { super(false); this.pattern = pattern; } @@ -28,29 +28,29 @@ public class GT_Packet_SendOregenPattern extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { + public GTPacketNew decode(ByteArrayDataInput aData) { int ordinal = aData.readInt(); // make sure we get valid data: if (ordinal >= 0 && ordinal < OregenPattern.values().length) { - return new GT_Packet_SendOregenPattern(OregenPattern.values()[ordinal]); + return new GTPacketSendOregenPattern(OregenPattern.values()[ordinal]); } // invalid data, default to AXISSYMMETRICAL: - GT_Log.err.println( + GTLog.err.println( String.format( "Received invalid data! Received %d but value must be between 0 and %d! Default (0) will be used.", ordinal, OregenPattern.values().length - 1)); - return new GT_Packet_SendOregenPattern(); + return new GTPacketSendOregenPattern(); } @Override public byte getPacketID() { - return GT_PacketTypes.SEND_OREGEN_PATTERN.id; + return GTPacketTypes.SEND_OREGEN_PATTERN.id; } @Override public void process(IBlockAccess aWorld) { - GT_Worldgenerator.oregenPattern = this.pattern; + GTWorldgenerator.oregenPattern = this.pattern; } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java b/src/main/java/gregtech/api/net/GTPacketSetConfigurationCircuit.java index 2bfdbca9d2..8984cea509 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java +++ b/src/main/java/gregtech/api/net/GTPacketSetConfigurationCircuit.java @@ -15,14 +15,14 @@ import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasInventory; import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; import io.netty.buffer.ByteBuf; /** * Client -> Server: Update machine configuration data */ -public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { +public class GTPacketSetConfigurationCircuit extends GTPacketNew { protected int mX; protected short mY; @@ -31,19 +31,19 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { protected ItemStack circuit; - public GT_Packet_SetConfigurationCircuit() { + public GTPacketSetConfigurationCircuit() { super(true); } - public GT_Packet_SetConfigurationCircuit(IGregTechTileEntity tile, ItemStack circuit) { + public GTPacketSetConfigurationCircuit(IGregTechTileEntity tile, ItemStack circuit) { this(tile.getXCoord(), tile.getYCoord(), tile.getZCoord(), circuit); } - public GT_Packet_SetConfigurationCircuit(BaseTileEntity tile, ItemStack circuit) { + public GTPacketSetConfigurationCircuit(BaseTileEntity tile, ItemStack circuit) { this(tile.getXCoord(), tile.getYCoord(), tile.getZCoord(), circuit); } - public GT_Packet_SetConfigurationCircuit(int x, short y, int z, ItemStack circuit) { + public GTPacketSetConfigurationCircuit(int x, short y, int z, ItemStack circuit) { super(false); this.mX = x; @@ -55,7 +55,7 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.SET_CONFIGURATION_CIRCUIT.id; + return GTPacketTypes.SET_CONFIGURATION_CIRCUIT.id; } @Override @@ -82,8 +82,8 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_SetConfigurationCircuit( + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketSetConfigurationCircuit( aData.readInt(), aData.readShort(), aData.readInt(), @@ -103,7 +103,7 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { if (!machine.allowSelectCircuit()) return; machine.getConfigurationCircuits() .stream() - .filter(stack -> GT_Utility.areStacksEqual(stack, circuit)) + .filter(stack -> GTUtility.areStacksEqual(stack, circuit)) .findFirst() .ifPresent(stack -> ((IHasInventory) tile).setInventorySlotContents(machine.getCircuitSlot(), stack)); } diff --git a/src/main/java/gregtech/api/net/GT_Packet_Sound.java b/src/main/java/gregtech/api/net/GTPacketSound.java index 93bfdfd3aa..95f95e641d 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Sound.java +++ b/src/main/java/gregtech/api/net/GTPacketSound.java @@ -7,23 +7,23 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTUtility; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufOutputStream; -public class GT_Packet_Sound extends GT_Packet_New { +public class GTPacketSound extends GTPacketNew { private int mX, mZ; private short mY; private String mSoundName; private float mSoundStrength, mSoundPitch; - public GT_Packet_Sound() { + public GTPacketSound() { super(true); } - public GT_Packet_Sound(String aSoundName, float aSoundStrength, float aSoundPitch, int aX, short aY, int aZ) { + public GTPacketSound(String aSoundName, float aSoundStrength, float aSoundPitch, int aX, short aY, int aZ) { super(false); mX = aX; mY = aY; @@ -44,13 +44,13 @@ public class GT_Packet_Sound extends GT_Packet_New { byteOutputStream.writeInt(mZ); } catch (IOException e) { // this really shouldn't happen, but whatever - e.printStackTrace(GT_Log.err); + e.printStackTrace(GTLog.err); } } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_Sound( + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketSound( aData.readUTF(), aData.readFloat(), aData.readFloat(), @@ -62,12 +62,12 @@ public class GT_Packet_Sound extends GT_Packet_New { @Override public void process(IBlockAccess aWorld) { if (mSoundName != null) { - GT_Utility.doSoundAtClient(new ResourceLocation(mSoundName), 1, mSoundStrength, mSoundPitch, mX, mY, mZ); + GTUtility.doSoundAtClient(new ResourceLocation(mSoundName), 1, mSoundStrength, mSoundPitch, mX, mY, mZ); } } @Override public byte getPacketID() { - return GT_PacketTypes.SOUND.id; + return GTPacketTypes.SOUND.id; } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java b/src/main/java/gregtech/api/net/GTPacketTileEntity.java index b07277dc00..eecb16d6da 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java +++ b/src/main/java/gregtech/api/net/GTPacketTileEntity.java @@ -6,23 +6,23 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import io.netty.buffer.ByteBuf; -public class GT_Packet_TileEntity extends GT_Packet_New { +public class GTPacketTileEntity extends GTPacketNew { private int mX, mZ, mC0, mC1, mC2, mC3, mC4, mC5; private short mY, mID, mRID; private byte mTexture, mTexturePage, mUpdate, mRedstone, mColor; - public GT_Packet_TileEntity() { + public GTPacketTileEntity() { super(true); } // For multi tiles - public GT_Packet_TileEntity(int aX, short aY, int aZ, short aRID, short aID, int aC0, int aC1, int aC2, int aC3, + public GTPacketTileEntity(int aX, short aY, int aZ, short aRID, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { super(false); mX = aX; @@ -44,8 +44,8 @@ public class GT_Packet_TileEntity extends GT_Packet_New { } // For meta tiles - public GT_Packet_TileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, - int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { + public GTPacketTileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, + byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { this( aX, aY, @@ -66,8 +66,8 @@ public class GT_Packet_TileEntity extends GT_Packet_New { } // For pipes - public GT_Packet_TileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, - int aC5, byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { + public GTPacketTileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, + byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { this(aX, aY, aZ, (short) 0, aID, aC0, aC1, aC2, aC3, aC4, aC5, aTexture, (byte) 0, aUpdate, aRedstone, aColor); } @@ -95,8 +95,8 @@ public class GT_Packet_TileEntity extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_TileEntity( + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketTileEntity( // Coords aData.readInt(), aData.readShort(), @@ -141,7 +141,7 @@ public class GT_Packet_TileEntity extends GT_Packet_New { else if (tTileEntity instanceof BaseMetaPipeEntity) ((BaseMetaPipeEntity) tTileEntity) .receiveMetaTileEntityData(mID, mC0, mC1, mC2, mC3, mC4, mC5, mTexture, mUpdate, mRedstone, mColor); } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.error( + GTMod.GT_FML_LOGGER.error( "Exception setting tile entity data for tile entity {} at ({}, {}, {})", tTileEntity, mX, @@ -152,6 +152,6 @@ public class GT_Packet_TileEntity extends GT_Packet_New { @Override public byte getPacketID() { - return GT_PacketTypes.TILE_ENTITY.id; + return GTPacketTypes.TILE_ENTITY.id; } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_ToolSwitchMode.java b/src/main/java/gregtech/api/net/GTPacketToolSwitchMode.java index c7984d7434..57cabcf2bf 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_ToolSwitchMode.java +++ b/src/main/java/gregtech/api/net/GTPacketToolSwitchMode.java @@ -8,20 +8,20 @@ import net.minecraft.world.IBlockAccess; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.items.MetaGeneratedTool; import io.netty.buffer.ByteBuf; -public class GT_Packet_ToolSwitchMode extends GT_Packet_New { +public class GTPacketToolSwitchMode extends GTPacketNew { private EntityPlayerMP player; - public GT_Packet_ToolSwitchMode() { + public GTPacketToolSwitchMode() { super(true); } @Override public byte getPacketID() { - return GT_PacketTypes.TOOL_SWITCH_MODE.id; + return GTPacketTypes.TOOL_SWITCH_MODE.id; } @Override @@ -30,8 +30,8 @@ public class GT_Packet_ToolSwitchMode extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_ToolSwitchMode(); + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketToolSwitchMode(); } @Override @@ -42,11 +42,11 @@ public class GT_Packet_ToolSwitchMode extends GT_Packet_New { @Override public void process(IBlockAccess aWorld) { ItemStack currentItem = player.inventory.getCurrentItem(); - if (currentItem == null || (!(currentItem.getItem() instanceof GT_MetaGenerated_Tool item))) return; + if (currentItem == null || (!(currentItem.getItem() instanceof MetaGeneratedTool item))) return; byte maxMode = item.getToolMaxMode(currentItem); if (maxMode <= 1) return; - byte newMode = (byte) ((GT_MetaGenerated_Tool.getToolMode(currentItem) + 1) % maxMode); - GT_MetaGenerated_Tool.setToolMode(currentItem, newMode); + byte newMode = (byte) ((MetaGeneratedTool.getToolMode(currentItem) + 1) % maxMode); + MetaGeneratedTool.setToolMode(currentItem, newMode); player.sendSlotContents(player.inventoryContainer, player.inventory.currentItem, currentItem); } } diff --git a/src/main/java/gregtech/api/net/GTPacketTypes.java b/src/main/java/gregtech/api/net/GTPacketTypes.java new file mode 100644 index 0000000000..d635706e68 --- /dev/null +++ b/src/main/java/gregtech/api/net/GTPacketTypes.java @@ -0,0 +1,64 @@ +package gregtech.api.net; + +import java.util.Arrays; + +import gregtech.common.blocks.PacketOres; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; + +/** + * Centralized place to keep all the GT packet ID constants + */ +public enum GTPacketTypes { + + TILE_ENTITY(0, new GTPacketTileEntity()), + SOUND(1, new GTPacketSound()), + BLOCK_EVENT(2, new GTPacketBlockEvent()), + ORES(3, new PacketOres()), + POLLUTION(4, new GTPacketPollution()), + CLIENT_PREFERENCE(9, new GTPacketClientPreference()), + SET_CONFIGURATION_CIRCUIT(12, new GTPacketSetConfigurationCircuit()), + UPDATE_ITEM(13, new GTPacketUpdateItem()), + SEND_COVER_DATA(16, new GTPacketSendCoverData()), + REQUEST_COVER_DATA(17, new GTPacketRequestCoverData()), + MULTI_TILE_ENTITY(18, new GTPacketMultiTileEntity(true)), + SEND_OREGEN_PATTERN(19, new GTPacketSendOregenPattern()), + TOOL_SWITCH_MODE(20, new GTPacketToolSwitchMode()), + MUSIC_SYSTEM_DATA(21, new GTPacketMusicSystemData()), + // merge conflict prevention comment, keep a trailing comma above + ; + + static { + // Validate no duplicate IDs + final GTPacketTypes[] types = values(); + final Int2ObjectOpenHashMap<GTPacketNew> foundIds = new Int2ObjectOpenHashMap<>(types.length); + for (GTPacketTypes type : types) { + final GTPacketNew previous = foundIds.get(type.id); + if (previous != null) { + throw new IllegalStateException( + "Duplicate packet IDs defined: " + type.id + + " for " + + type.getClass() + + " and " + + previous.getClass()); + } + foundIds.put(type.id, type.referencePacket); + } + } + + public final byte id; + public final GTPacketNew referencePacket; + + GTPacketTypes(int id, GTPacketNew referencePacket) { + if (((int) (byte) id) != id) { + throw new IllegalArgumentException("Value outside of byte normal range: " + id); + } + this.id = (byte) id; + this.referencePacket = referencePacket; + } + + public static GTPacketNew[] referencePackets() { + return Arrays.stream(values()) + .map(p -> p.referencePacket) + .toArray(GTPacketNew[]::new); + } +} diff --git a/src/main/java/gregtech/api/net/GT_Packet_UpdateItem.java b/src/main/java/gregtech/api/net/GTPacketUpdateItem.java index 1b8a453234..54846cdcc9 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_UpdateItem.java +++ b/src/main/java/gregtech/api/net/GTPacketUpdateItem.java @@ -17,23 +17,23 @@ import io.netty.buffer.ByteBuf; /** * Client -> Server: send arbitrary data to server and update the currently held item. */ -public class GT_Packet_UpdateItem extends GT_Packet_New { +public class GTPacketUpdateItem extends GTPacketNew { private NBTTagCompound tag; private EntityPlayerMP mPlayer; - public GT_Packet_UpdateItem() { + public GTPacketUpdateItem() { super(true); } - public GT_Packet_UpdateItem(NBTTagCompound tag) { + public GTPacketUpdateItem(NBTTagCompound tag) { super(false); this.tag = tag; } @Override public byte getPacketID() { - return GT_PacketTypes.UPDATE_ITEM.id; + return GTPacketTypes.UPDATE_ITEM.id; } @Override @@ -49,8 +49,8 @@ public class GT_Packet_UpdateItem extends GT_Packet_New { } @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new GT_Packet_UpdateItem(ISerializableObject.readCompoundTagFromGreggyByteBuf(aData)); + public GTPacketNew decode(ByteArrayDataInput aData) { + return new GTPacketUpdateItem(ISerializableObject.readCompoundTagFromGreggyByteBuf(aData)); } @Override diff --git a/src/main/java/gregtech/api/net/GT_PacketTypes.java b/src/main/java/gregtech/api/net/GT_PacketTypes.java deleted file mode 100644 index 5907b2176b..0000000000 --- a/src/main/java/gregtech/api/net/GT_PacketTypes.java +++ /dev/null @@ -1,64 +0,0 @@ -package gregtech.api.net; - -import java.util.Arrays; - -import gregtech.common.blocks.GT_Packet_Ores; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; - -/** - * Centralized place to keep all the GT packet ID constants - */ -public enum GT_PacketTypes { - - TILE_ENTITY(0, new GT_Packet_TileEntity()), - SOUND(1, new GT_Packet_Sound()), - BLOCK_EVENT(2, new GT_Packet_Block_Event()), - ORES(3, new GT_Packet_Ores()), - POLLUTION(4, new GT_Packet_Pollution()), - CLIENT_PREFERENCE(9, new GT_Packet_ClientPreference()), - SET_CONFIGURATION_CIRCUIT(12, new GT_Packet_SetConfigurationCircuit()), - UPDATE_ITEM(13, new GT_Packet_UpdateItem()), - SEND_COVER_DATA(16, new GT_Packet_SendCoverData()), - REQUEST_COVER_DATA(17, new GT_Packet_RequestCoverData()), - MULTI_TILE_ENTITY(18, new GT_Packet_MultiTileEntity(true)), - SEND_OREGEN_PATTERN(19, new GT_Packet_SendOregenPattern()), - TOOL_SWITCH_MODE(20, new GT_Packet_ToolSwitchMode()), - MUSIC_SYSTEM_DATA(21, new GT_Packet_MusicSystemData()), - // merge conflict prevention comment, keep a trailing comma above - ; - - static { - // Validate no duplicate IDs - final GT_PacketTypes[] types = values(); - final Int2ObjectOpenHashMap<GT_Packet_New> foundIds = new Int2ObjectOpenHashMap<>(types.length); - for (GT_PacketTypes type : types) { - final GT_Packet_New previous = foundIds.get(type.id); - if (previous != null) { - throw new IllegalStateException( - "Duplicate packet IDs defined: " + type.id - + " for " - + type.getClass() - + " and " - + previous.getClass()); - } - foundIds.put(type.id, type.referencePacket); - } - } - - public final byte id; - public final GT_Packet_New referencePacket; - - GT_PacketTypes(int id, GT_Packet_New referencePacket) { - if (((int) (byte) id) != id) { - throw new IllegalArgumentException("Value outside of byte normal range: " + id); - } - this.id = (byte) id; - this.referencePacket = referencePacket; - } - - public static GT_Packet_New[] referencePackets() { - return Arrays.stream(values()) - .map(p -> p.referencePacket) - .toArray(GT_Packet_New[]::new); - } -} diff --git a/src/main/java/gregtech/api/net/IGT_NetworkHandler.java b/src/main/java/gregtech/api/net/IGT_NetworkHandler.java index 8436a89e9b..3569317b01 100644 --- a/src/main/java/gregtech/api/net/IGT_NetworkHandler.java +++ b/src/main/java/gregtech/api/net/IGT_NetworkHandler.java @@ -8,15 +8,15 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; @SuppressWarnings("deprecation") public interface IGT_NetworkHandler { - void sendToPlayer(GT_Packet aPacket, EntityPlayerMP aPlayer); + void sendToPlayer(GTPacket aPacket, EntityPlayerMP aPlayer); - void sendToAllAround(GT_Packet aPacket, TargetPoint aPosition); + void sendToAllAround(GTPacket aPacket, TargetPoint aPosition); - default void sendToAll(GT_Packet aPacket) { + default void sendToAll(GTPacket aPacket) { throw new UnsupportedOperationException("sendToAll not implemented"); } - void sendToServer(GT_Packet aPacket); + void sendToServer(GTPacket aPacket); - void sendPacketToAllPlayersInRange(World aWorld, GT_Packet aPacket, int aX, int aZ); + void sendPacketToAllPlayersInRange(World aWorld, GTPacket aPacket, int aX, int aZ); } diff --git a/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java b/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java index c2e0556de9..3ede25f5ea 100644 --- a/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java +++ b/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java @@ -4,7 +4,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalChestBase; +import gregtech.common.tileentities.storage.MTEDigitalChestBase; public class AE2DigitalChestHandler implements appeng.api.storage.IExternalStorageHandler { @@ -12,14 +12,14 @@ public class AE2DigitalChestHandler implements appeng.api.storage.IExternalStora public boolean canHandle(final TileEntity te, final ForgeDirection d, final appeng.api.storage.StorageChannel chan, final appeng.api.networking.security.BaseActionSource mySrc) { return chan == appeng.api.storage.StorageChannel.ITEMS && te instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_DigitalChestBase; + && ((BaseMetaTileEntity) te).getMetaTileEntity() instanceof MTEDigitalChestBase; } @Override public appeng.api.storage.IMEInventory<?> getInventory(final TileEntity te, final ForgeDirection d, final appeng.api.storage.StorageChannel chan, final appeng.api.networking.security.BaseActionSource src) { if (chan == appeng.api.storage.StorageChannel.ITEMS) { - return ((GT_MetaTileEntity_DigitalChestBase) (((BaseMetaTileEntity) te).getMetaTileEntity())); + return ((MTEDigitalChestBase) (((BaseMetaTileEntity) te).getMetaTileEntity())); } return null; } diff --git a/src/main/java/gregtech/api/objects/GT_ArrayList.java b/src/main/java/gregtech/api/objects/GTArrayList.java index 9124ef8616..33fbb18571 100644 --- a/src/main/java/gregtech/api/objects/GT_ArrayList.java +++ b/src/main/java/gregtech/api/objects/GTArrayList.java @@ -7,20 +7,20 @@ import java.util.Objects; import com.google.common.collect.Collections2; -public class GT_ArrayList<E> extends ArrayList<E> { +public class GTArrayList<E> extends ArrayList<E> { private static final long serialVersionUID = 1L; private int size_sS; private final boolean mAllowNulls; - public GT_ArrayList(boolean aAllowNulls, int aCapacity) { + public GTArrayList(boolean aAllowNulls, int aCapacity) { super(aCapacity); mAllowNulls = aAllowNulls; } @SafeVarargs - public GT_ArrayList(boolean aAllowNulls, E... aArray) { + public GTArrayList(boolean aAllowNulls, E... aArray) { super(Arrays.asList(aArray)); mAllowNulls = aAllowNulls; if (!mAllowNulls) { @@ -32,7 +32,7 @@ public class GT_ArrayList<E> extends ArrayList<E> { } } - public GT_ArrayList(boolean aAllowNulls, Collection<? extends E> aList) { + public GTArrayList(boolean aAllowNulls, Collection<? extends E> aList) { super(aList); mAllowNulls = aAllowNulls; if (!mAllowNulls) { diff --git a/src/main/java/gregtech/api/objects/GT_ChunkManager.java b/src/main/java/gregtech/api/objects/GTChunkManager.java index 14baaddd3d..59bc90aa1c 100644 --- a/src/main/java/gregtech/api/objects/GT_ChunkManager.java +++ b/src/main/java/gregtech/api/objects/GTChunkManager.java @@ -15,23 +15,23 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; +import gregtech.GTMod; +import gregtech.api.enums.GTValues; import gregtech.api.interfaces.IChunkLoader; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Log; +import gregtech.api.util.GTLog; /** * Handles re-initialization of chunks after a server restart. */ -public class GT_ChunkManager +public class GTChunkManager implements ForgeChunkManager.OrderedLoadingCallback, ForgeChunkManager.PlayerOrderedLoadingCallback { private final Map<TileEntity, Ticket> registeredTickets = new HashMap<>(); - public static GT_ChunkManager instance = new GT_ChunkManager(); + public static GTChunkManager instance = new GTChunkManager(); public static void init() { - ForgeChunkManager.setForcedChunkLoadingCallback(GT_Mod.instance, instance); + ForgeChunkManager.setForcedChunkLoadingCallback(GTMod.instance, instance); } @Override @@ -54,7 +54,7 @@ public class GT_ChunkManager @Override public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount) { List<Ticket> validTickets = new ArrayList<>(); - if (GT_Values.alwaysReloadChunkloaders) { + if (GTValues.alwaysReloadChunkloaders) { for (Ticket ticket : tickets) { int x = ticket.getModData() .getInteger("OwnerX"); @@ -108,24 +108,24 @@ public class GT_ChunkManager * @return if the chunk was loaded successfully */ public static boolean requestPlayerChunkLoad(TileEntity owner, ChunkCoordIntPair chunkXZ, String player) { - if (!GT_Values.enableChunkloaders) return false; - if (!GT_Values.alwaysReloadChunkloaders && chunkXZ == null) return false; - if (GT_Values.debugChunkloaders && chunkXZ != null) GT_Log.out - .println("GT_ChunkManager: Chunk request: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); + if (!GTValues.enableChunkloaders) return false; + if (!GTValues.alwaysReloadChunkloaders && chunkXZ == null) return false; + if (GTValues.debugChunkloaders && chunkXZ != null) + GTLog.out.println("GT_ChunkManager: Chunk request: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); if (instance.registeredTickets.containsKey(owner)) { ForgeChunkManager.forceChunk(instance.registeredTickets.get(owner), chunkXZ); } else { Ticket ticket; if (player.equals("")) ticket = ForgeChunkManager - .requestTicket(GT_Mod.instance, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); + .requestTicket(GTMod.instance, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); else ticket = ForgeChunkManager - .requestPlayerTicket(GT_Mod.instance, player, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); + .requestPlayerTicket(GTMod.instance, player, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); if (ticket == null) { - if (GT_Values.debugChunkloaders) - GT_Log.out.println("GT_ChunkManager: ForgeChunkManager.requestTicket failed"); + if (GTValues.debugChunkloaders) + GTLog.out.println("GT_ChunkManager: ForgeChunkManager.requestTicket failed"); return false; } - if (GT_Values.debugChunkloaders) GT_Log.out.println( + if (GTValues.debugChunkloaders) GTLog.out.println( "GT_ChunkManager: ticket issued for machine at: (" + owner.xCoord + ", " + owner.yCoord @@ -137,7 +137,7 @@ public class GT_ChunkManager tag.setInteger("OwnerY", owner.yCoord); tag.setInteger("OwnerZ", owner.zCoord); ForgeChunkManager.forceChunk(ticket, chunkXZ); - if (GT_Values.alwaysReloadChunkloaders) + if (GTValues.alwaysReloadChunkloaders) ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(owner.xCoord >> 4, owner.zCoord >> 4)); instance.registeredTickets.put(owner, ticket); } @@ -150,28 +150,28 @@ public class GT_ChunkManager } public static void releaseChunk(TileEntity owner, ChunkCoordIntPair chunkXZ) { - if (!GT_Values.enableChunkloaders) return; + if (!GTValues.enableChunkloaders) return; Ticket ticket = instance.registeredTickets.get(owner); if (ticket != null) { - if (GT_Values.debugChunkloaders) GT_Log.out + if (GTValues.debugChunkloaders) GTLog.out .println("GT_ChunkManager: Chunk release: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); ForgeChunkManager.unforceChunk(ticket, chunkXZ); } } public static void releaseTicket(TileEntity owner) { - if (!GT_Values.enableChunkloaders) return; + if (!GTValues.enableChunkloaders) return; Ticket ticket = instance.registeredTickets.get(owner); if (ticket != null) { - if (GT_Values.debugChunkloaders) { - GT_Log.out.println( + if (GTValues.debugChunkloaders) { + GTLog.out.println( "GT_ChunkManager: ticket released by machine at: (" + owner.xCoord + ", " + owner.yCoord + ", " + owner.zCoord + ")"); - for (ChunkCoordIntPair chunk : ticket.getChunkList()) GT_Log.out + for (ChunkCoordIntPair chunk : ticket.getChunkList()) GTLog.out .println("GT_ChunkManager: Chunk release: (" + chunk.chunkXPos + ", " + chunk.chunkZPos + ")"); } ForgeChunkManager.releaseTicket(ticket); @@ -180,25 +180,25 @@ public class GT_ChunkManager } public static void printTickets() { - GT_Log.out.println("GT_ChunkManager: Start forced chunks dump:"); + GTLog.out.println("GT_ChunkManager: Start forced chunks dump:"); instance.registeredTickets.forEach((machine, ticket) -> { - GT_Log.out.print( + GTLog.out.print( "GT_ChunkManager: Chunks forced by the machine at (" + machine.xCoord + ", " + machine.yCoord + ", " + machine.zCoord + ")"); - if (ticket.isPlayerTicket()) GT_Log.out.print(" Owner: " + ticket.getPlayerName()); - GT_Log.out.print(" :"); + if (ticket.isPlayerTicket()) GTLog.out.print(" Owner: " + ticket.getPlayerName()); + GTLog.out.print(" :"); for (ChunkCoordIntPair c : ticket.getChunkList()) { - GT_Log.out.print("("); - GT_Log.out.print(c.chunkXPos); - GT_Log.out.print(", "); - GT_Log.out.print(c.chunkZPos); - GT_Log.out.print("), "); + GTLog.out.print("("); + GTLog.out.print(c.chunkXPos); + GTLog.out.print(", "); + GTLog.out.print(c.chunkZPos); + GTLog.out.print("), "); } }); - GT_Log.out.println("GT_ChunkManager: End forced chunks dump:"); + GTLog.out.println("GT_ChunkManager: End forced chunks dump:"); } } diff --git a/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java b/src/main/java/gregtech/api/objects/GTCopiedBlockTexture.java index c5307b4803..79be90c3b6 100644 --- a/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java +++ b/src/main/java/gregtech/api/objects/GTCopiedBlockTexture.java @@ -4,27 +4,28 @@ import net.minecraft.block.Block; import gregtech.api.enums.Dyes; import gregtech.api.interfaces.ITexture; +import gregtech.common.render.GTCopiedBlockTextureRender; /** * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API. */ @Deprecated -public class GT_CopiedBlockTexture extends gregtech.common.render.GT_CopiedBlockTexture implements ITexture { +public class GTCopiedBlockTexture extends GTCopiedBlockTextureRender implements ITexture { // Backwards Compat @Deprecated public short[] mRGBa; - public GT_CopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) { + public GTCopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) { super(aBlock, ordinalSide, aMeta, aRGBa, aAllowAlpha); - GT_CopiedBlockTexture.this.mRGBa = aRGBa; + GTCopiedBlockTexture.this.mRGBa = aRGBa; } - public GT_CopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta, short[] aRGBa) { + public GTCopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta, short[] aRGBa) { this(aBlock, ordinalSide, aMeta, aRGBa, true); } - public GT_CopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta) { + public GTCopiedBlockTexture(Block aBlock, int ordinalSide, int aMeta) { this(aBlock, ordinalSide, aMeta, Dyes._NULL.mRGBa); } diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GTCoverDefault.java index cc5f96eef3..6e9664c355 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_Default.java +++ b/src/main/java/gregtech/api/objects/GTCoverDefault.java @@ -5,15 +5,15 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.CoverBehavior; +import gregtech.api.util.GTUtility; -public class GT_Cover_Default extends GT_CoverBehavior { +public class GTCoverDefault extends CoverBehavior { /** * This is the Dummy, if there is a generic Cover without behavior */ - public GT_Cover_Default() { + public GTCoverDefault() { super(); } @@ -26,12 +26,12 @@ public class GT_Cover_Default extends GT_CoverBehavior { public int onCoverScrewdriverclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = ((aCoverVariable + 1) & 15); - GT_Utility.sendChatToPlayer( + GTUtility.sendChatToPlayer( aPlayer, - ((aCoverVariable & 1) != 0 ? GT_Utility.trans("128.1", "Redstone ") : "") - + ((aCoverVariable & 2) != 0 ? GT_Utility.trans("129.1", "Energy ") : "") - + ((aCoverVariable & 4) != 0 ? GT_Utility.trans("130.1", "Fluids ") : "") - + ((aCoverVariable & 8) != 0 ? GT_Utility.trans("131.1", "Items ") : "")); + ((aCoverVariable & 1) != 0 ? GTUtility.trans("128.1", "Redstone ") : "") + + ((aCoverVariable & 2) != 0 ? GTUtility.trans("129.1", "Energy ") : "") + + ((aCoverVariable & 4) != 0 ? GTUtility.trans("130.1", "Fluids ") : "") + + ((aCoverVariable & 8) != 0 ? GTUtility.trans("131.1", "Items ") : "")); return aCoverVariable; } diff --git a/src/main/java/gregtech/api/objects/GT_Cover_None.java b/src/main/java/gregtech/api/objects/GTCoverNone.java index 279efe63d8..2c07538186 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_None.java +++ b/src/main/java/gregtech/api/objects/GTCoverNone.java @@ -1,6 +1,6 @@ package gregtech.api.objects; -import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GTValues.E; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -8,15 +8,15 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.CoverBehavior; import gregtech.api.util.ISerializableObject; -public class GT_Cover_None extends GT_CoverBehavior { +public class GTCoverNone extends CoverBehavior { /** * This is the Dummy, if there is no Cover */ - public GT_Cover_None() {} + public GTCoverNone() {} @Override public float getBlastProofLevel(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { diff --git a/src/main/java/gregtech/api/objects/GT_Fluid.java b/src/main/java/gregtech/api/objects/GTFluid.java index 10824d6327..9ffeac5b8f 100644 --- a/src/main/java/gregtech/api/objects/GT_Fluid.java +++ b/src/main/java/gregtech/api/objects/GTFluid.java @@ -4,23 +4,23 @@ import static gregtech.api.enums.Mods.GregTech; import net.minecraftforge.fluids.Fluid; -import gregtech.api.GregTech_API; -import gregtech.api.fluid.GT_FluidFactory; +import gregtech.api.GregTechAPI; +import gregtech.api.fluid.GTFluidFactory; /** - * @deprecated use {@link GT_FluidFactory#builder} + * @deprecated use {@link GTFluidFactory#builder} */ @Deprecated -public class GT_Fluid extends Fluid implements Runnable { +public class GTFluid extends Fluid implements Runnable { public final String mTextureName; private final short[] mRGBa; - public GT_Fluid(String aName, String aTextureName, short[] aRGBa) { + public GTFluid(String aName, String aTextureName, short[] aRGBa) { super(aName); mRGBa = aRGBa; mTextureName = aTextureName; - GregTech_API.sGTBlockIconload.add(this); + GregTechAPI.sGTBlockIconload.add(this); } @Override @@ -31,6 +31,6 @@ public class GT_Fluid extends Fluid implements Runnable { @Override public void run() { - setIcons(GregTech_API.sBlockIcons.registerIcon(GregTech.getResourcePath("fluids", "fluid." + mTextureName))); + setIcons(GregTechAPI.sBlockIcons.registerIcon(GregTech.getResourcePath("fluids", "fluid." + mTextureName))); } } diff --git a/src/main/java/gregtech/api/objects/GT_HashSet.java b/src/main/java/gregtech/api/objects/GTHashSet.java index d42f194e5d..df012c05f7 100644 --- a/src/main/java/gregtech/api/objects/GT_HashSet.java +++ b/src/main/java/gregtech/api/objects/GTHashSet.java @@ -9,41 +9,41 @@ import java.util.Map; import net.minecraft.item.ItemStack; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_Utility; +import gregtech.api.GregTechAPI; +import gregtech.api.util.GTUtility; -public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> { +public class GTHashSet<E extends GTItemStack> extends AbstractSet<E> { private static final Object OBJECT = new Object(); - private final transient HashMap<GT_ItemStack, Object> map; + private final transient HashMap<GTItemStack, Object> map; - public GT_HashSet() { + public GTHashSet() { map = new HashMap<>(); - GregTech_API.sItemStackMappings.add(map); + GregTechAPI.sItemStackMappings.add(map); } - public GT_HashSet(Collection<? extends E> c) { + public GTHashSet(Collection<? extends E> c) { map = new HashMap<>(Math.max((int) (c.size() / .75f) + 1, 16)); addAll(c); - GregTech_API.sItemStackMappings.add(map); + GregTechAPI.sItemStackMappings.add(map); } - public GT_HashSet(int initialCapacity, float loadFactor) { + public GTHashSet(int initialCapacity, float loadFactor) { map = new HashMap<>(initialCapacity, loadFactor); - GregTech_API.sItemStackMappings.add(map); + GregTechAPI.sItemStackMappings.add(map); } - public GT_HashSet(int initialCapacity) { + public GTHashSet(int initialCapacity) { map = new HashMap<>(initialCapacity); - GregTech_API.sItemStackMappings.add(map); + GregTechAPI.sItemStackMappings.add(map); } - GT_HashSet(int initialCapacity, float loadFactor, boolean dummy) { + GTHashSet(int initialCapacity, float loadFactor, boolean dummy) { map = new LinkedHashMap<>(initialCapacity, loadFactor); - GregTech_API.sItemStackMappings.add(map); + GregTechAPI.sItemStackMappings.add(map); } - public Map<GT_ItemStack, Object> getMap() { + public Map<GTItemStack, Object> getMap() { return map; } @@ -70,8 +70,8 @@ public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> { } public boolean add(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) return false; - return map.put(new GT_ItemStack(aStack), OBJECT) == null; + if (GTUtility.isStackInvalid(aStack)) return false; + return map.put(new GTItemStack(aStack), OBJECT) == null; } @Override diff --git a/src/main/java/gregtech/api/objects/GT_ItemStack.java b/src/main/java/gregtech/api/objects/GTItemStack.java index 492655740d..3ddfcd706a 100644 --- a/src/main/java/gregtech/api/objects/GT_ItemStack.java +++ b/src/main/java/gregtech/api/objects/GTItemStack.java @@ -4,8 +4,8 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_Utility; +import gregtech.api.enums.GTValues; +import gregtech.api.util.GTUtility; import gregtech.api.util.item.ItemHolder; import it.unimi.dsi.fastutil.Hash; @@ -13,7 +13,7 @@ import it.unimi.dsi.fastutil.Hash; * An optimization of {@link ItemStack} to have a better {@code hashcode} and {@code equals} in order to improve * {@code HashMap} and {@code Set} performance */ -public class GT_ItemStack extends ItemHolder { +public class GTItemStack extends ItemHolder { /** * A better {@link Hash.Strategy} for {@link ItemStack}. Implementation originally from {@code GT_ItemStack2}. @@ -38,26 +38,26 @@ public class GT_ItemStack extends ItemHolder { public final byte mStackSize; public final short mMetaData; - public GT_ItemStack(Item aItem, long aStackSize, long aMetaData) { + public GTItemStack(Item aItem, long aStackSize, long aMetaData) { super(new ItemStack(aItem, 1, (int) aMetaData)); mItem = aItem; mStackSize = (byte) aStackSize; mMetaData = (short) aMetaData; } - public GT_ItemStack(ItemStack aStack) { + public GTItemStack(ItemStack aStack) { this(aStack, false); } - public GT_ItemStack(ItemStack aStack, boolean wildcard) { + public GTItemStack(ItemStack aStack, boolean wildcard) { this( aStack == null ? null : aStack.getItem(), aStack == null ? 0 : aStack.stackSize, - aStack == null ? 0 : wildcard ? GT_Values.W : Items.feather.getDamage(aStack)); + aStack == null ? 0 : wildcard ? GTValues.W : Items.feather.getDamage(aStack)); } - public GT_ItemStack(int aHashCode) { - this(GT_Utility.intToStack(aHashCode)); + public GTItemStack(int aHashCode) { + this(GTUtility.intToStack(aHashCode)); } public final ItemStack toStack() { @@ -66,25 +66,25 @@ public class GT_ItemStack extends ItemHolder { } public final boolean isStackEqual(ItemStack aStack) { - return GT_Utility.areStacksEqual(toStack(), aStack); + return GTUtility.areStacksEqual(toStack(), aStack); } - public final boolean isStackEqual(GT_ItemStack aStack) { - return GT_Utility.areStacksEqual(toStack(), aStack.toStack()); + public final boolean isStackEqual(GTItemStack aStack) { + return GTUtility.areStacksEqual(toStack(), aStack.toStack()); } @Override public boolean equals(Object aStack) { if (aStack == this) return true; - if (aStack instanceof GT_ItemStack) { - return ((GT_ItemStack) aStack).mItem == mItem && ((GT_ItemStack) aStack).mMetaData == mMetaData; + if (aStack instanceof GTItemStack) { + return ((GTItemStack) aStack).mItem == mItem && ((GTItemStack) aStack).mMetaData == mMetaData; } return false; } @Override public int hashCode() { - return GT_Utility.stackToInt(toStack()); + return GTUtility.stackToInt(toStack()); } /** @@ -102,6 +102,6 @@ public class GT_ItemStack extends ItemHolder { * @return a copy of the stack with stack size 1 and no NBT */ public static ItemStack internalCopyStack(ItemStack aStack, boolean wildcard) { - return new ItemStack(aStack.getItem(), 1, wildcard ? GT_Values.W : Items.feather.getDamage(aStack)); + return new ItemStack(aStack.getItem(), 1, wildcard ? GTValues.W : Items.feather.getDamage(aStack)); } } diff --git a/src/main/java/gregtech/api/objects/GT_ItemStack2.java b/src/main/java/gregtech/api/objects/GTItemStack2.java index aa93876830..798915d848 100644 --- a/src/main/java/gregtech/api/objects/GT_ItemStack2.java +++ b/src/main/java/gregtech/api/objects/GTItemStack2.java @@ -8,28 +8,28 @@ import net.minecraft.item.ItemStack; * structure with GT_ItemStack. It also shouldn't be used to construct search query into a hash based data structure * that contains GT_ItemStack. * - * @deprecated See {@link GT_ItemStack#ITEMSTACK_HASH_STRATEGY2} + * @deprecated See {@link GTItemStack#ITEMSTACK_HASH_STRATEGY2} */ @Deprecated -public class GT_ItemStack2 extends GT_ItemStack { +public class GTItemStack2 extends GTItemStack { - public GT_ItemStack2(Item aItem, long aStackSize, long aMetaData) { + public GTItemStack2(Item aItem, long aStackSize, long aMetaData) { super(aItem, aStackSize, aMetaData); } - public GT_ItemStack2(ItemStack aStack) { + public GTItemStack2(ItemStack aStack) { super(aStack); } - public GT_ItemStack2(ItemStack aStack, boolean wildcard) { + public GTItemStack2(ItemStack aStack, boolean wildcard) { super(aStack, wildcard); } @Override public boolean equals(Object aStack) { if (aStack == this) return true; - if (aStack instanceof GT_ItemStack) { - return ((GT_ItemStack) aStack).mItem == mItem && ((GT_ItemStack) aStack).mMetaData == mMetaData; + if (aStack instanceof GTItemStack) { + return ((GTItemStack) aStack).mItem == mItem && ((GTItemStack) aStack).mMetaData == mMetaData; } return false; } diff --git a/src/main/java/gregtech/api/objects/GT_MultiTexture.java b/src/main/java/gregtech/api/objects/GTMultiTexture.java index 9748ecb934..ecd2f55661 100644 --- a/src/main/java/gregtech/api/objects/GT_MultiTexture.java +++ b/src/main/java/gregtech/api/objects/GTMultiTexture.java @@ -1,6 +1,7 @@ package gregtech.api.objects; import gregtech.api.interfaces.ITexture; +import gregtech.common.render.GTMultiTextureRender; /** * <p> @@ -9,13 +10,13 @@ import gregtech.api.interfaces.ITexture; * <p> * I should have done this much earlier... * </p> - * + * * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API. */ @Deprecated -public class GT_MultiTexture extends gregtech.common.render.GT_MultiTexture implements ITexture { +public class GTMultiTexture extends GTMultiTextureRender implements ITexture { - public GT_MultiTexture(ITexture... aTextures) { + public GTMultiTexture(ITexture... aTextures) { super(aTextures); } diff --git a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java b/src/main/java/gregtech/api/objects/GTRenderedTexture.java index bbb22e7d36..a4d0a064ff 100644 --- a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java +++ b/src/main/java/gregtech/api/objects/GTRenderedTexture.java @@ -6,23 +6,23 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; @Deprecated -public class GT_RenderedTexture extends gregtech.common.render.GT_RenderedTexture +public class GTRenderedTexture extends gregtech.common.render.GTRenderedTexture implements ITexture, IColorModulationContainer { @Deprecated public short[] mRGBa; - public GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + public GTRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { super(aIcon, aRGBa, aAllowAlpha, false, true, false); if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); mRGBa = aRGBa; } - public GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa) { + public GTRenderedTexture(IIconContainer aIcon, short[] aRGBa) { this(aIcon, aRGBa, true); } - public GT_RenderedTexture(IIconContainer aIcon) { + public GTRenderedTexture(IIconContainer aIcon) { this(aIcon, Dyes._NULL.mRGBa); } diff --git a/src/main/java/gregtech/api/objects/GT_SidedTexture.java b/src/main/java/gregtech/api/objects/GTSidedTexture.java index d042ebede9..d7b2291386 100644 --- a/src/main/java/gregtech/api/objects/GT_SidedTexture.java +++ b/src/main/java/gregtech/api/objects/GTSidedTexture.java @@ -4,40 +4,40 @@ import gregtech.api.enums.Dyes; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; +import gregtech.common.render.GTSidedTextureRender; /** * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API. */ @Deprecated -public class GT_SidedTexture extends gregtech.common.render.GT_SidedTexture - implements ITexture, IColorModulationContainer { +public class GTSidedTexture extends GTSidedTextureRender implements ITexture, IColorModulationContainer { @Deprecated public short[] mRGBa; - public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, + public GTSidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { super(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, aRGBa, aAllowAlpha); // Backwards Compat - GT_SidedTexture.this.mRGBa = aRGBa; + GTSidedTexture.this.mRGBa = aRGBa; } - public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, + public GTSidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa) { this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, aRGBa, true); } - public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, + public GTSidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5) { this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, Dyes._NULL.mRGBa); } - public GT_SidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides, short[] aRGBa) { + public GTSidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides, short[] aRGBa) { this(aBottom, aTop, aSides, aSides, aSides, aSides, aRGBa); } - public GT_SidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides) { + public GTSidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides) { this(aBottom, aTop, aSides, Dyes._NULL.mRGBa); } diff --git a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java b/src/main/java/gregtech/api/objects/GTStdRenderedTexture.java index d4b8d16da6..11a3a4818f 100644 --- a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java +++ b/src/main/java/gregtech/api/objects/GTStdRenderedTexture.java @@ -16,19 +16,19 @@ import gregtech.api.util.LightingHelper; * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API. */ @Deprecated -public class GT_StdRenderedTexture extends GT_RenderedTexture { +public class GTStdRenderedTexture extends GTRenderedTexture { @SuppressWarnings("unused") - public GT_StdRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + public GTStdRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { super(aIcon, aRGBa, aAllowAlpha); } - public GT_StdRenderedTexture(IIconContainer aIcon, short[] aRGBa) { + public GTStdRenderedTexture(IIconContainer aIcon, short[] aRGBa) { super(aIcon, aRGBa, true); } @SuppressWarnings("unused") - public GT_StdRenderedTexture(IIconContainer aIcon) { + public GTStdRenderedTexture(IIconContainer aIcon) { super(aIcon, Dyes._NULL.mRGBa); } diff --git a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java b/src/main/java/gregtech/api/objects/GTUODimension.java index af82c35dab..2fe10196bd 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java +++ b/src/main/java/gregtech/api/objects/GTUODimension.java @@ -7,13 +7,13 @@ import net.minecraftforge.common.config.ConfigCategory; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -public class GT_UO_Dimension { +public class GTUODimension { - private final BiMap<String, GT_UO_Fluid> fFluids; + private final BiMap<String, GTUOFluid> fFluids; private int maxChance; public String Dimension = "null"; - public GT_UO_Dimension(ConfigCategory aConfigCategory) { // TODO CONFIGURE + public GTUODimension(ConfigCategory aConfigCategory) { // TODO CONFIGURE fFluids = HashBiMap.create(); if (aConfigCategory.containsKey("Dimension")) { aConfigCategory.get("Dimension").comment = "Dimension ID or Class Name"; @@ -24,7 +24,7 @@ public class GT_UO_Dimension { // GT_FML_LOGGER.info("GT UO "+aConfigCategory.getName()+" Dimension:"+Dimension); for (int i = 0; i < aConfigCategory.getChildren() .size(); i++) { - GT_UO_Fluid fluid = new GT_UO_Fluid( + GTUOFluid fluid = new GTUOFluid( (ConfigCategory) aConfigCategory.getChildren() .toArray()[i]); fFluids.put(fluid.Registry, fluid); @@ -32,9 +32,9 @@ public class GT_UO_Dimension { } } - public GT_UO_Fluid getRandomFluid(Random aRandom) { + public GTUOFluid getRandomFluid(Random aRandom) { int random = aRandom.nextInt(1000); - for (BiMap.Entry<String, GT_UO_Fluid> fl : fFluids.entrySet()) { + for (BiMap.Entry<String, GTUOFluid> fl : fFluids.entrySet()) { int chance = fl.getValue().Chance * 1000 / maxChance; if (random <= chance) return fl.getValue(); // GT_FML_LOGGER.info("GT UO "+fl.getValue().Registry+" Chance:"+chance+" Random:"+random); @@ -43,12 +43,12 @@ public class GT_UO_Dimension { return null; } - public String getUOFluidKey(GT_UO_Fluid uoFluid) { + public String getUOFluidKey(GTUOFluid uoFluid) { return fFluids.inverse() .get(uoFluid); } - public GT_UO_Fluid getUOFluid(String key) { + public GTUOFluid getUOFluid(String key) { return fFluids.get(key); } } diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GTUODimensionList.java index f057614ccf..60d11fdaa7 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GTUODimensionList.java @@ -63,15 +63,15 @@ import com.google.common.collect.HashBiMap; import gregtech.api.enums.Dimensions; import gregtech.api.enums.UndergroundFluidNames; -public class GT_UO_DimensionList { +public class GTUODimensionList { private Configuration fConfig; private String fCategory; - private final BiMap<String, GT_UO_Dimension> fDimensionList; + private final BiMap<String, GTUODimension> fDimensionList; public int[] blackList = new int[0]; - public GT_UO_DimensionList() { + public GTUODimensionList() { fDimensionList = HashBiMap.create(); } @@ -79,11 +79,11 @@ public class GT_UO_DimensionList { fConfig.save(); } - public GT_UO_Dimension GetDimension(int aDimension) { + public GTUODimension GetDimension(int aDimension) { if (CheckBlackList(aDimension)) return null; if (fDimensionList.containsKey(Integer.toString(aDimension))) return fDimensionList.get(Integer.toString(aDimension)); - for (BiMap.Entry<String, GT_UO_Dimension> dl : fDimensionList.entrySet()) + for (BiMap.Entry<String, GTUODimension> dl : fDimensionList.entrySet()) if (DimensionManager.getProvider(aDimension) .getClass() .getName() @@ -585,7 +585,7 @@ public class GT_UO_DimensionList { for (int i = 0; i < fConfig.getCategory(fCategory) .getChildren() .size(); i++) { - GT_UO_Dimension Dimension = new GT_UO_Dimension( + GTUODimension Dimension = new GTUODimension( (ConfigCategory) fConfig.getCategory(fCategory) .getChildren() .toArray()[i]); diff --git a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java b/src/main/java/gregtech/api/objects/GTUOFluid.java index 7f9898e02e..cd019dbc8e 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java +++ b/src/main/java/gregtech/api/objects/GTUOFluid.java @@ -1,6 +1,6 @@ package gregtech.api.objects; -import static gregtech.common.GT_UndergroundOil.DIVIDER; +import static gregtech.common.UndergroundOil.DIVIDER; import java.util.Random; @@ -8,7 +8,7 @@ import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -public class GT_UO_Fluid { +public class GTUOFluid { public String Registry = "null"; public int MaxAmount = 0; @@ -16,7 +16,7 @@ public class GT_UO_Fluid { public int Chance = 0; public int DecreasePerOperationAmount = 5; - public GT_UO_Fluid(ConfigCategory aConfigCategory) { // TODO CONFIGURE + public GTUOFluid(ConfigCategory aConfigCategory) { // TODO CONFIGURE if (aConfigCategory.containsKey("Registry")) { aConfigCategory.get("Registry").comment = "Fluid registry name"; Registry = aConfigCategory.get("Registry") diff --git a/src/main/java/gregtech/api/objects/ItemData.java b/src/main/java/gregtech/api/objects/ItemData.java index 779e45ac8b..071b09a55f 100644 --- a/src/main/java/gregtech/api/objects/ItemData.java +++ b/src/main/java/gregtech/api/objects/ItemData.java @@ -13,7 +13,7 @@ public class ItemData { private static final MaterialStack[] EMPTY_MATERIALSTACK_ARRAY = new MaterialStack[0]; - public final List<Object> mExtraData = new GT_ArrayList<>(false, 1); + public final List<Object> mExtraData = new GTArrayList<>(false, 1); public final OrePrefixes mPrefix; public final MaterialStack mMaterial; public final MaterialStack[] mByProducts; diff --git a/src/main/java/gregtech/api/objects/MaterialStack.java b/src/main/java/gregtech/api/objects/MaterialStack.java index 0a433e0d99..742c210901 100644 --- a/src/main/java/gregtech/api/objects/MaterialStack.java +++ b/src/main/java/gregtech/api/objects/MaterialStack.java @@ -1,7 +1,7 @@ package gregtech.api.objects; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class MaterialStack implements Cloneable { @@ -44,7 +44,7 @@ public class MaterialStack implements Cloneable { public String toString(boolean single) { String temp1 = "", temp2 = mMaterial.getToolTip(true), temp3 = "", temp4 = ""; if (mAmount > 1) { - temp4 = GT_Utility.toSubscript(mAmount); + temp4 = GTUtility.toSubscript(mAmount); } if ((!single || mAmount > 1) && isMaterialListComplex(this)) { temp1 = "("; diff --git a/src/main/java/gregtech/api/objects/overclockdescriber/EUNoOverclockDescriber.java b/src/main/java/gregtech/api/objects/overclockdescriber/EUNoOverclockDescriber.java index 1e29e2d812..6f73b5467a 100644 --- a/src/main/java/gregtech/api/objects/overclockdescriber/EUNoOverclockDescriber.java +++ b/src/main/java/gregtech/api/objects/overclockdescriber/EUNoOverclockDescriber.java @@ -1,13 +1,13 @@ package gregtech.api.objects.overclockdescriber; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.ParametersAreNonnullByDefault; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.api.util.OverclockCalculator; import gregtech.nei.RecipeDisplayInfo; @ParametersAreNonnullByDefault @@ -28,13 +28,13 @@ public class EUNoOverclockDescriber extends OverclockDescriber { } @Override - public GT_OverclockCalculator createCalculator(GT_OverclockCalculator template, GT_Recipe recipe) { - return GT_OverclockCalculator.ofNoOverclock(recipe); + public OverclockCalculator createCalculator(OverclockCalculator template, GTRecipe recipe) { + return OverclockCalculator.ofNoOverclock(recipe); } @Override public String getTierString() { - return GT_Utility.getColoredTierNameFromTier(tier); + return GTUtility.getColoredTierNameFromTier(tier); } @Override @@ -60,48 +60,48 @@ public class EUNoOverclockDescriber extends OverclockDescriber { } } - protected String getTotalPowerString(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(calculator.getConsumption() * calculator.getDuration()) + " EU"; + protected String getTotalPowerString(OverclockCalculator calculator) { + return GTUtility.formatNumbers(calculator.getConsumption() * calculator.getDuration()) + " EU"; } /** * @return If amperage should be shown on NEI. */ - protected boolean shouldShowAmperage(GT_OverclockCalculator calculator) { + protected boolean shouldShowAmperage(OverclockCalculator calculator) { return amperage != 1; } /** * @return Whole EU/t usage, without tier display. */ - protected String getEUtWithoutTier(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(calculator.getConsumption()) + " EU/t"; + protected String getEUtWithoutTier(OverclockCalculator calculator) { + return GTUtility.formatNumbers(calculator.getConsumption()) + " EU/t"; } /** * @return Whole EU/t usage, with tier display. */ - protected String getEUtWithTier(GT_OverclockCalculator calculator) { - return getEUtWithoutTier(calculator) + GT_Utility.getTierNameWithParentheses(calculator.getConsumption()); + protected String getEUtWithTier(OverclockCalculator calculator) { + return getEUtWithoutTier(calculator) + GTUtility.getTierNameWithParentheses(calculator.getConsumption()); } /** * @return Whole EU/t usage. Also displays voltage tier if it should be shown. */ - protected String getEUtDisplay(GT_OverclockCalculator calculator) { + protected String getEUtDisplay(OverclockCalculator calculator) { return shouldShowAmperage(calculator) ? getEUtWithoutTier(calculator) : getEUtWithTier(calculator); } /** * @return EU/t usage, divided by amperage. With tier display. */ - protected String getVoltageString(GT_OverclockCalculator calculator) { + protected String getVoltageString(OverclockCalculator calculator) { long voltage = computeVoltageForEURate(calculator.getConsumption()); - return GT_Utility.formatNumbers(voltage) + " EU/t" + GT_Utility.getTierNameWithParentheses(voltage); + return GTUtility.formatNumbers(voltage) + " EU/t" + GTUtility.getTierNameWithParentheses(voltage); } - protected String getAmperageString(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(amperage); + protected String getAmperageString(OverclockCalculator calculator) { + return GTUtility.formatNumbers(amperage); } protected long computeVoltageForEURate(long euPerTick) { diff --git a/src/main/java/gregtech/api/objects/overclockdescriber/EUOverclockDescriber.java b/src/main/java/gregtech/api/objects/overclockdescriber/EUOverclockDescriber.java index 9d53711515..42b459e874 100644 --- a/src/main/java/gregtech/api/objects/overclockdescriber/EUOverclockDescriber.java +++ b/src/main/java/gregtech/api/objects/overclockdescriber/EUOverclockDescriber.java @@ -1,17 +1,17 @@ package gregtech.api.objects.overclockdescriber; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.enums.GTValues.V; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.ParametersAreNonnullByDefault; import com.google.common.primitives.Ints; -import gregtech.GT_Mod; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.GTMod; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.api.util.OverclockCalculator; import gregtech.nei.RecipeDisplayInfo; @ParametersAreNonnullByDefault @@ -23,7 +23,7 @@ public class EUOverclockDescriber extends EUNoOverclockDescriber { } @Override - public GT_OverclockCalculator createCalculator(GT_OverclockCalculator template, GT_Recipe recipe) { + public OverclockCalculator createCalculator(OverclockCalculator template, GTRecipe recipe) { return template.setEUt(Ints.saturatedCast(V[tier] * amperage)); } @@ -38,9 +38,9 @@ public class EUOverclockDescriber extends EUNoOverclockDescriber { if (shouldShowAmperage(recipeInfo.calculator)) { recipeInfo.drawText(trans("154", "Voltage: ") + getVoltageString(recipeInfo.calculator)); } - if (GT_Mod.gregtechproxy.mNEIOriginalVoltage) { + if (GTMod.gregtechproxy.mNEIOriginalVoltage) { EUNoOverclockDescriber originalPower = new EUNoOverclockDescriber(tier, amperage); - GT_OverclockCalculator originalPowerCalculator = GT_OverclockCalculator.ofNoOverclock(recipeInfo.recipe) + OverclockCalculator originalPowerCalculator = OverclockCalculator.ofNoOverclock(recipeInfo.recipe) .calculate(); recipeInfo .drawText(trans("275", "Original usage: ") + originalPower.getEUtDisplay(originalPowerCalculator)); @@ -51,30 +51,30 @@ public class EUOverclockDescriber extends EUNoOverclockDescriber { } @Override - protected String getEUtWithoutTier(GT_OverclockCalculator calculator) { + protected String getEUtWithoutTier(OverclockCalculator calculator) { return decorateWithOverclockLabel(super.getEUtWithoutTier(calculator), calculator); } @Override - protected String getEUtWithTier(GT_OverclockCalculator calculator) { - return this.getEUtWithoutTier(calculator) + GT_Utility.getTierNameWithParentheses(calculator.getConsumption()); + protected String getEUtWithTier(OverclockCalculator calculator) { + return this.getEUtWithoutTier(calculator) + GTUtility.getTierNameWithParentheses(calculator.getConsumption()); } @Override - protected String getVoltageString(GT_OverclockCalculator calculator) { + protected String getVoltageString(OverclockCalculator calculator) { long voltage = computeVoltageForEURate(calculator.getConsumption()); - return decorateWithOverclockLabel(GT_Utility.formatNumbers(voltage) + " EU/t", calculator) - + GT_Utility.getTierNameWithParentheses(voltage); + return decorateWithOverclockLabel(GTUtility.formatNumbers(voltage) + " EU/t", calculator) + + GTUtility.getTierNameWithParentheses(voltage); } - protected String decorateWithOverclockLabel(String s, GT_OverclockCalculator calculator) { + protected String decorateWithOverclockLabel(String s, OverclockCalculator calculator) { if (wasOverclocked(calculator)) { s += " (OC)"; } return s; } - protected boolean wasOverclocked(GT_OverclockCalculator calculator) { + protected boolean wasOverclocked(OverclockCalculator calculator) { return calculator.getPerformedOverclocks() > 0; } } diff --git a/src/main/java/gregtech/api/objects/overclockdescriber/FusionOverclockDescriber.java b/src/main/java/gregtech/api/objects/overclockdescriber/FusionOverclockDescriber.java index b570ebcab5..019af073f0 100644 --- a/src/main/java/gregtech/api/objects/overclockdescriber/FusionOverclockDescriber.java +++ b/src/main/java/gregtech/api/objects/overclockdescriber/FusionOverclockDescriber.java @@ -4,11 +4,11 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.util.EnumChatFormatting; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.enums.GTValues; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.api.util.OverclockCalculator; import gregtech.nei.formatter.FusionSpecialValueFormatter; @ParametersAreNonnullByDefault @@ -23,7 +23,7 @@ public class FusionOverclockDescriber extends EUOverclockDescriber { } @Override - public GT_OverclockCalculator createCalculator(GT_OverclockCalculator template, GT_Recipe recipe) { + public OverclockCalculator createCalculator(OverclockCalculator template, GTRecipe recipe) { return super.createCalculator(template, recipe) .limitOverclockCount(overclock(recipe.mSpecialValue, recipe.mEUt)) .setEUtIncreasePerOC(getEUtIncreasePerOC()) @@ -40,12 +40,12 @@ public class FusionOverclockDescriber extends EUOverclockDescriber { @Override public String getTierString() { - return GT_Values.TIER_COLORS[tier] + "MK " + getFusionTier() + EnumChatFormatting.RESET; + return GTValues.TIER_COLORS[tier] + "MK " + getFusionTier() + EnumChatFormatting.RESET; } @Override - public boolean canHandle(GT_Recipe recipe) { - byte tier = GT_Utility.getTier(recipe.mEUt); + public boolean canHandle(GTRecipe recipe) { + byte tier = GTUtility.getTier(recipe.mEUt); if (this.tier < tier) { return false; } diff --git a/src/main/java/gregtech/api/objects/overclockdescriber/OverclockDescriber.java b/src/main/java/gregtech/api/objects/overclockdescriber/OverclockDescriber.java index 0b253c95fa..9f995e4758 100644 --- a/src/main/java/gregtech/api/objects/overclockdescriber/OverclockDescriber.java +++ b/src/main/java/gregtech/api/objects/overclockdescriber/OverclockDescriber.java @@ -1,14 +1,14 @@ package gregtech.api.objects.overclockdescriber; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.ParametersAreNonnullByDefault; -import gregtech.GT_Mod; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.GTMod; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.api.util.OverclockCalculator; import gregtech.nei.RecipeDisplayInfo; /** @@ -45,12 +45,12 @@ public abstract class OverclockDescriber { /** * Creates overclock calculator from given template. This template should be used instead of building from the * ground to avoid issues coming from different caller using different templates, but it's not applicable when using - * {@link GT_OverclockCalculator#ofNoOverclock(GT_Recipe)}. + * {@link OverclockCalculator#ofNoOverclock(GTRecipe)}. * * @param template Calculator that can be used as template. Recipe EU/t and duration are already set. * @param recipe Recipe to calculate. */ - public abstract GT_OverclockCalculator createCalculator(GT_OverclockCalculator template, GT_Recipe recipe); + public abstract OverclockCalculator createCalculator(OverclockCalculator template, GTRecipe recipe); /** * Draws info about the energy this object can handle on NEI recipe GUI. @@ -61,7 +61,7 @@ public abstract class OverclockDescriber { if (getDurationTicks(recipeInfo.calculator) <= 0) return; String textToDraw = trans("158", "Time: "); - if (GT_Mod.gregtechproxy.mNEIRecipeSecondMode) { + if (GTMod.gregtechproxy.mNEIRecipeSecondMode) { textToDraw += getDurationStringSeconds(recipeInfo.calculator); if (getDurationSeconds(recipeInfo.calculator) <= 1.0d) { textToDraw += String.format(" (%s)", getDurationStringTicks(recipeInfo.calculator)); @@ -81,26 +81,26 @@ public abstract class OverclockDescriber { * * @return If this object can handle the supplied recipe */ - public boolean canHandle(GT_Recipe recipe) { - byte tier = GT_Utility.getTier(recipe.mEUt); + public boolean canHandle(GTRecipe recipe) { + byte tier = GTUtility.getTier(recipe.mEUt); return this.tier >= tier; } - private int getDurationTicks(GT_OverclockCalculator calculator) { + private int getDurationTicks(OverclockCalculator calculator) { return calculator.getDuration(); } - private double getDurationSeconds(GT_OverclockCalculator calculator) { + private double getDurationSeconds(OverclockCalculator calculator) { return 0.05d * getDurationTicks(calculator); } - private String getDurationStringSeconds(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(getDurationSeconds(calculator)) + GT_Utility.trans("161", " secs"); + private String getDurationStringSeconds(OverclockCalculator calculator) { + return GTUtility.formatNumbers(getDurationSeconds(calculator)) + GTUtility.trans("161", " secs"); } - private String getDurationStringTicks(GT_OverclockCalculator calculator) { - String ticksString = getDurationTicks(calculator) == 1 ? GT_Utility.trans("209.1", " tick") - : GT_Utility.trans("209", " ticks"); - return GT_Utility.formatNumbers(getDurationTicks(calculator)) + ticksString; + private String getDurationStringTicks(OverclockCalculator calculator) { + String ticksString = getDurationTicks(calculator) == 1 ? GTUtility.trans("209.1", " tick") + : GTUtility.trans("209", " ticks"); + return GTUtility.formatNumbers(getDurationTicks(calculator)) + ticksString; } } diff --git a/src/main/java/gregtech/api/objects/overclockdescriber/SteamOverclockDescriber.java b/src/main/java/gregtech/api/objects/overclockdescriber/SteamOverclockDescriber.java index 5da64d4028..3a2da01b08 100644 --- a/src/main/java/gregtech/api/objects/overclockdescriber/SteamOverclockDescriber.java +++ b/src/main/java/gregtech/api/objects/overclockdescriber/SteamOverclockDescriber.java @@ -1,16 +1,16 @@ package gregtech.api.objects.overclockdescriber; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.util.StatCollector; import gregtech.api.enums.SteamVariant; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.api.util.OverclockCalculator; import gregtech.nei.RecipeDisplayInfo; @ParametersAreNonnullByDefault @@ -34,8 +34,8 @@ public class SteamOverclockDescriber extends OverclockDescriber { } @Override - public GT_OverclockCalculator createCalculator(GT_OverclockCalculator template, GT_Recipe recipe) { - return GT_OverclockCalculator.ofNoOverclock(recipe) + public OverclockCalculator createCalculator(OverclockCalculator template, GTRecipe recipe) { + return OverclockCalculator.ofNoOverclock(recipe) .setEUtDiscount(euPerTickMultiplier) .setSpeedBoost(durationMultiplier); } @@ -48,13 +48,13 @@ public class SteamOverclockDescriber extends OverclockDescriber { recipeInfo.drawText(trans("153", "Usage: ") + getSteamUsageString(recipeInfo.calculator)); } - private String getTotalPowerString(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(convertEUToSteam(calculator.getConsumption() * calculator.getDuration())) + private String getTotalPowerString(OverclockCalculator calculator) { + return GTUtility.formatNumbers(convertEUToSteam(calculator.getConsumption() * calculator.getDuration())) + " Steam"; } - private String getSteamUsageString(GT_OverclockCalculator calculator) { - return GT_Utility.formatNumbers(20 * convertEUToSteam(calculator.getConsumption())) + " L/s Steam"; + private String getSteamUsageString(OverclockCalculator calculator) { + return GTUtility.formatNumbers(20 * convertEUToSteam(calculator.getConsumption())) + " L/s Steam"; } private static long convertEUToSteam(long eu) { diff --git a/src/main/java/gregtech/api/recipe/BasicUIPropertiesBuilder.java b/src/main/java/gregtech/api/recipe/BasicUIPropertiesBuilder.java index 7be2c94b23..adb2ee40e8 100644 --- a/src/main/java/gregtech/api/recipe/BasicUIPropertiesBuilder.java +++ b/src/main/java/gregtech/api/recipe/BasicUIPropertiesBuilder.java @@ -20,7 +20,7 @@ import com.gtnewhorizons.modularui.api.math.Size; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import gregtech.api.gui.modularui.FallbackableSteamTexture; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.gui.modularui.SteamTexture; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.common.gui.modularui.UIHelper; @@ -59,7 +59,7 @@ public final class BasicUIPropertiesBuilder { private final ImmutableList.Builder<Pair<SteamTexture, Pair<Size, Pos2d>>> specialTexturesSteam = ImmutableList .builder(); - private IDrawable logo = GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT; + private IDrawable logo = GTUITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT; private Size logoSize = new Size(17, 17); private Pos2d logoPos = new Pos2d(152, 63); diff --git a/src/main/java/gregtech/api/recipe/FindRecipeQuery.java b/src/main/java/gregtech/api/recipe/FindRecipeQuery.java index 77c0648688..16702b6be6 100644 --- a/src/main/java/gregtech/api/recipe/FindRecipeQuery.java +++ b/src/main/java/gregtech/api/recipe/FindRecipeQuery.java @@ -9,7 +9,7 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; // spotless:off spotless likes formatting @code to @code @@ -20,7 +20,7 @@ import gregtech.api.util.MethodsReturnNonnullByDefault; * * <pre> * {@code - * GT_Recipe recipe = recipeMap.findRecipeQuery() + * GTRecipe recipe = recipeMap.findRecipeQuery() * .items(inputItems) * .fluids(inputFluids) * .find(); @@ -33,7 +33,7 @@ import gregtech.api.util.MethodsReturnNonnullByDefault; @MethodsReturnNonnullByDefault public final class FindRecipeQuery { - private static final Predicate<GT_Recipe> ALWAYS = r -> true; + private static final Predicate<GTRecipe> ALWAYS = r -> true; private final RecipeMap<?> recipeMap; @@ -43,10 +43,10 @@ public final class FindRecipeQuery { private FluidStack[] fluids; @Nullable private ItemStack specialSlot; - private Predicate<GT_Recipe> filter = ALWAYS; + private Predicate<GTRecipe> filter = ALWAYS; private long voltage = Integer.MAX_VALUE; @Nullable - private GT_Recipe cachedRecipe; + private GTRecipe cachedRecipe; private boolean notUnificated; private boolean dontCheckStackSizes; private boolean forCollisionCheck; @@ -61,7 +61,7 @@ public final class FindRecipeQuery { * @return The first matched recipe, or null if not found. */ @Nullable - public GT_Recipe find() { + public GTRecipe find() { return findAll().findFirst() .orElse(null); } @@ -69,7 +69,7 @@ public final class FindRecipeQuery { /** * @return All the matched recipes in the form of Stream. */ - public Stream<GT_Recipe> findAll() { + public Stream<GTRecipe> findAll() { if (items == null) { items = new ItemStack[0]; } @@ -135,7 +135,7 @@ public final class FindRecipeQuery { * @param filter Matched recipe will be tested by this function. If it returns false, the query will attempt to * find next recipe. */ - public FindRecipeQuery filter(Predicate<GT_Recipe> filter) { + public FindRecipeQuery filter(Predicate<GTRecipe> filter) { this.filter = filter; return this; } @@ -152,7 +152,7 @@ public final class FindRecipeQuery { /** * @param cachedRecipe If this is not null, the query tests it before all other recipes. */ - public FindRecipeQuery cachedRecipe(@Nullable GT_Recipe cachedRecipe) { + public FindRecipeQuery cachedRecipe(@Nullable GTRecipe cachedRecipe) { this.cachedRecipe = cachedRecipe; return this; } diff --git a/src/main/java/gregtech/api/recipe/NEIRecipeProperties.java b/src/main/java/gregtech/api/recipe/NEIRecipeProperties.java index 2ba49f5da1..1b62ca0390 100644 --- a/src/main/java/gregtech/api/recipe/NEIRecipeProperties.java +++ b/src/main/java/gregtech/api/recipe/NEIRecipeProperties.java @@ -12,7 +12,7 @@ import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.recipe.HandlerInfo; import gregtech.api.objects.overclockdescriber.OverclockDescriber; import gregtech.api.util.FieldsAreNonnullByDefault; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.nei.formatter.INEISpecialInfoFormatter; @@ -49,7 +49,7 @@ public final class NEIRecipeProperties { public final Pos2d recipeBackgroundOffset; /** - * Formats special description for the recipe, mainly {@link gregtech.api.util.GT_Recipe#mSpecialValue}. + * Formats special description for the recipe, mainly {@link GTRecipe#mSpecialValue}. */ public final INEISpecialInfoFormatter neiSpecialInfoFormatter; @@ -68,14 +68,14 @@ public final class NEIRecipeProperties { public final boolean renderRealStackSizes; /** - * Comparator for NEI recipe sort. {@link GT_Recipe#compareTo(GT_Recipe)} by default. + * Comparator for NEI recipe sort. {@link GTRecipe#compareTo(GTRecipe)} by default. */ - public final Comparator<GT_Recipe> comparator; + public final Comparator<GTRecipe> comparator; NEIRecipeProperties(boolean registerNEI, @Nullable UnaryOperator<HandlerInfo.Builder> handlerInfoCreator, Size recipeBackgroundSize, Pos2d recipeBackgroundOffset, INEISpecialInfoFormatter neiSpecialInfoFormatter, boolean unificateOutput, boolean useCustomFilter, boolean renderRealStackSizes, - Comparator<GT_Recipe> comparator) { + Comparator<GTRecipe> comparator) { this.registerNEI = registerNEI; this.handlerInfoCreator = handlerInfoCreator; this.recipeBackgroundOffset = recipeBackgroundOffset; diff --git a/src/main/java/gregtech/api/recipe/NEIRecipePropertiesBuilder.java b/src/main/java/gregtech/api/recipe/NEIRecipePropertiesBuilder.java index 050a1c4920..3b47e9ce13 100644 --- a/src/main/java/gregtech/api/recipe/NEIRecipePropertiesBuilder.java +++ b/src/main/java/gregtech/api/recipe/NEIRecipePropertiesBuilder.java @@ -10,7 +10,7 @@ import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.recipe.HandlerInfo; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.nei.formatter.DefaultSpecialValueFormatter; import gregtech.nei.formatter.INEISpecialInfoFormatter; @@ -36,7 +36,7 @@ public final class NEIRecipePropertiesBuilder { private boolean useCustomFilter; private boolean renderRealStackSizes = true; - private Comparator<GT_Recipe> comparator = GT_Recipe::compareTo; + private Comparator<GTRecipe> comparator = GTRecipe::compareTo; NEIRecipePropertiesBuilder() {} @@ -93,7 +93,7 @@ public final class NEIRecipePropertiesBuilder { return this; } - public NEIRecipePropertiesBuilder recipeComparator(Comparator<GT_Recipe> comparator) { + public NEIRecipePropertiesBuilder recipeComparator(Comparator<GTRecipe> comparator) { this.comparator = comparator; return this; } diff --git a/src/main/java/gregtech/api/recipe/RecipeMap.java b/src/main/java/gregtech/api/recipe/RecipeMap.java index 46b32d18dd..669c7de2cf 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMap.java +++ b/src/main/java/gregtech/api/recipe/RecipeMap.java @@ -1,6 +1,6 @@ package gregtech.api.recipe; -import static gregtech.api.util.GT_RecipeBuilder.ENABLE_COLLISION_CHECK; +import static gregtech.api.util.GTRecipeBuilder.ENABLE_COLLISION_CHECK; import java.util.Collection; import java.util.HashMap; @@ -23,8 +23,8 @@ import org.jetbrains.annotations.Unmodifiable; import gregtech.api.interfaces.IRecipeMap; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.util.FieldsAreNonnullByDefault; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -82,7 +82,7 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { * @return All the recipes belonging to this recipemap. */ @Unmodifiable - public Collection<GT_Recipe> getAllRecipes() { + public Collection<GTRecipe> getAllRecipes() { return backend.getAllRecipes(); } @@ -116,13 +116,13 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { // region add recipe @Deprecated @Nullable - public GT_Recipe addRecipe(GT_Recipe aRecipe) { + public GTRecipe addRecipe(GTRecipe aRecipe) { return addRecipe(aRecipe, true, false, false); } @Deprecated @Nullable - public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + public GTRecipe addRecipe(GTRecipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; if (aRecipe.mFluidInputs.length < backend.properties.minFluidInputs @@ -137,13 +137,13 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { */ @Deprecated @Nullable - public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, @Nullable ItemStack[] aInputs, + public GTRecipe addFakeRecipe(boolean aCheckForCollisions, @Nullable ItemStack[] aInputs, @Nullable ItemStack[] aOutputs, @Nullable Object aSpecial, @Nullable FluidStack[] aFluidInputs, @Nullable FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt, boolean hidden) { return addFakeRecipe( aCheckForCollisions, - new GT_Recipe.GT_Recipe_WithAlt( + new GTRecipe.GTRecipe_WithAlt( false, aInputs, aOutputs, @@ -164,23 +164,23 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { */ @Deprecated @Nullable - public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) { + public GTRecipe addFakeRecipe(boolean aCheckForCollisions, GTRecipe aRecipe) { return addRecipe(aRecipe, aCheckForCollisions, true, false); } @Deprecated @Nullable - public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe, boolean hidden) { + public GTRecipe addFakeRecipe(boolean aCheckForCollisions, GTRecipe aRecipe, boolean hidden) { return addRecipe(aRecipe, aCheckForCollisions, true, hidden); } @Nonnull @Override - public Collection<GT_Recipe> doAdd(GT_RecipeBuilder builder) { + public Collection<GTRecipe> doAdd(GTRecipeBuilder builder) { return backend.doAdd(builder); } - public GT_Recipe add(GT_Recipe aRecipe) { + public GTRecipe add(GTRecipe aRecipe) { return backend.compileRecipe(aRecipe); } @@ -217,26 +217,26 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { } @Nullable - public GT_Recipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, + public GTRecipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, @Nullable FluidStack[] aFluids, @Nullable ItemStack... aInputs) { return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); } @Nullable - public GT_Recipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, + public GTRecipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, @Nullable FluidStack[] aFluids, @Nullable ItemStack... aInputs) { return findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs); } @Nullable - public GT_Recipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, @Nullable GT_Recipe aRecipe, + public GTRecipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, @Nullable GTRecipe aRecipe, boolean aNotUnificated, long aVoltage, @Nullable FluidStack[] aFluids, @Nullable ItemStack aSpecialSlot, @Nullable ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, false, aVoltage, aFluids, aSpecialSlot, aInputs); } @Nullable - public GT_Recipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, @Nullable GT_Recipe aRecipe, + public GTRecipe findRecipe(@Nullable IHasWorldObjectAndCoords aTileEntity, @Nullable GTRecipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, @Nullable FluidStack[] aFluids, @Nullable ItemStack aSpecialSlot, @Nullable ItemStack... aInputs) { return findRecipeQuery().items(aInputs != null ? aInputs : new ItemStack[0]) diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java index 8ba0895a7f..f78e367adf 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java @@ -1,9 +1,9 @@ package gregtech.api.recipe; -import static gregtech.api.util.GT_RecipeBuilder.ENABLE_COLLISION_CHECK; -import static gregtech.api.util.GT_RecipeBuilder.handleInvalidRecipe; -import static gregtech.api.util.GT_RecipeBuilder.handleRecipeCollision; -import static gregtech.api.util.GT_Utility.areStacksEqualOrNull; +import static gregtech.api.util.GTRecipeBuilder.ENABLE_COLLISION_CHECK; +import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipe; +import static gregtech.api.util.GTRecipeBuilder.handleRecipeCollision; +import static gregtech.api.util.GTUtility.areStacksEqualOrNull; import java.util.ArrayList; import java.util.Collection; @@ -28,13 +28,13 @@ import org.jetbrains.annotations.Unmodifiable; import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; -import gregtech.api.GregTech_API; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.IRecipeMap; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_StreamUtil; +import gregtech.api.objects.GTItemStack; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTStreamUtil; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -52,16 +52,16 @@ public class RecipeMapBackend { /** * Recipe index based on items. */ - private final SetMultimap<GT_ItemStack, GT_Recipe> itemIndex = HashMultimap.create(); + private final SetMultimap<GTItemStack, GTRecipe> itemIndex = HashMultimap.create(); /** * Recipe index based on fluids. */ - private final SetMultimap<String, GT_Recipe> fluidIndex = HashMultimap.create(); + private final SetMultimap<String, GTRecipe> fluidIndex = HashMultimap.create(); /** * All the recipes belonging to this backend, indexed by recipe category. */ - private final Map<RecipeCategory, Collection<GT_Recipe>> recipesByCategory = new HashMap<>(); + private final Map<RecipeCategory, Collection<GTRecipe>> recipesByCategory = new HashMap<>(); /** * List of recipemaps that also receive recipe addition from this backend. @@ -75,7 +75,7 @@ public class RecipeMapBackend { public RecipeMapBackend(RecipeMapBackendPropertiesBuilder propertiesBuilder) { this.properties = propertiesBuilder.build(); - GregTech_API.itemStackMultiMaps.add(itemIndex); + GregTechAPI.itemStackMultiMaps.add(itemIndex); } void setRecipeMap(RecipeMap<?> recipeMap) { @@ -94,14 +94,14 @@ public class RecipeMapBackend { * use {@link #compileRecipe} to add / {@link #removeRecipes} to remove. */ @Unmodifiable - public Collection<GT_Recipe> getAllRecipes() { + public Collection<GTRecipe> getAllRecipes() { return Collections.unmodifiableCollection(allRecipes()); } /** * @return Raw recipe list */ - private Collection<GT_Recipe> allRecipes() { + private Collection<GTRecipe> allRecipes() { return recipesByCategory.values() .stream() .flatMap(Collection::stream) @@ -112,13 +112,13 @@ public class RecipeMapBackend { * @return All the recipes belonging to this backend, indexed by recipe category. */ @Unmodifiable - public Collection<GT_Recipe> getRecipesByCategory(RecipeCategory recipeCategory) { + public Collection<GTRecipe> getRecipesByCategory(RecipeCategory recipeCategory) { return Collections .unmodifiableCollection(recipesByCategory.getOrDefault(recipeCategory, Collections.emptyList())); } @Unmodifiable - public Map<RecipeCategory, Collection<GT_Recipe>> getRecipeCategoryMap() { + public Map<RecipeCategory, Collection<GTRecipe>> getRecipeCategoryMap() { return Collections.unmodifiableMap(recipesByCategory); } @@ -129,7 +129,7 @@ public class RecipeMapBackend { * * @return Supplied recipe. */ - public GT_Recipe compileRecipe(GT_Recipe recipe) { + public GTRecipe compileRecipe(GTRecipe recipe) { if (recipe.getRecipeCategory() == null) { recipe.setRecipeCategory(recipeMap.getDefaultRecipeCategory()); } @@ -148,17 +148,17 @@ public class RecipeMapBackend { /** * Adds the supplied recipe to the item cache. */ - protected GT_Recipe addToItemMap(GT_Recipe recipe) { + protected GTRecipe addToItemMap(GTRecipe recipe) { for (ItemStack item : recipe.mInputs) { if (item == null) continue; - itemIndex.put(new GT_ItemStack(item), recipe); + itemIndex.put(new GTItemStack(item), recipe); } - if (recipe instanceof GT_Recipe.GT_Recipe_WithAlt recipeWithAlt) { + if (recipe instanceof GTRecipe.GTRecipe_WithAlt recipeWithAlt) { for (ItemStack[] itemStacks : recipeWithAlt.mOreDictAlt) { if (itemStacks == null) continue; for (ItemStack item : itemStacks) { if (item == null) continue; - itemIndex.put(new GT_ItemStack(item), recipe); + itemIndex.put(new GTItemStack(item), recipe); } } } @@ -168,10 +168,10 @@ public class RecipeMapBackend { /** * Builds recipe from supplied recipe builder and adds it. */ - protected Collection<GT_Recipe> doAdd(GT_RecipeBuilder builder) { - Iterable<? extends GT_Recipe> recipes = properties.recipeEmitter.apply(builder); - Collection<GT_Recipe> ret = new ArrayList<>(); - for (GT_Recipe recipe : recipes) { + protected Collection<GTRecipe> doAdd(GTRecipeBuilder builder) { + Iterable<? extends GTRecipe> recipes = properties.recipeEmitter.apply(builder); + Collection<GTRecipe> ret = new ArrayList<>(); + for (GTRecipe recipe : recipes) { if (recipe.mFluidInputs.length < properties.minFluidInputs || recipe.mInputs.length < properties.minItemInputs) { return Collections.emptyList(); @@ -199,7 +199,7 @@ public class RecipeMapBackend { return ret; } - private void handleCollision(GT_Recipe recipe) { + private void handleCollision(GTRecipe recipe) { StringBuilder errorInfo = new StringBuilder(); boolean hasAnEntry = false; for (FluidStack fluid : recipe.mFluidInputs) { @@ -241,11 +241,11 @@ public class RecipeMapBackend { /** * Removes supplied recipes from recipe list. Do not use unless absolute necessity! */ - public void removeRecipes(Collection<? extends GT_Recipe> recipesToRemove) { - for (Collection<GT_Recipe> recipes : recipesByCategory.values()) { + public void removeRecipes(Collection<? extends GTRecipe> recipesToRemove) { + for (Collection<GTRecipe> recipes : recipesByCategory.values()) { recipes.removeAll(recipesToRemove); } - for (GT_ItemStack key : new HashMap<>(itemIndex.asMap()).keySet()) { + for (GTItemStack key : new HashMap<>(itemIndex.asMap()).keySet()) { itemIndex.get(key) .removeAll(recipesToRemove); } @@ -258,7 +258,7 @@ public class RecipeMapBackend { /** * Removes supplied recipe from recipe list. Do not use unless absolute necessity! */ - public void removeRecipe(GT_Recipe recipe) { + public void removeRecipe(GTRecipe recipe) { removeRecipes(Collections.singleton(recipe)); } @@ -276,9 +276,9 @@ public class RecipeMapBackend { */ public void reInit() { itemIndex.clear(); - for (GT_Recipe recipe : allRecipes()) { - GT_OreDictUnificator.setStackArray(true, recipe.mInputs); - GT_OreDictUnificator.setStackArray(true, recipe.mOutputs); + for (GTRecipe recipe : allRecipes()) { + GTOreDictUnificator.setStackArray(true, recipe.mInputs); + GTOreDictUnificator.setStackArray(true, recipe.mOutputs); addToItemMap(recipe); } } @@ -287,7 +287,7 @@ public class RecipeMapBackend { * @return If supplied item is a valid input for any of the recipes */ public boolean containsInput(ItemStack item) { - return itemIndex.containsKey(new GT_ItemStack(item)) || itemIndex.containsKey(new GT_ItemStack(item, true)); + return itemIndex.containsKey(new GTItemStack(item)) || itemIndex.containsKey(new GTItemStack(item, true)); } /** @@ -304,7 +304,7 @@ public class RecipeMapBackend { * * @return True if collision is found. */ - boolean checkCollision(GT_Recipe recipe) { + boolean checkCollision(GTRecipe recipe) { return matchRecipeStream(recipe.mInputs, recipe.mFluidInputs, null, null, false, true, true).findAny() .isPresent(); } @@ -313,8 +313,8 @@ public class RecipeMapBackend { * Overwrites {@link #matchRecipeStream} method. Also override {@link #doesOverwriteFindRecipe} to make it work. */ @Nullable - protected GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe) { + protected GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe) { return null; } @@ -329,7 +329,7 @@ public class RecipeMapBackend { * Modifies successfully found recipe. Make sure not to mutate the found recipe but use copy! */ @Nullable - protected GT_Recipe modifyFoundRecipe(GT_Recipe recipe, ItemStack[] items, FluidStack[] fluids, + protected GTRecipe modifyFoundRecipe(GTRecipe recipe, ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { return recipe; } @@ -338,7 +338,7 @@ public class RecipeMapBackend { * Called when {@link #matchRecipeStream} cannot find recipe. */ @Nullable - protected GT_Recipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { + protected GTRecipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { return null; } @@ -357,11 +357,11 @@ public class RecipeMapBackend { * @param forCollisionCheck If this method is called to check collision with already registered recipes. * @return Stream of matches recipes. */ - Stream<GT_Recipe> matchRecipeStream(ItemStack[] rawItems, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe, boolean notUnificated, boolean dontCheckStackSizes, + Stream<GTRecipe> matchRecipeStream(ItemStack[] rawItems, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe, boolean notUnificated, boolean dontCheckStackSizes, boolean forCollisionCheck) { if (doesOverwriteFindRecipe()) { - return GT_StreamUtil.ofNullable(overwriteFindRecipe(rawItems, fluids, specialSlot, cachedRecipe)); + return GTStreamUtil.ofNullable(overwriteFindRecipe(rawItems, fluids, specialSlot, cachedRecipe)); } if (recipesByCategory.isEmpty()) { @@ -393,22 +393,22 @@ public class RecipeMapBackend { ItemStack[] items; // Unification happens here in case the item input isn't already unificated. if (notUnificated) { - items = GT_OreDictUnificator.getStackArray(true, (Object[]) rawItems); + items = GTOreDictUnificator.getStackArray(true, (Object[]) rawItems); } else { items = rawItems; } - return Stream.<Stream<GT_Recipe>>of( + return Stream.<Stream<GTRecipe>>of( // Check the recipe which has been used last time in order to not have to search for it again, if possible. - GT_StreamUtil.ofNullable(cachedRecipe) + GTStreamUtil.ofNullable(cachedRecipe) .filter(recipe -> recipe.mCanBeBuffered) .filter(recipe -> filterFindRecipe(recipe, items, fluids, specialSlot, dontCheckStackSizes)) .map(recipe -> modifyFoundRecipe(recipe, items, fluids, specialSlot)) .filter(Objects::nonNull), // Now look for the recipes inside the item index, but only when the recipes actually can have items inputs. - GT_StreamUtil.ofConditional(!itemIndex.isEmpty(), items) + GTStreamUtil.ofConditional(!itemIndex.isEmpty(), items) .filter(Objects::nonNull) - .flatMap(item -> Stream.of(new GT_ItemStack(item), new GT_ItemStack(item, true))) + .flatMap(item -> Stream.of(new GTItemStack(item), new GTItemStack(item, true))) .map(itemIndex::get) .flatMap(Collection::stream) .filter(recipe -> filterFindRecipe(recipe, items, fluids, specialSlot, dontCheckStackSizes)) @@ -416,7 +416,7 @@ public class RecipeMapBackend { .filter(Objects::nonNull), // If the minimum amount of items required for the recipes is 0, then it could match to fluid-only recipes, // so check fluid index too. - GT_StreamUtil.ofConditional(properties.minItemInputs == 0, fluids) + GTStreamUtil.ofConditional(properties.minItemInputs == 0, fluids) .filter(Objects::nonNull) .map( fluidStack -> fluidIndex.get( @@ -428,7 +428,7 @@ public class RecipeMapBackend { .filter(Objects::nonNull), // Lastly, find fallback. forCollisionCheck ? Stream.empty() - : GT_StreamUtil.ofSupplier(() -> findFallback(items, fluids, specialSlot)) + : GTStreamUtil.ofSupplier(() -> findFallback(items, fluids, specialSlot)) .filter(Objects::nonNull)) .flatMap(Function.identity()); } @@ -440,7 +440,7 @@ public class RecipeMapBackend { * <p> * Note that this won't be called if {@link #doesOverwriteFindRecipe} is true. */ - protected boolean filterFindRecipe(GT_Recipe recipe, ItemStack[] items, FluidStack[] fluids, + protected boolean filterFindRecipe(GTRecipe recipe, ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, boolean dontCheckStackSizes) { if (recipe.mEnabled && !recipe.mFakeRecipe && recipe.isRecipeInputEqual(false, dontCheckStackSizes, fluids, items)) { diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBackendProperties.java b/src/main/java/gregtech/api/recipe/RecipeMapBackendProperties.java index 0cd08279a7..47c400a3dd 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBackendProperties.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBackendProperties.java @@ -6,8 +6,8 @@ import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; import gregtech.api.util.FieldsAreNonnullByDefault; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -44,18 +44,18 @@ public final class RecipeMapBackendProperties { /** * Changes how recipes are emitted by a particular recipe builder. */ - public final Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter; + public final Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter; /** * Runs a custom hook on all recipes added <b>via builder</b>. */ @Nullable - public final Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer; + public final Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer; RecipeMapBackendProperties(int minItemInputs, int minFluidInputs, boolean specialSlotSensitive, boolean disableOptimize, - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter, - @Nullable Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer) { + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter, + @Nullable Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer) { if (minItemInputs < 0 || minFluidInputs < 0) { throw new IllegalArgumentException("minItemInputs and minFluidInputs cannot be negative"); } diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBackendPropertiesBuilder.java b/src/main/java/gregtech/api/recipe/RecipeMapBackendPropertiesBuilder.java index 48a27fa42e..aad0748fa9 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBackendPropertiesBuilder.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBackendPropertiesBuilder.java @@ -1,6 +1,6 @@ package gregtech.api.recipe; -import static gregtech.api.util.GT_RecipeMapUtil.buildOrEmpty; +import static gregtech.api.util.GTRecipeMapUtil.buildOrEmpty; import java.util.function.Function; @@ -9,8 +9,8 @@ import javax.annotation.ParametersAreNonnullByDefault; import com.google.common.collect.Iterables; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -28,10 +28,10 @@ public final class RecipeMapBackendPropertiesBuilder { private boolean disableOptimize; - private Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter = this::defaultBuildRecipe; + private Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter = this::defaultBuildRecipe; @Nullable - private Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer; + private Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer; RecipeMapBackendPropertiesBuilder() {} @@ -66,40 +66,40 @@ public final class RecipeMapBackendPropertiesBuilder { } public RecipeMapBackendPropertiesBuilder recipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter) { + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter) { this.recipeEmitter = recipeEmitter; return this; } public RecipeMapBackendPropertiesBuilder combineRecipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> func) { + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> func) { // move recipeEmitter to local variable, so lambda capture the function itself instead of this - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> cur = this.recipeEmitter; + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> cur = this.recipeEmitter; return recipeEmitter(b -> Iterables.concat(cur.apply(b), func.apply(b))); } public RecipeMapBackendPropertiesBuilder recipeTransformer( - Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer) { + Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer) { this.recipeTransformer = recipeTransformer; return this; } public RecipeMapBackendPropertiesBuilder chainRecipeTransformer( - Function<? super GT_Recipe, ? extends GT_Recipe> func) { + Function<? super GTRecipe, ? extends GTRecipe> func) { this.recipeTransformer = this.recipeTransformer == null ? func : this.recipeTransformer.andThen(func); return this; } - private Iterable<? extends GT_Recipe> defaultBuildRecipe(GT_RecipeBuilder builder) { + private Iterable<? extends GTRecipe> defaultBuildRecipe(GTRecipeBuilder builder) { // TODO sensible validation - GT_RecipeBuilder b = builder; + GTRecipeBuilder b = builder; if (disableOptimize && builder.isOptimize()) { b = copy(builder, b).noOptimize(); } return buildOrEmpty(b); } - private static GT_RecipeBuilder copy(GT_RecipeBuilder original, GT_RecipeBuilder b) { + private static GTRecipeBuilder copy(GTRecipeBuilder original, GTRecipeBuilder b) { return b == original ? b.copy() : b; } } diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBuilder.java b/src/main/java/gregtech/api/recipe/RecipeMapBuilder.java index a1638a5a34..2b7bc39066 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBuilder.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBuilder.java @@ -20,11 +20,11 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import codechicken.nei.recipe.HandlerInfo; import gregtech.api.gui.modularui.FallbackableSteamTexture; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.gui.modularui.SteamTexture; import gregtech.api.objects.overclockdescriber.OverclockDescriber; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.nei.formatter.INEISpecialInfoFormatter; @@ -84,7 +84,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { this.unlocalizedName = unlocalizedName; this.backendCreator = backendCreator; this.uiPropertiesBuilder = BasicUIProperties.builder() - .progressBarTexture(GT_UITextures.fallbackableProgressbar(unlocalizedName, GT_UITextures.PROGRESSBAR_ARROW)) + .progressBarTexture(GTUITextures.fallbackableProgressbar(unlocalizedName, GTUITextures.PROGRESSBAR_ARROW)) .neiTransferRectId(unlocalizedName); } @@ -119,7 +119,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * Changes how recipes are emitted by a particular recipe builder. Can emit multiple recipe per builder. */ public RecipeMapBuilder<B> recipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter) { + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter) { backendPropertiesBuilder.recipeEmitter(recipeEmitter); return this; } @@ -130,7 +130,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * Recipes added via one of the overloads of addRecipe will NOT be affected by this function. */ public RecipeMapBuilder<B> recipeEmitterSingle( - Function<? super GT_RecipeBuilder, ? extends GT_Recipe> recipeEmitter) { + Function<? super GTRecipeBuilder, ? extends GTRecipe> recipeEmitter) { return recipeEmitter(recipeEmitter.andThen(Collections::singletonList)); } @@ -142,7 +142,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * Unlike {@link #recipeEmitter(Function)}, this one does not clear the existing recipe being emitted, if any */ public RecipeMapBuilder<B> combineRecipeEmitter( - Function<? super GT_RecipeBuilder, ? extends Iterable<? extends GT_Recipe>> recipeEmitter) { + Function<? super GTRecipeBuilder, ? extends Iterable<? extends GTRecipe>> recipeEmitter) { backendPropertiesBuilder.combineRecipeEmitter(recipeEmitter); return this; } @@ -156,7 +156,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * Unlike {@link #recipeEmitter(Function)}, this one does not clear the existing recipe being emitted, if any */ public RecipeMapBuilder<B> combineRecipeEmitterSingle( - Function<? super GT_RecipeBuilder, ? extends GT_Recipe> recipeEmitter) { + Function<? super GTRecipeBuilder, ? extends GTRecipe> recipeEmitter) { return combineRecipeEmitter(recipeEmitter.andThen(Collections::singletonList)); } @@ -166,7 +166,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * <p> * Recipes added via one of the overloads of addRecipe will NOT be affected by this function. */ - public RecipeMapBuilder<B> recipeTransformer(Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer) { + public RecipeMapBuilder<B> recipeTransformer(Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer) { backendPropertiesBuilder.recipeTransformer(recipeTransformer); return this; } @@ -177,7 +177,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * <p> * Recipes added via one of the overloads of addRecipe will NOT be affected by this function. */ - public RecipeMapBuilder<B> recipeTransformer(Consumer<GT_Recipe> recipeTransformer) { + public RecipeMapBuilder<B> recipeTransformer(Consumer<GTRecipe> recipeTransformer) { return recipeTransformer(withIdentityReturn(recipeTransformer)); } @@ -191,7 +191,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * The supplied function will be given the output of existing handler when a recipe is added. */ public RecipeMapBuilder<B> chainRecipeTransformer( - Function<? super GT_Recipe, ? extends GT_Recipe> recipeTransformer) { + Function<? super GTRecipe, ? extends GTRecipe> recipeTransformer) { backendPropertiesBuilder.chainRecipeTransformer(recipeTransformer); return this; } @@ -205,7 +205,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * Unlike {@link #recipeTransformer(Function)}, this one will not replace the existing special handler. * The supplied function will be given the output of existing handler when a recipe is added. */ - public RecipeMapBuilder<B> chainRecipeTransformer(Consumer<GT_Recipe> recipeTransformer) { + public RecipeMapBuilder<B> chainRecipeTransformer(Consumer<GTRecipe> recipeTransformer) { return chainRecipeTransformer(withIdentityReturn(recipeTransformer)); } @@ -250,7 +250,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { * By default, it's set to {@code GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT}. */ public RecipeMapBuilder<B> progressBar(UITexture texture, ProgressBar.Direction direction) { - return progressBarWithFallback(GT_UITextures.fallbackableProgressbar(unlocalizedName, texture), direction); + return progressBarWithFallback(GTUITextures.fallbackableProgressbar(unlocalizedName, texture), direction); } /** @@ -438,7 +438,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { } /** - * Sets formatter for special description for the recipe, mainly {@link gregtech.api.util.GT_Recipe#mSpecialValue}. + * Sets formatter for special description for the recipe, mainly {@link GTRecipe#mSpecialValue}. */ public RecipeMapBuilder<B> neiSpecialInfoFormatter(INEISpecialInfoFormatter neiSpecialInfoFormatter) { neiPropertiesBuilder.neiSpecialInfoFormatter(neiSpecialInfoFormatter); @@ -478,7 +478,7 @@ public final class RecipeMapBuilder<B extends RecipeMapBackend> { /** * Sets custom comparator for NEI recipe sort. */ - public RecipeMapBuilder<B> neiRecipeComparator(Comparator<GT_Recipe> comparator) { + public RecipeMapBuilder<B> neiRecipeComparator(Comparator<GTRecipe> comparator) { neiPropertiesBuilder.recipeComparator(comparator); return this; } diff --git a/src/main/java/gregtech/api/recipe/RecipeMapFrontend.java b/src/main/java/gregtech/api/recipe/RecipeMapFrontend.java index 63daa00dc7..36aee2872f 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapFrontend.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapFrontend.java @@ -1,6 +1,6 @@ package gregtech.api.recipe; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import static net.minecraft.util.EnumChatFormatting.GRAY; import java.util.ArrayList; @@ -30,15 +30,15 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import codechicken.nei.PositionedStack; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.SteamVariant; -import gregtech.api.gui.GT_GUIColorOverride; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.GUIColorOverride; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.metadata.IRecipeMetadataStorage; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.common.gui.modularui.UIHelper; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.GTNEIDefaultHandler; import gregtech.nei.RecipeDisplayInfo; /** @@ -60,8 +60,8 @@ public class RecipeMapFrontend { */ protected final NEIRecipeProperties neiProperties; - protected final GT_GUIColorOverride colorOverride = GT_GUIColorOverride - .get(GT_UITextures.BACKGROUND_NEI_SINGLE_RECIPE.location); + protected final GUIColorOverride colorOverride = GUIColorOverride + .get(GTUITextures.BACKGROUND_NEI_SINGLE_RECIPE.location); public RecipeMapFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, NEIRecipePropertiesBuilder neiPropertiesBuilder) { @@ -96,7 +96,7 @@ public class RecipeMapFrontend { IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, Supplier<Float> progressSupplier, Pos2d windowOffset) { ModularWindow.Builder builder = ModularWindow.builder(neiProperties.recipeBackgroundSize) - .setBackground(GT_UITextures.BACKGROUND_NEI_SINGLE_RECIPE); + .setBackground(GTUITextures.BACKGROUND_NEI_SINGLE_RECIPE); UIHelper.forEachSlots( (i, backgrounds, pos) -> builder.widget( @@ -245,8 +245,8 @@ public class RecipeMapFrontend { } protected void drawRecipeOwnerInfo(RecipeDisplayInfo recipeInfo) { - GT_Recipe recipe = recipeInfo.recipe; - if (GT_Mod.gregtechproxy.mNEIRecipeOwner) { + GTRecipe recipe = recipeInfo.recipe; + if (GTMod.gregtechproxy.mNEIRecipeOwner) { if (recipe.owners.size() > 1) { recipeInfo.drawText( EnumChatFormatting.ITALIC + trans("273", "Original Recipe by: ") @@ -265,7 +265,7 @@ public class RecipeMapFrontend { .getName()); } } - if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null + if (GTMod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null && !recipe.stackTraces.isEmpty()) { recipeInfo.drawText("stackTrace:"); // todo: good way to show all stacktraces @@ -276,23 +276,23 @@ public class RecipeMapFrontend { } public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip, - GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack pStack : neiCachedRecipe.mInputs) { if (stack == pStack.item) { - if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { + if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemInputTooltip( currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + (GTNEIDefaultHandler.FixedPositionedStack) pStack); } break; } } for (PositionedStack pStack : neiCachedRecipe.mOutputs) { if (stack == pStack.item) { - if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { + if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemOutputTooltip( currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + (GTNEIDefaultHandler.FixedPositionedStack) pStack); } break; } @@ -301,7 +301,7 @@ public class RecipeMapFrontend { } protected List<String> handleNEIItemInputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GTNEIDefaultHandler.FixedPositionedStack pStack) { if (pStack.isNotConsumed()) { currentTip.add(GRAY + trans("151", "Does not get consumed in the process")); } @@ -309,33 +309,33 @@ public class RecipeMapFrontend { } protected List<String> handleNEIItemOutputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GTNEIDefaultHandler.FixedPositionedStack pStack) { if (pStack.isChanceBased()) { currentTip.add(GRAY + trans("150", "Chance: ") + pStack.getChanceText()); } return currentTip; } - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack stack : neiCachedRecipe.mInputs) { - if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { - drawNEIOverlayForInput((GT_NEI_DefaultHandler.FixedPositionedStack) stack); + if (stack instanceof GTNEIDefaultHandler.FixedPositionedStack) { + drawNEIOverlayForInput((GTNEIDefaultHandler.FixedPositionedStack) stack); } } for (PositionedStack stack : neiCachedRecipe.mOutputs) { - if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { - drawNEIOverlayForOutput((GT_NEI_DefaultHandler.FixedPositionedStack) stack); + if (stack instanceof GTNEIDefaultHandler.FixedPositionedStack) { + drawNEIOverlayForOutput((GTNEIDefaultHandler.FixedPositionedStack) stack); } } } - protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + protected void drawNEIOverlayForInput(GTNEIDefaultHandler.FixedPositionedStack stack) { if (stack.isNotConsumed()) { drawNEIOverlayText("NC", stack); } } - protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + protected void drawNEIOverlayForOutput(GTNEIDefaultHandler.FixedPositionedStack stack) { if (stack.isChanceBased()) { drawNEIOverlayText(stack.getChanceText(), stack); } diff --git a/src/main/java/gregtech/api/recipe/RecipeMaps.java b/src/main/java/gregtech/api/recipe/RecipeMaps.java index 293b4f36b5..b43b1144ee 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMaps.java +++ b/src/main/java/gregtech/api/recipe/RecipeMaps.java @@ -4,18 +4,18 @@ import static gregtech.api.enums.Mods.Avaritia; import static gregtech.api.enums.Mods.GTNHIntergalactic; import static gregtech.api.enums.Mods.NEICustomDiagrams; import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.util.GT_ModHandler.getModItem; -import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; -import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; -import static gregtech.api.util.GT_RecipeMapUtil.GT_RecipeTemplate; -import static gregtech.api.util.GT_RecipeMapUtil.asTemplate; -import static gregtech.api.util.GT_RecipeMapUtil.buildOrEmpty; -import static gregtech.api.util.GT_Utility.clamp; -import static gregtech.api.util.GT_Utility.copyAmount; -import static gregtech.api.util.GT_Utility.getFluidForFilledItem; -import static gregtech.api.util.GT_Utility.isArrayEmptyOrNull; -import static gregtech.api.util.GT_Utility.isArrayOfLength; -import static gregtech.api.util.GT_Utility.multiplyStack; +import static gregtech.api.util.GTModHandler.getModItem; +import static gregtech.api.util.GTRecipeConstants.ADDITIVE_AMOUNT; +import static gregtech.api.util.GTRecipeConstants.FUEL_VALUE; +import static gregtech.api.util.GTRecipeMapUtil.GTRecipeTemplate; +import static gregtech.api.util.GTRecipeMapUtil.asTemplate; +import static gregtech.api.util.GTRecipeMapUtil.buildOrEmpty; +import static gregtech.api.util.GTUtility.clamp; +import static gregtech.api.util.GTUtility.copyAmount; +import static gregtech.api.util.GTUtility.getFluidForFilledItem; +import static gregtech.api.util.GTUtility.isArrayEmptyOrNull; +import static gregtech.api.util.GTUtility.isArrayOfLength; +import static gregtech.api.util.GTUtility.multiplyStack; import java.util.ArrayList; import java.util.Collection; @@ -32,11 +32,11 @@ import org.apache.commons.lang3.ArrayUtils; import com.gtnewhorizons.modularui.api.drawable.UITexture; import com.gtnewhorizons.modularui.common.widget.ProgressBar; -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; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.IRecipeMap; import gregtech.api.objects.ItemData; import gregtech.api.recipe.maps.AssemblerBackend; @@ -68,12 +68,12 @@ import gregtech.api.recipe.maps.UnpackagerBackend; import gregtech.api.recipe.metadata.CompressionTierKey; import gregtech.api.recipe.metadata.PCBFactoryTierKey; import gregtech.api.recipe.metadata.PurificationPlantBaseChanceKey; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeConstants; -import gregtech.api.util.GT_RecipeMapUtil; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeConstants; +import gregtech.api.util.GTRecipeMapUtil; +import gregtech.api.util.GTUtility; import gregtech.common.tileentities.machines.multi.purification.PurifiedWaterHelpers; import gregtech.nei.formatter.FuelSpecialValueFormatter; import gregtech.nei.formatter.FusionSpecialValueFormatter; @@ -94,12 +94,12 @@ public final class RecipeMaps { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } else { - return GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE; + return GTUITextures.OVERLAY_SLOT_CRUSHED_ORE; } }) - .progressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) + .progressBar(GTUITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) .build(); public static final RecipeMap<RecipeMapBackend> thermalCentrifugeRecipes = RecipeMapBuilder .of("gt.recipe.thermalcentrifuge") @@ -111,9 +111,9 @@ public final class RecipeMaps { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } else { - return GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE; + return GTUITextures.OVERLAY_SLOT_CRUSHED_ORE; } }) .build(); @@ -121,17 +121,17 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_COMPRESSOR + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_COMPRESSOR : null) - .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS) + .progressBar(GTUITextures.PROGRESSBAR_COMPRESS) .slotOverlaysSteam( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_COMPRESSOR_STEAM : null) - .progressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM) + .progressBarSteam(GTUITextures.PROGRESSBAR_COMPRESS_STEAM) .neiRecipeComparator( Comparator - .<GT_Recipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0)) - .thenComparing(GT_Recipe::compareTo)) + .<GTRecipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0)) + .thenComparing(GTRecipe::compareTo)) // Avoid steam machine being used as handler icon .neiHandlerInfo(builder -> builder.setDisplayStack(ItemList.Machine_LV_Compressor.get(1))) .build(); @@ -139,27 +139,27 @@ public final class RecipeMaps { .of("gt.recipe.neutroniumcompressor") .maxIO(1, 1, 1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_COMPRESSOR + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_COMPRESSOR : null) - .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS) + .progressBar(GTUITextures.PROGRESSBAR_COMPRESS) .neiHandlerInfo(builder -> builder.setDisplayStack(getModItem(Avaritia.ID, "Singularity", 1L, 0))) .disableOptimize() .neiRecipeComparator( Comparator - .<GT_Recipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0)) - .thenComparing(GT_Recipe::compareTo)) + .<GTRecipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(CompressionTierKey.INSTANCE, 0)) + .thenComparing(GTRecipe::compareTo)) .build(); public static final RecipeMap<RecipeMapBackend> extractorRecipes = RecipeMapBuilder.of("gt.recipe.extractor") .maxIO(1, 1, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CENTRIFUGE + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CENTRIFUGE : null) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT) + .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) .slotOverlaysSteam( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM : null) - .progressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM) + .progressBarSteam(GTUITextures.PROGRESSBAR_EXTRACT_STEAM) // Avoid steam machine being used as handler icon .neiHandlerInfo(builder -> builder.setDisplayStack(ItemList.Machine_LV_Extractor.get(1))) .build(); @@ -168,8 +168,8 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_RECYCLE : null) - .progressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_RECYCLE : null) + .progressBar(GTUITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW) .neiTransferRectId("ic2.recycler") .disableRegisterNEI() .build(); @@ -178,11 +178,11 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 0) .minInputs(1, 9) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_FURNACE : null) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_FURNACE : null) .slotOverlaysSteam( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_FURNACE_STEAM : null) - .progressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM) + .progressBarSteam(GTUITextures.PROGRESSBAR_ARROW_STEAM) .neiTransferRectId("smelting") .disableRegisterNEI() .build(); @@ -191,7 +191,7 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_FURNACE : null) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_FURNACE : null) .neiTransferRectId("smelting") .disableRegisterNEI() .build(); @@ -201,10 +201,10 @@ public final class RecipeMaps { .useSpecialSlot() .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isSpecial) { - return GT_UITextures.OVERLAY_SLOT_DATA_ORB; + return GTUITextures.OVERLAY_SLOT_DATA_ORB; } if (!isFluid && !isOutput) { - return GT_UITextures.OVERLAY_SLOT_MICROSCOPE; + return GTUITextures.OVERLAY_SLOT_MICROSCOPE; } return null; }) @@ -214,12 +214,12 @@ public final class RecipeMaps { .maxIO(2, 1, 0, 0) .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE; + return GTUITextures.OVERLAY_SLOT_CRUSHED_ORE; } else { - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } }) - .progressBar(GT_UITextures.PROGRESSBAR_MACERATE) + .progressBar(GTUITextures.PROGRESSBAR_MACERATE) .build(); public static final RecipeMap<ReplicatorBackend> replicatorRecipes = RecipeMapBuilder .of("gt.recipe.replicator", ReplicatorBackend::new) @@ -228,23 +228,23 @@ public final class RecipeMaps { .useSpecialSlot() .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isSpecial) { - return GT_UITextures.OVERLAY_SLOT_DATA_ORB; + return GTUITextures.OVERLAY_SLOT_DATA_ORB; } if (isFluid && !isOutput) { - return GT_UITextures.OVERLAY_SLOT_UUM; + return GTUITextures.OVERLAY_SLOT_UUM; } return null; }) .build(); /** - * Use {@link GT_RecipeConstants#AssemblyLine} for recipe addition. + * Use {@link GTRecipeConstants#AssemblyLine} for recipe addition. */ public static final RecipeMap<RecipeMapBackend> assemblylineVisualRecipes = RecipeMapBuilder .of("gt.recipe.fakeAssemblylineProcess") .maxIO(16, 1, 4, 0) .minInputs(1, 0) .useSpecialSlot() - .slotOverlays((index, isFluid, isOutput, isSpecial) -> isSpecial ? GT_UITextures.OVERLAY_SLOT_DATA_ORB : null) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> isSpecial ? GTUITextures.OVERLAY_SLOT_DATA_ORB : null) .disableOptimize() .neiTransferRect(88, 8, 18, 72) .neiTransferRect(124, 8, 18, 72) @@ -252,7 +252,7 @@ public final class RecipeMaps { .frontend(AssemblyLineFrontend::new) .build(); /** - * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. + * Usually, but not always, you should use {@link GTRecipeConstants#UniversalArcFurnace} instead. */ public static final RecipeMap<RecipeMapBackend> plasmaArcFurnaceRecipes = RecipeMapBuilder .of("gt.recipe.plasmaarcfurnace") @@ -260,7 +260,7 @@ public final class RecipeMaps { .minInputs(1, 1) .build(); /** - * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. + * Usually, but not always, you should use {@link GTRecipeConstants#UniversalArcFurnace} instead. */ public static final RecipeMap<RecipeMapBackend> arcFurnaceRecipes = RecipeMapBuilder.of("gt.recipe.arcfurnace") .maxIO(1, 9, 1, 0) @@ -274,20 +274,20 @@ public final class RecipeMaps { .useSpecialSlot() .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isSpecial) { - return GT_UITextures.OVERLAY_SLOT_DATA_STICK; + return GTUITextures.OVERLAY_SLOT_DATA_STICK; } if (isFluid) { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED; + return GTUITextures.OVERLAY_SLOT_PAGE_PRINTED; } - return GT_UITextures.OVERLAY_SLOT_PAGE_BLANK; + return GTUITextures.OVERLAY_SLOT_PAGE_BLANK; }) .build(); public static final RecipeMap<RecipeMapBackend> sifterRecipes = RecipeMapBuilder.of("gt.recipe.sifter") .maxIO(1, 9, 1, 1) - .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) + .progressBar(GTUITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) .build(); public static final RecipeMap<FormingPressBackend> formingPressRecipes = RecipeMapBuilder .of("gt.recipe.press", FormingPressBackend::new) @@ -295,32 +295,32 @@ public final class RecipeMaps { .minInputs(2, 0) .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_PRESS_3; + return GTUITextures.OVERLAY_SLOT_PRESS_3; } if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_PRESS_1; + return GTUITextures.OVERLAY_SLOT_PRESS_1; } - return GT_UITextures.OVERLAY_SLOT_PRESS_2; + return GTUITextures.OVERLAY_SLOT_PRESS_2; }) - .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS) + .progressBar(GTUITextures.PROGRESSBAR_COMPRESS) .build(); public static final RecipeMap<RecipeMapBackend> laserEngraverRecipes = RecipeMapBuilder .of("gt.recipe.laserengraver") .maxIO(4, 4, 2, 2) .slotOverlays( (index, isFluid, isOutput, - isSpecial) -> !isFluid && !isOutput && index != 0 ? GT_UITextures.OVERLAY_SLOT_LENS : null) + isSpecial) -> !isFluid && !isOutput && index != 0 ? GTUITextures.OVERLAY_SLOT_LENS : null) // Add a simple ordering so lower tier purified water is displayed first, otherwise it gets really confusing .neiRecipeComparator( (a, b) -> Comparator.comparing(PurifiedWaterHelpers::getWaterTierFromRecipe) - .thenComparing(GT_Recipe::compareTo) + .thenComparing(GTRecipe::compareTo) .compare(a, b)) .build(); public static final RecipeMap<RecipeMapBackend> mixerRecipes = RecipeMapBuilder.of("gt.recipe.mixer") .maxIO(9, 4, 1, 1) .minInputs(1, 0) - .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isFluid ? GT_UITextures.OVERLAY_SLOT_DUST : null) - .progressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isFluid ? GTUITextures.OVERLAY_SLOT_DUST : null) + .progressBar(GTUITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW) .build(); public static final RecipeMap<RecipeMapBackend> autoclaveRecipes = RecipeMapBuilder.of("gt.recipe.autoclave") .maxIO(2, 4, 1, 1) @@ -331,11 +331,11 @@ public final class RecipeMaps { } if (isOutput) { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_GEM; + return GTUITextures.OVERLAY_SLOT_GEM; } - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; }) .build(); public static final RecipeMap<RecipeMapBackend> electroMagneticSeparatorRecipes = RecipeMapBuilder @@ -343,47 +343,47 @@ public final class RecipeMaps { .maxIO(1, 3, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> isOutput ? GT_UITextures.OVERLAY_SLOT_DUST - : GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .progressBar(GT_UITextures.PROGRESSBAR_MAGNET) + (index, isFluid, isOutput, isSpecial) -> isOutput ? GTUITextures.OVERLAY_SLOT_DUST + : GTUITextures.OVERLAY_SLOT_CRUSHED_ORE) + .progressBar(GTUITextures.PROGRESSBAR_MAGNET) .build(); public static final RecipeMap<RecipeMapBackend> polarizerRecipes = RecipeMapBuilder.of("gt.recipe.polarizer") .maxIO(1, 1, 0, 0) .minInputs(1, 0) - .progressBar(GT_UITextures.PROGRESSBAR_MAGNET) + .progressBar(GTUITextures.PROGRESSBAR_MAGNET) .build(); public static final RecipeMap<RecipeMapBackend> maceratorRecipes = RecipeMapBuilder.of("gt.recipe.macerator") .maxIO(1, 4, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> isOutput ? GT_UITextures.OVERLAY_SLOT_DUST - : GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + (index, isFluid, isOutput, isSpecial) -> isOutput ? GTUITextures.OVERLAY_SLOT_DUST + : GTUITextures.OVERLAY_SLOT_CRUSHED_ORE) .slotOverlaysSteam( - (index, isFluid, isOutput, isSpecial) -> isOutput ? GT_UITextures.OVERLAY_SLOT_DUST_STEAM - : GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) - .progressBar(GT_UITextures.PROGRESSBAR_MACERATE) - .progressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM) + (index, isFluid, isOutput, isSpecial) -> isOutput ? GTUITextures.OVERLAY_SLOT_DUST_STEAM + : GTUITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) + .progressBar(GTUITextures.PROGRESSBAR_MACERATE) + .progressBarSteam(GTUITextures.PROGRESSBAR_MACERATE_STEAM) // Avoid steam machine being used as handler icon .neiHandlerInfo(builder -> builder.setDisplayStack(ItemList.Machine_LV_Macerator.get(1))) .build(); public static final RecipeMap<RecipeMapBackend> chemicalBathRecipes = RecipeMapBuilder.of("gt.recipe.chemicalbath") .maxIO(1, 3, 1, 1) .minInputs(1, 1) - .progressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) + .progressBar(GTUITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) .build(); public static final RecipeMap<FluidCannerBackend> fluidCannerRecipes = RecipeMapBuilder .of("gt.recipe.fluidcanner", FluidCannerBackend::new) .maxIO(1, 1, 1, 1) .minInputs(1, 0) - .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isFluid ? GT_UITextures.OVERLAY_SLOT_CANISTER : null) - .progressBar(GT_UITextures.PROGRESSBAR_CANNER) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isFluid ? GTUITextures.OVERLAY_SLOT_CANISTER : null) + .progressBar(GTUITextures.PROGRESSBAR_CANNER) .build(); public static final RecipeMap<RecipeMapBackend> brewingRecipes = RecipeMapBuilder.of("gt.recipe.brewer") .maxIO(1, 0, 1, 1) .minInputs(1, 1) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CAULDRON : null) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CAULDRON : null) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .build(); public static final RecipeMap<RecipeMapBackend> fluidHeaterRecipes = RecipeMapBuilder.of("gt.recipe.fluidheater") .maxIO(1, 0, 1, 1) @@ -392,11 +392,11 @@ public final class RecipeMaps { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_HEATER_2; + return GTUITextures.OVERLAY_SLOT_HEATER_2; } - return GT_UITextures.OVERLAY_SLOT_HEATER_1; + return GTUITextures.OVERLAY_SLOT_HEATER_1; }) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .build(); public static final RecipeMap<RecipeMapBackend> distilleryRecipes = RecipeMapBuilder.of("gt.recipe.distillery") .maxIO(1, 1, 1, 1) @@ -406,11 +406,11 @@ public final class RecipeMaps { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_BEAKER_2; + return GTUITextures.OVERLAY_SLOT_BEAKER_2; } - return GT_UITextures.OVERLAY_SLOT_BEAKER_1; + return GTUITextures.OVERLAY_SLOT_BEAKER_1; }) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .recipeTransformer(r -> { int aInput = r.mFluidInputs[0].amount, aOutput = r.mFluidOutputs[0].amount, aDuration = r.mDuration; @@ -434,14 +434,14 @@ public final class RecipeMaps { aInput = (aInput + tScale - 1) / tScale; aOutput = aOutput / tScale; if (!isArrayEmptyOrNull(r.mOutputs)) { - ItemData tData = GT_OreDictUnificator.getItemData(r.mOutputs[0]); + ItemData tData = GTOreDictUnificator.getItemData(r.mOutputs[0]); if (tData != null && (tData.mPrefix == OrePrefixes.dust || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) { - r.mOutputs[0] = GT_OreDictUnificator.getDust( + r.mOutputs[0] = GTOreDictUnificator.getDust( tData.mMaterial.mMaterial, tData.mMaterial.mAmount * r.mOutputs[0].stackSize / tScale); } else { - if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GT_Values.NI; + if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GTValues.NI; else r.mOutputs[0] = copyAmount(r.mOutputs[0].stackSize / tScale, r.mOutputs[0]); } } @@ -455,14 +455,14 @@ public final class RecipeMaps { public static final RecipeMap<RecipeMapBackend> fermentingRecipes = RecipeMapBuilder.of("gt.recipe.fermenter") .maxIO(0, 0, 1, 1) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .build(); public static final RecipeMap<RecipeMapBackend> fluidSolidifierRecipes = RecipeMapBuilder .of("gt.recipe.fluidsolidifier") .maxIO(1, 1, 1, 0) .minInputs(1, 1) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_MOLD : null) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_MOLD : null) .recipeTransformer(r -> { if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { if (Materials.PhasedGold.getMolten(1) @@ -479,9 +479,9 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 1) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CENTRIFUGE + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CENTRIFUGE : null) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT) + .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) .recipeTransformer(r -> { if (ArrayUtils.isNotEmpty(r.mFluidOutputs)) { if (Materials.PhasedGold.getMolten(1) @@ -498,10 +498,10 @@ public final class RecipeMaps { .minInputs(2, 0) .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_BOXED; + return GTUITextures.OVERLAY_SLOT_BOXED; } if (index != 0) { - return GT_UITextures.OVERLAY_SLOT_BOX; + return GTUITextures.OVERLAY_SLOT_BOX; } return null; }) @@ -510,7 +510,7 @@ public final class RecipeMaps { .of("gt.recipe.unpackager", UnpackagerBackend::new) .maxIO(1, 2, 0, 0) .minInputs(1, 0) - .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isOutput ? GT_UITextures.OVERLAY_SLOT_BOXED : null) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> !isOutput ? GTUITextures.OVERLAY_SLOT_BOXED : null) .build(); public static final RecipeMap<RecipeMapBackend> fusionRecipes = RecipeMapBuilder.of("gt.recipe.fusionreactor") .maxIO(0, 0, 2, 1) @@ -520,9 +520,9 @@ public final class RecipeMaps { .neiSpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE) .neiRecipeComparator( Comparator - .<GT_Recipe, Integer>comparing( + .<GTRecipe, Integer>comparing( recipe -> FusionSpecialValueFormatter.getFusionTier(recipe.mSpecialValue, recipe.mEUt)) - .thenComparing(GT_Recipe::compareTo)) + .thenComparing(GTRecipe::compareTo)) .frontend(FluidOnlyFrontend::new) .build(); public static final RecipeMap<RecipeMapBackend> centrifugeRecipes = RecipeMapBuilder.of("gt.recipe.centrifuge") @@ -532,15 +532,15 @@ public final class RecipeMaps { return null; } if (isFluid) { - return GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID; + return GTUITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID; } else { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_CENTRIFUGE; + return GTUITextures.OVERLAY_SLOT_CENTRIFUGE; } - return GT_UITextures.OVERLAY_SLOT_CANISTER; + return GTUITextures.OVERLAY_SLOT_CANISTER; } }) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT) + .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) .build(); public static final RecipeMap<RecipeMapBackend> electrolyzerRecipes = RecipeMapBuilder.of("gt.recipe.electrolyzer") .maxIO(2, 6, 1, 1) @@ -549,18 +549,18 @@ public final class RecipeMaps { return null; } if (isFluid) { - return GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID; + return GTUITextures.OVERLAY_SLOT_CHARGER_FLUID; } else { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_CHARGER; + return GTUITextures.OVERLAY_SLOT_CHARGER; } - return GT_UITextures.OVERLAY_SLOT_CANISTER; + return GTUITextures.OVERLAY_SLOT_CANISTER; } }) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT) + .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) .build(); /** - * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. + * Use {@link GTRecipeConstants#COIL_HEAT} as heat level. */ public static final RecipeMap<RecipeMapBackend> blastFurnaceRecipes = RecipeMapBuilder.of("gt.recipe.blastfurnace") .maxIO(6, 6, 1, 1) @@ -568,7 +568,7 @@ public final class RecipeMaps { .neiSpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE) .build(); /** - * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. + * Use {@link GTRecipeConstants#COIL_HEAT} as heat level. */ public static final RecipeMap<RecipeMapBackend> plasmaForgeRecipes = RecipeMapBuilder.of("gt.recipe.plasmaforge") .maxIO(9, 9, 9, 9) @@ -606,14 +606,14 @@ public final class RecipeMaps { .disableOptimize() .build(); /** - * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for coal/charcoal amount. + * Uses {@link GTRecipeConstants#ADDITIVE_AMOUNT} for coal/charcoal amount. */ public static final RecipeMap<RecipeMapBackend> primitiveBlastRecipes = RecipeMapBuilder .of("gt.recipe.primitiveblastfurnace") .maxIO(3, 3, 0, 0) .minInputs(1, 0) .recipeEmitter(builder -> { - Optional<GT_Recipe> rr = builder.eut(0) + Optional<GTRecipe> rr = builder.eut(0) .validateInputCount(1, 2) .validateOutputCount(1, 2) .validateNoInputFluid() @@ -629,7 +629,7 @@ public final class RecipeMaps { return Collections.emptyList(); int aCoalAmount = builder.getMetadataOrDefault(ADDITIVE_AMOUNT, 0); if (aCoalAmount <= 0) return Collections.emptyList(); - GT_RecipeTemplate coll = asTemplate(rr.get()); + GTRecipeTemplate coll = asTemplate(rr.get()); for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { coll.derive() .setInputs(aInput1, aInput2, coal.getGems(aCoalAmount)) @@ -684,7 +684,7 @@ public final class RecipeMaps { }) .build(); /** - * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for TNT/ITNT/... amount. Value is truncated to [0, 64] + * Uses {@link GTRecipeConstants#ADDITIVE_AMOUNT} for TNT/ITNT/... amount. Value is truncated to [0, 64] */ public static final RecipeMap<RecipeMapBackend> implosionRecipes = RecipeMapBuilder .of("gt.recipe.implosioncompressor") @@ -693,13 +693,13 @@ public final class RecipeMaps { .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (!isFluid && !isOutput) { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_IMPLOSION; + return GTUITextures.OVERLAY_SLOT_IMPLOSION; } - return GT_UITextures.OVERLAY_SLOT_EXPLOSIVE; + return GTUITextures.OVERLAY_SLOT_EXPLOSIVE; } return null; }) - .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS) + .progressBar(GTUITextures.PROGRESSBAR_COMPRESS) .disableOptimize() .recipeEmitter(b -> { switch (b.getItemInputsBasic().length) { @@ -712,7 +712,7 @@ public final class RecipeMaps { .map(Collections::singletonList) .orElse(Collections.emptyList()); } - Optional<GT_Recipe> t = b.noOptimize() + Optional<GTRecipe> t = b.noOptimize() .duration(20) .eut(30) .validateInputCount(1, 1) @@ -720,7 +720,7 @@ public final class RecipeMaps { .build(); if (!t.isPresent()) return Collections.emptyList(); ItemStack input = b.getItemInputBasic(0); - GT_RecipeTemplate coll = asTemplate(t.get()); + GTRecipeTemplate coll = asTemplate(t.get()); int tExplosives = Math.min(b.getMetadataOrDefault(ADDITIVE_AMOUNT, 0), 64); int tGunpowder = tExplosives << 1; // Worst int tDynamite = Math.max(1, tExplosives >> 1); // good @@ -730,11 +730,11 @@ public final class RecipeMaps { if (tGunpowder < 65) coll.derive() .setInputs(input, ItemList.Block_Powderbarrel.get(tGunpowder)); if (tDynamite < 17) coll.derive() - .setInputs(input, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)); + .setInputs(input, GTModHandler.getIC2Item("dynamite", tDynamite, null)); coll.derive() .setInputs(input, new ItemStack(Blocks.tnt, tTNT)); coll.derive() - .setInputs(input, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)); + .setInputs(input, GTModHandler.getIC2Item("industrialTnt", tITNT, null)); return coll.getAll(); }) .build(); @@ -749,7 +749,7 @@ public final class RecipeMaps { && isArrayEmptyOrNull(b.getFluidOutputs()) && (in = getFluidForFilledItem(b.getItemInputBasic(0), true)) != null && (out = getFluidForFilledItem(b.getItemOutput(0), true)) != null) { - Collection<GT_Recipe> ret = new ArrayList<>(); + Collection<GTRecipe> ret = new ArrayList<>(); b.build() .ifPresent(ret::add); b.itemInputs() @@ -765,7 +765,7 @@ public final class RecipeMaps { .build(); /** * Using {@code .addTo(chemicalReactorRecipes)} will cause the recipe to be added to single block recipe map ONLY! - * Use {@link GT_RecipeConstants#UniversalChemical} to add to both. + * Use {@link GTRecipeConstants#UniversalChemical} to add to both. */ public static final RecipeMap<RecipeMapBackend> chemicalReactorRecipes = RecipeMapBuilder .of("gt.recipe.chemicalreactor") @@ -774,30 +774,30 @@ public final class RecipeMaps { .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isFluid) { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_VIAL_2; + return GTUITextures.OVERLAY_SLOT_VIAL_2; } - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_3; + return GTUITextures.OVERLAY_SLOT_MOLECULAR_3; } else { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_VIAL_1; + return GTUITextures.OVERLAY_SLOT_VIAL_1; } if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; + return GTUITextures.OVERLAY_SLOT_MOLECULAR_1; } - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; + return GTUITextures.OVERLAY_SLOT_MOLECULAR_2; } }) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .disableOptimize() .build(); /** * Using {@code .addTo(multiblockChemicalReactorRecipes)} will cause the recipe to be added to - * multiblock recipe map ONLY! Use {@link GT_RecipeConstants#UniversalChemical} to add to both. + * multiblock recipe map ONLY! Use {@link GTRecipeConstants#UniversalChemical} to add to both. */ public static final RecipeMap<RecipeMapBackend> multiblockChemicalReactorRecipes = RecipeMapBuilder .of("gt.recipe.largechemicalreactor") .maxIO(6, 6, 6, 6) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .disableOptimize() .frontend(LargeNEIFrontend::new) .build(); @@ -809,12 +809,12 @@ public final class RecipeMaps { return null; } if (isFluid) { - return GT_UITextures.OVERLAY_SLOTS_NUMBER[index + 1]; + return GTUITextures.OVERLAY_SLOTS_NUMBER[index + 1]; } else { - return GT_UITextures.OVERLAY_SLOTS_NUMBER[0]; + return GTUITextures.OVERLAY_SLOTS_NUMBER[0]; } }) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .logoPos(80, 62) .frontend(DistillationTowerFrontend::new) .disableOptimize() @@ -823,7 +823,7 @@ public final class RecipeMaps { .of("gt.recipe.craker", OilCrackerBackend::new) .maxIO(1, 1, 2, 1) .minInputs(1, 2) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .build(); public static final RecipeMap<RecipeMapBackend> pyrolyseRecipes = RecipeMapBuilder.of("gt.recipe.pyro") .maxIO(2, 1, 1, 1) @@ -834,26 +834,26 @@ public final class RecipeMaps { .maxIO(2, 1, 0, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_WIREMILL : null) - .progressBar(GT_UITextures.PROGRESSBAR_WIREMILL) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_WIREMILL : null) + .progressBar(GTUITextures.PROGRESSBAR_WIREMILL) .build(); public static final RecipeMap<RecipeMapBackend> benderRecipes = RecipeMapBuilder.of("gt.recipe.metalbender") .maxIO(2, 1, 0, 0) .minInputs(2, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_BENDER : null) - .progressBar(GT_UITextures.PROGRESSBAR_BENDING) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_BENDER : null) + .progressBar(GTUITextures.PROGRESSBAR_BENDING) .build(); public static final RecipeMap<RecipeMapBackend> alloySmelterRecipes = RecipeMapBuilder.of("gt.recipe.alloysmelter") .maxIO(2, 1, 0, 0) .minInputs(2, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_FURNACE : null) - .slotOverlaysSteam((index, isFluid, isOutput, isSpecial) -> GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) - .progressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_FURNACE : null) + .slotOverlaysSteam((index, isFluid, isOutput, isSpecial) -> GTUITextures.OVERLAY_SLOT_FURNACE_STEAM) + .progressBarSteam(GTUITextures.PROGRESSBAR_ARROW_STEAM) .recipeEmitter(b -> { if (Materials.Graphite.contains(b.getItemInputBasic(0))) return Collections.emptyList(); - if (GT_Utility.isArrayOfLength(b.getItemInputsBasic(), 1)) { + if (GTUtility.isArrayOfLength(b.getItemInputsBasic(), 1)) { ItemStack aInput1 = b.getItemInputBasic(0); if (((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) || (OrePrefixes.gem.contains(aInput1)))) return Collections.emptyList(); @@ -872,8 +872,8 @@ public final class RecipeMaps { .maxIO(9, 1, 1, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CIRCUIT : null) - .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CIRCUIT : null) + .progressBar(GTUITextures.PROGRESSBAR_ASSEMBLE) .disableOptimize() .build(); public static final RecipeMap<RecipeMapBackend> circuitAssemblerRecipes = RecipeMapBuilder @@ -881,8 +881,8 @@ public final class RecipeMaps { .maxIO(6, 1, 1, 0) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CIRCUIT : null) - .progressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_CIRCUIT : null) + .progressBar(GTUITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER) .unificateOutputNEI(!NEICustomDiagrams.isModLoaded()) .build(); public static final RecipeMap<RecipeMapBackend> cannerRecipes = RecipeMapBuilder.of("gt.recipe.canner") @@ -893,11 +893,11 @@ public final class RecipeMaps { return null; } if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_CANNER; + return GTUITextures.OVERLAY_SLOT_CANNER; } - return GT_UITextures.OVERLAY_SLOT_CANISTER; + return GTUITextures.OVERLAY_SLOT_CANISTER; }) - .progressBar(GT_UITextures.PROGRESSBAR_CANNER) + .progressBar(GTUITextures.PROGRESSBAR_CANNER) .build(); public static final RecipeMap<RecipeMapBackend> latheRecipes = RecipeMapBuilder.of("gt.recipe.lathe") .maxIO(1, 2, 0, 0) @@ -905,14 +905,14 @@ public final class RecipeMaps { .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isOutput) { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_ROD_2; + return GTUITextures.OVERLAY_SLOT_ROD_2; } - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } - return GT_UITextures.OVERLAY_SLOT_ROD_1; + return GTUITextures.OVERLAY_SLOT_ROD_1; }) - .progressBar(GT_UITextures.PROGRESSBAR_LATHE) - .addSpecialTexture(98, 24, 5, 18, GT_UITextures.PROGRESSBAR_LATHE_BASE) + .progressBar(GTUITextures.PROGRESSBAR_LATHE) + .addSpecialTexture(98, 24, 5, 18, GTUITextures.PROGRESSBAR_LATHE_BASE) .build(); public static final RecipeMap<RecipeMapBackend> cutterRecipes = RecipeMapBuilder.of("gt.recipe.cuttingsaw") .maxIO(2, 4, 1, 0) @@ -923,13 +923,13 @@ public final class RecipeMaps { } if (isOutput) { if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED; + return GTUITextures.OVERLAY_SLOT_CUTTER_SLICED; } - return GT_UITextures.OVERLAY_SLOT_DUST; + return GTUITextures.OVERLAY_SLOT_DUST; } - return GT_UITextures.OVERLAY_SLOT_BOX; + return GTUITextures.OVERLAY_SLOT_BOX; }) - .progressBar(GT_UITextures.PROGRESSBAR_CUT) + .progressBar(GTUITextures.PROGRESSBAR_CUT) .recipeEmitter(b -> { b.validateInputCount(1, 2) .validateOutputCount(1, 4) @@ -937,14 +937,14 @@ public final class RecipeMaps { if ((b.getFluidInputs() != null && b.getFluidInputs().length > 0) || !b.isValid()) return buildOrEmpty(b.validateInputFluidCount(1, 1)); int aDuration = b.getDuration(), aEUt = b.getEUt(); - Collection<GT_Recipe> ret = new ArrayList<>(); + Collection<GTRecipe> ret = new ArrayList<>(); b.copy() .fluidInputs(Materials.Water.getFluid(clamp(aDuration * aEUt / 320, 4, 1000))) .duration(aDuration * 2) .build() .ifPresent(ret::add); b.copy() - .fluidInputs(GT_ModHandler.getDistilledWater(clamp(aDuration * aEUt / 426, 3, 750))) + .fluidInputs(GTModHandler.getDistilledWater(clamp(aDuration * aEUt / 426, 3, 750))) .duration(aDuration * 2) .build() .ifPresent(ret::add); @@ -960,34 +960,34 @@ public final class RecipeMaps { .minInputs(2, 0) .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_SLICER_SLICED; + return GTUITextures.OVERLAY_SLOT_SLICER_SLICED; } if (index == 0) { - return GT_UITextures.OVERLAY_SLOT_SQUARE; + return GTUITextures.OVERLAY_SLOT_SQUARE; } - return GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE; + return GTUITextures.OVERLAY_SLOT_SLICE_SHAPE; }) - .progressBar(GT_UITextures.PROGRESSBAR_SLICE) + .progressBar(GTUITextures.PROGRESSBAR_SLICE) .build(); public static final RecipeMap<RecipeMapBackend> extruderRecipes = RecipeMapBuilder.of("gt.recipe.extruder") .maxIO(2, 1, 0, 0) .minInputs(2, 0) .slotOverlays( (index, isFluid, isOutput, - isSpecial) -> !isFluid && !isOutput && index != 0 ? GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE : null) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRUDE) + isSpecial) -> !isFluid && !isOutput && index != 0 ? GTUITextures.OVERLAY_SLOT_EXTRUDER_SHAPE : null) + .progressBar(GTUITextures.PROGRESSBAR_EXTRUDE) .build(); public static final RecipeMap<RecipeMapBackend> hammerRecipes = RecipeMapBuilder.of("gt.recipe.hammer") .maxIO(2, 2, 2, 2) .minInputs(1, 0) .slotOverlays( - (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_HAMMER : null) - .progressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) - .addSpecialTexture(78, 42, 20, 6, GT_UITextures.PROGRESSBAR_HAMMER_BASE) + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GTUITextures.OVERLAY_SLOT_HAMMER : null) + .progressBar(GTUITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) + .addSpecialTexture(78, 42, 20, 6, GTUITextures.PROGRESSBAR_HAMMER_BASE) .slotOverlaysSteam( - (index, isFluid, isOutput, isSpecial) -> !isOutput ? GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM : null) - .progressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM) - .addSpecialTextureSteam(78, 42, 20, 6, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM) + (index, isFluid, isOutput, isSpecial) -> !isOutput ? GTUITextures.OVERLAY_SLOT_HAMMER_STEAM : null) + .progressBarSteam(GTUITextures.PROGRESSBAR_HAMMER_STEAM) + .addSpecialTextureSteam(78, 42, 20, 6, GTUITextures.PROGRESSBAR_HAMMER_BASE_STEAM) // Avoid steam machine being used as handler icon .neiHandlerInfo(builder -> builder.setDisplayStack(ItemList.Machine_LV_Hammer.get(1))) .build(); @@ -996,14 +996,14 @@ public final class RecipeMaps { .minInputs(1, 0) .slotOverlays((index, isFluid, isOutput, isSpecial) -> { if (isFluid) { - return GT_UITextures.OVERLAY_SLOT_UUA; + return GTUITextures.OVERLAY_SLOT_UUA; } if (!isOutput) { - return GT_UITextures.OVERLAY_SLOT_CENTRIFUGE; + return GTUITextures.OVERLAY_SLOT_CENTRIFUGE; } return null; }) - .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT) + .progressBar(GTUITextures.PROGRESSBAR_EXTRACT) .build(); public static final RecipeMap<RecipeMapBackend> massFabFakeRecipes = RecipeMapBuilder.of("gt.recipe.massfab") .maxIO(1, 0, 1, 1) @@ -1014,9 +1014,9 @@ public final class RecipeMaps { return null; } if (isOutput) { - return GT_UITextures.OVERLAY_SLOT_UUM; + return GTUITextures.OVERLAY_SLOT_UUM; } - return GT_UITextures.OVERLAY_SLOT_UUA; + return GTUITextures.OVERLAY_SLOT_UUA; }) .build(); public static final RecipeMap<FuelBackend> dieselFuels = RecipeMapBuilder @@ -1083,20 +1083,20 @@ public final class RecipeMaps { .of("gt.recipe.largeelectrolyzer") .maxIO(1, 6, 1, 6) .disableRegisterNEI() - .recipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .recipeEmitter(GTRecipeMapUtil::buildRecipeForMultiblock) .build(); public static final RecipeMap<RecipeMapBackend> centrifugeNonCellRecipes = RecipeMapBuilder .of("gt.recipe.largecentrifuge") .maxIO(2, 6, 1, 6) .disableOptimize() .disableRegisterNEI() - .recipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .recipeEmitter(GTRecipeMapUtil::buildRecipeForMultiblock) .build(); public static final RecipeMap<RecipeMapBackend> mixerNonCellRecipes = RecipeMapBuilder.of("gt.recipe.largemixer") .maxIO(9, 4, 6, 4) .disableOptimize() .disableRegisterNEI() - .recipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblockNoCircuit) + .recipeEmitter(GTRecipeMapUtil::buildRecipeForMultiblockNoCircuit) .build(); public static final RecipeMap<LargeBoilerFuelBackend> largeBoilerFakeFuels = RecipeMapBuilder .of("gt.recipe.largeboilerfakefuels", LargeBoilerFuelBackend::new) @@ -1110,20 +1110,20 @@ public final class RecipeMaps { .minInputs(2, 1) .slotOverlays( (index, isFluid, isOutput, - isSpecial) -> !isFluid && !isOutput && index == 0 ? GT_UITextures.OVERLAY_SLOT_LENS : null) - .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE) + isSpecial) -> !isFluid && !isOutput && index == 0 ? GTUITextures.OVERLAY_SLOT_LENS : null) + .progressBar(GTUITextures.PROGRESSBAR_ASSEMBLE) .disableOptimize() .neiSpecialInfoFormatter(new SimpleSpecialValueFormatter("GT5U.nei.tier")) .build(); public static final RecipeMap<RecipeMapBackend> pcbFactoryRecipes = RecipeMapBuilder.of("gt.recipe.pcbfactory") .maxIO(6, 9, 3, 0) .minInputs(3, 1) - .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE) + .progressBar(GTUITextures.PROGRESSBAR_ASSEMBLE) .disableOptimize() .neiRecipeComparator( Comparator - .<GT_Recipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(PCBFactoryTierKey.INSTANCE, 1)) - .thenComparing(GT_Recipe::compareTo)) + .<GTRecipe, Integer>comparing(recipe -> recipe.getMetadataOrDefault(PCBFactoryTierKey.INSTANCE, 1)) + .thenComparing(GTRecipe::compareTo)) .build(); public static final RecipeMap<RecipeMapBackend> purificationClarifierRecipes = RecipeMapBuilder .of("gt.recipe.purificationplantclarifier") @@ -1136,12 +1136,12 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantozonation") .maxIO(0, 4, 2, 1) .minInputs(0, 2) - .progressBar(GT_UITextures.PROGRESSBAR_BATH) + .progressBar(GTUITextures.PROGRESSBAR_BATH) .neiRecipeComparator( Comparator - .<GT_Recipe, Float>comparing( + .<GTRecipe, Float>comparing( recipe -> recipe.getMetadataOrDefault(PurificationPlantBaseChanceKey.INSTANCE, 0.0f)) - .thenComparing(GT_Recipe::compareTo)) + .thenComparing(GTRecipe::compareTo)) .frontend(PurificationUnitOzonationFrontend::new) .disableOptimize() .build(); @@ -1149,12 +1149,12 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantflocculation") .maxIO(0, 3, 2, 2) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_BATH) + .progressBar(GTUITextures.PROGRESSBAR_BATH) .neiRecipeComparator( Comparator - .<GT_Recipe, Float>comparing( + .<GTRecipe, Float>comparing( recipe -> recipe.getMetadataOrDefault(PurificationPlantBaseChanceKey.INSTANCE, 0.0f)) - .thenComparing(GT_Recipe::compareTo)) + .thenComparing(GTRecipe::compareTo)) .frontend(PurificationUnitFlocculatorFrontend::new) .disableOptimize() .build(); @@ -1163,7 +1163,7 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantphadjustment") .maxIO(0, 0, 1, 1) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_MIXER) + .progressBar(GTUITextures.PROGRESSBAR_MIXER) .frontend(PurificationUnitPhAdjustmentFrontend::new) .disableOptimize() .build(); @@ -1172,7 +1172,7 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantplasmaheating") .maxIO(0, 0, 1, 1) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_BOILER_HEAT) + .progressBar(GTUITextures.PROGRESSBAR_BOILER_HEAT) .frontend(PurificationUnitPlasmaHeaterFrontend::new) .disableOptimize() .build(); @@ -1180,7 +1180,7 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantuvtreatment") .maxIO(9, 0, 1, 1) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW) + .progressBar(GTUITextures.PROGRESSBAR_ARROW) .frontend(PurificationUnitLaserFrontend::new) .disableOptimize() .build(); @@ -1188,14 +1188,14 @@ public final class RecipeMaps { .of("gt.recipe.purificationplantdegasifier") .maxIO(0, 3, 1, 2) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW) + .progressBar(GTUITextures.PROGRESSBAR_ARROW) .disableOptimize() .build(); public static final RecipeMap<RecipeMapBackend> purificationParticleExtractionRecipes = RecipeMapBuilder .of("gt.recipe.purificationplantquarkextractor") .maxIO(2, 2, 1, 2) .minInputs(0, 1) - .progressBar(GT_UITextures.PROGRESSBAR_ARROW) + .progressBar(GTUITextures.PROGRESSBAR_ARROW) .frontend(PurificationUnitParticleExtractorFrontend::new) .disableOptimize() .build(); @@ -1203,10 +1203,10 @@ public final class RecipeMaps { .maxIO(1, 1, 0, 0) .minInputs(1, 0) .disableOptimize() - .logo(GT_UITextures.PICTURE_RADIATION_WARNING) + .logo(GTUITextures.PICTURE_RADIATION_WARNING) .logoPos(152, 41) .neiRecipeBackgroundSize(170, 60) - .neiHandlerInfo(builder -> builder.setDisplayStack(GT_ModHandler.getIC2Item("nuclearReactor", 1, null))) + .neiHandlerInfo(builder -> builder.setDisplayStack(GTModHandler.getIC2Item("nuclearReactor", 1, null))) .build(); static { diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java index 9383abad9d..18edab74e7 100644 --- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java +++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java @@ -11,7 +11,7 @@ import net.minecraft.util.StatCollector; import org.jetbrains.annotations.NotNull; import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class ResultInsufficientHeat implements CheckRecipeResult { @@ -38,7 +38,7 @@ public class ResultInsufficientHeat implements CheckRecipeResult { return Objects.requireNonNull( StatCollector.translateToLocalFormatted( "GT5U.gui.text.insufficient_heat", - GT_Utility.formatNumbers(required), + GTUtility.formatNumbers(required), HeatingCoilLevel.getDisplayNameFromHeat(required, true))); } diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java index 1fb2183edb..2f144049f1 100644 --- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java +++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java @@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector; import org.jetbrains.annotations.NotNull; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class ResultInsufficientMachineTier implements CheckRecipeResult { @@ -37,7 +37,7 @@ public class ResultInsufficientMachineTier implements CheckRecipeResult { return Objects.requireNonNull( StatCollector.translateToLocalFormatted( "GT5U.gui.text.insufficient_machine_tier", - GT_Utility.formatNumbers(required))); + GTUtility.formatNumbers(required))); } @Override diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java index 45b50aebf6..33b86ecbf8 100644 --- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java +++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java @@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector; import org.jetbrains.annotations.NotNull; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class ResultInsufficientPower implements CheckRecipeResult { @@ -37,8 +37,8 @@ public class ResultInsufficientPower implements CheckRecipeResult { return Objects.requireNonNull( StatCollector.translateToLocalFormatted( "GT5U.gui.text.insufficient_power", - GT_Utility.formatNumbers(required), - GT_Utility.getColoredTierNameFromVoltage(required))); + GTUtility.formatNumbers(required), + GTUtility.getColoredTierNameFromVoltage(required))); } @Override diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java index c33e9bfff1..9adf82aa28 100644 --- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java +++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java @@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector; import org.jetbrains.annotations.NotNull; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; public class ResultInsufficientStartupPower implements CheckRecipeResult { @@ -37,7 +37,7 @@ public class ResultInsufficientStartupPower implements CheckRecipeResult { return Objects.requireNonNull( StatCollector.translateToLocalFormatted( "GT5U.gui.text.insufficient_startup_power", - GT_Utility.formatNumbers(required))); + GTUtility.formatNumbers(required))); } @Override diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java index f4b186c9a1..32aab79465 100644 --- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java +++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.check; -import static util.Util.toStandardForm; +import static kekztech.util.Util.toStandardForm; import java.math.BigInteger; import java.util.Objects; diff --git a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java index 8683812d84..d339f8acfd 100644 --- a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java +++ b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java @@ -22,11 +22,11 @@ import net.minecraftforge.fluids.FluidStack; import com.google.common.collect.ImmutableMap; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMap; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Utility.ItemId; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtility.ItemId; /** * Used by machines that are locked to a single recipe, for faster recipe check. @@ -37,10 +37,10 @@ import gregtech.api.util.GT_Utility.ItemId; * <ul> * {@link gregtech.api.recipe.FindRecipeQuery#find Find recipe from recipemap}: O(NCR) * where N = number of machine inputs, C = average amount of recipe candidates found for specific input, - * R = computation time to {@link GT_Recipe#isRecipeInputEqual check if inputs match to recipe} + * R = computation time to {@link GTRecipe#isRecipeInputEqual check if inputs match to recipe} * </ul> * <ul> - * {@link GT_Recipe#isRecipeInputEqual Check if inputs match to recipe}: O(NM) + * {@link GTRecipe#isRecipeInputEqual Check if inputs match to recipe}: O(NM) * where N = number of machine inputs, M = number of recipe inputs * </ul> * </ul> @@ -52,7 +52,7 @@ import gregtech.api.util.GT_Utility.ItemId; public class SingleRecipeCheck { @Nonnull - private final GT_Recipe recipe; + private final GTRecipe recipe; @Nonnull private final RecipeMap<?> recipeMap; @Nonnull @@ -63,7 +63,7 @@ public class SingleRecipeCheck { private final int totalItemCost; private final int totalFluidCost; - private SingleRecipeCheck(@Nonnull GT_Recipe recipe, @Nonnull RecipeMap<?> recipeMap, + private SingleRecipeCheck(@Nonnull GTRecipe recipe, @Nonnull RecipeMap<?> recipeMap, @Nonnull ImmutableMap<ItemId, Integer> itemCost, @Nonnull ImmutableMap<Fluid, Integer> fluidCost) { this.recipe = recipe; this.recipeMap = recipeMap; @@ -81,7 +81,7 @@ public class SingleRecipeCheck { } @Nonnull - public GT_Recipe getRecipe() { + public GTRecipe getRecipe() { return recipe; } @@ -188,14 +188,14 @@ public class SingleRecipeCheck { // At load time we do a recipe check again, so in case the recipe is gone, we can stop tracking. // Of course the next step would be auto migrating to new recipe (if any), but given // we don't yet have a mean to uniquely name a recipe, this will have to make do. - // Consider move serialization code to GT_Recipe once this has been proven to work + // Consider move serialization code to GTRecipe once this has been proven to work NBTTagCompound tag = new NBTTagCompound(); tag.setString("recipemap", recipeMap.unlocalizedName); if (recipe.mInputs != null) { - tag.setTag("inputs", writeList(recipe.mInputs, GT_Utility::saveItem)); + tag.setTag("inputs", writeList(recipe.mInputs, GTUtility::saveItem)); } if (recipe.mOutputs != null) { - tag.setTag("outputs", writeList(recipe.mOutputs, GT_Utility::saveItem)); + tag.setTag("outputs", writeList(recipe.mOutputs, GTUtility::saveItem)); } if (recipe.mChances != null) { tag.setIntArray("chances", recipe.mChances); @@ -270,45 +270,44 @@ public class SingleRecipeCheck { return null; } - GT_Recipe foundRecipe = tryFindRecipe(mapToUse, tag); + GTRecipe foundRecipe = tryFindRecipe(mapToUse, tag); if (foundRecipe == null) return null; return new SingleRecipeCheck(foundRecipe, mapToUse, loadItemCost(tag), loadFluidCost(tag)); } private static ImmutableMap<Fluid, Integer> loadFluidCost(NBTTagCompound tag) { - return GT_Utility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND)) + return GTUtility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND)) .collect( - GT_Utility + GTUtility .toImmutableMapSerial(t -> FluidRegistry.getFluid(t.getString("id")), t -> t.getInteger("count"))); } private static ImmutableMap<ItemId, Integer> loadItemCost(NBTTagCompound tag) { - return GT_Utility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND)) + return GTUtility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND)) .collect( - GT_Utility - .toImmutableMapSerial(t -> ItemId.create(t.getCompoundTag("id")), t -> t.getInteger("count"))); + GTUtility.toImmutableMapSerial(t -> ItemId.create(t.getCompoundTag("id")), t -> t.getInteger("count"))); } - private static GT_Recipe tryFindRecipe(@Nonnull RecipeMap<?> recipeMap, NBTTagCompound tag) { - ItemStack[] inputs = GT_Utility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) + private static GTRecipe tryFindRecipe(@Nonnull RecipeMap<?> recipeMap, NBTTagCompound tag) { + ItemStack[] inputs = GTUtility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND)) + .map(GTUtility::loadItem) .toArray(ItemStack[]::new); - ItemStack[] outputs = GT_Utility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) + ItemStack[] outputs = GTUtility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND)) + .map(GTUtility::loadItem) .toArray(ItemStack[]::new); - FluidStack[] fInputs = GT_Utility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND)) + FluidStack[] fInputs = GTUtility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND)) .map(FluidStack::loadFluidStackFromNBT) .toArray(FluidStack[]::new); - FluidStack[] fOutputs = GT_Utility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND)) + FluidStack[] fOutputs = GTUtility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND)) .map(FluidStack::loadFluidStackFromNBT) .toArray(FluidStack[]::new); int eut = tag.getInteger("eut"); - GT_Recipe found = recipeMap.findRecipe(null, false, GT_Values.V[GT_Utility.getTier(eut)], fInputs, inputs); + GTRecipe found = recipeMap.findRecipe(null, false, GTValues.V[GTUtility.getTier(eut)], fInputs, inputs); int[] chances = tag.getIntArray("chances"); if (chances.length == 0) chances = null; - if (found == null || !GT_Utility.equals(inputs, found.mInputs) + if (found == null || !GTUtility.equals(inputs, found.mInputs) || !Arrays.equals(fInputs, found.mFluidInputs) - || !GT_Utility.equals(outputs, found.mOutputs) + || !GTUtility.equals(outputs, found.mOutputs) || !Arrays.equals(fOutputs, found.mFluidOutputs) || !Arrays.equals(chances, found.mChances) || found.mDuration != tag.getInteger("duration") @@ -350,7 +349,7 @@ public class SingleRecipeCheck { private Map<ItemId, Integer> afterItems; private Map<Fluid, Integer> afterFluids; - private GT_Recipe recipe; + private GTRecipe recipe; private Builder(@Nonnull RecipeMap<?> recipeMap) { this.recipeMap = recipeMap; @@ -368,7 +367,7 @@ public class SingleRecipeCheck { return this; } - public Builder setRecipe(@Nonnull GT_Recipe recipe) { + public Builder setRecipe(@Nonnull GTRecipe recipe) { this.recipe = recipe; return this; } diff --git a/src/main/java/gregtech/api/recipe/maps/AssemblerBackend.java b/src/main/java/gregtech/api/recipe/maps/AssemblerBackend.java index cfa25e9fe2..8273c895b2 100644 --- a/src/main/java/gregtech/api/recipe/maps/AssemblerBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/AssemblerBackend.java @@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.ItemList; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @@ -21,7 +21,7 @@ public class AssemblerBackend extends RecipeMapBackend { } @Override - protected GT_Recipe modifyFoundRecipe(GT_Recipe recipe, ItemStack[] items, FluidStack[] fluids, + protected GTRecipe modifyFoundRecipe(GTRecipe recipe, ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { for (ItemStack item : items) { if (ItemList.Paper_Printed_Pages.isStackEqual(item, false, true)) { diff --git a/src/main/java/gregtech/api/recipe/maps/AssemblyLineFrontend.java b/src/main/java/gregtech/api/recipe/maps/AssemblyLineFrontend.java index 3d56c96b82..4bf3f7f56e 100644 --- a/src/main/java/gregtech/api/recipe/maps/AssemblyLineFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/AssemblyLineFrontend.java @@ -10,7 +10,7 @@ import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.ProgressBar; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; @@ -52,21 +52,21 @@ public class AssemblyLineFrontend extends RecipeMapFrontend { int bar2Width = 18; List<Supplier<Float>> splitProgress = splitProgress(progressSupplier, bar1Width, bar2Width); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, bar1Width) + new ProgressBar().setTexture(GTUITextures.PROGRESSBAR_ASSEMBLY_LINE_1, bar1Width) .setDirection(ProgressBar.Direction.RIGHT) .setProgress(splitProgress.get(0)) .setSynced(false, false) .setPos(new Pos2d(88, 8).add(windowOffset)) .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, bar2Width) + new ProgressBar().setTexture(GTUITextures.PROGRESSBAR_ASSEMBLY_LINE_2, bar2Width) .setDirection(ProgressBar.Direction.RIGHT) .setProgress(splitProgress.get(1)) .setSynced(false, false) .setPos(new Pos2d(124, 8).add(windowOffset)) .setSize(bar2Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) + new ProgressBar().setTexture(GTUITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) .setDirection(ProgressBar.Direction.UP) .setProgress(progressSupplier) .setSynced(false, false) diff --git a/src/main/java/gregtech/api/recipe/maps/FluidCannerBackend.java b/src/main/java/gregtech/api/recipe/maps/FluidCannerBackend.java index e5681f59aa..9bbe087e54 100644 --- a/src/main/java/gregtech/api/recipe/maps/FluidCannerBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/FluidCannerBackend.java @@ -8,11 +8,11 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @@ -24,17 +24,17 @@ public class FluidCannerBackend extends RecipeMapBackend { } @Override - protected GT_Recipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { + protected GTRecipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { if (items.length == 0 || items[0] == null) { return null; } if (fluids.length > 0 && fluids[0] != null) { - ItemStack filledItem = GT_Utility.fillFluidContainer(fluids[0], items[0], false, true); - FluidStack fluidToTake = GT_Utility.getFluidForFilledItem(filledItem, true); + ItemStack filledItem = GTUtility.fillFluidContainer(fluids[0], items[0], false, true); + FluidStack fluidToTake = GTUtility.getFluidForFilledItem(filledItem, true); if (fluidToTake != null) { - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) .itemOutputs(filledItem) .fluidInputs(fluidToTake) .duration(Math.max(fluidToTake.amount / 64, 16)) @@ -45,11 +45,11 @@ public class FluidCannerBackend extends RecipeMapBackend { .orElse(null); } } - FluidStack drainedFluid = GT_Utility.getFluidForFilledItem(items[0], true); + FluidStack drainedFluid = GTUtility.getFluidForFilledItem(items[0], true); if (drainedFluid != null) { - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) - .itemOutputs(GT_Utility.getContainerItem(items[0], true)) + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) + .itemOutputs(GTUtility.getContainerItem(items[0], true)) .fluidOutputs(drainedFluid) .duration(Math.max(drainedFluid.amount / 64, 16)) .eut(1) diff --git a/src/main/java/gregtech/api/recipe/maps/FormingPressBackend.java b/src/main/java/gregtech/api/recipe/maps/FormingPressBackend.java index ce3ea3e89c..ccf6e63c29 100644 --- a/src/main/java/gregtech/api/recipe/maps/FormingPressBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/FormingPressBackend.java @@ -7,12 +7,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -27,7 +27,7 @@ public class FormingPressBackend extends RecipeMapBackend { } @Override - protected GT_Recipe modifyFoundRecipe(GT_Recipe recipe, ItemStack[] items, FluidStack[] fluids, + protected GTRecipe modifyFoundRecipe(GTRecipe recipe, ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { for (ItemStack mold : items) { if (ItemList.Shape_Mold_Credit.isStackEqual(mold, false, true)) { @@ -46,7 +46,7 @@ public class FormingPressBackend extends RecipeMapBackend { } @Override - protected GT_Recipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { + protected GTRecipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { if (items.length < 2) { return null; } @@ -54,16 +54,16 @@ public class FormingPressBackend extends RecipeMapBackend { } @Nullable - private GT_Recipe findRenamingRecipe(ItemStack[] inputs) { + private GTRecipe findRenamingRecipe(ItemStack[] inputs) { ItemStack mold = findNameMoldIndex(inputs); if (mold == null) return null; ItemStack input = findStackToRename(inputs, mold); if (input == null) return null; - ItemStack output = GT_Utility.copyAmount(1, input); + ItemStack output = GTUtility.copyAmount(1, input); if (output == null) return null; output.setStackDisplayName(mold.getDisplayName()); - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(0, mold), GT_Utility.copyAmount(1, input)) + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(0, mold), GTUtility.copyAmount(1, input)) .itemOutputs(output) .duration(128) .eut(8) diff --git a/src/main/java/gregtech/api/recipe/maps/FuelBackend.java b/src/main/java/gregtech/api/recipe/maps/FuelBackend.java index 49c989e174..e5f0ab40d1 100644 --- a/src/main/java/gregtech/api/recipe/maps/FuelBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/FuelBackend.java @@ -12,23 +12,23 @@ import net.minecraftforge.fluids.FluidStack; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault public class FuelBackend extends RecipeMapBackend { - private final Map<String, GT_Recipe> recipesByFluidInput = new HashMap<>(); + private final Map<String, GTRecipe> recipesByFluidInput = new HashMap<>(); public FuelBackend(RecipeMapBackendPropertiesBuilder propertiesBuilder) { super(propertiesBuilder.disableOptimize()); } @Override - protected Collection<GT_Recipe> doAdd(GT_RecipeBuilder builder) { + protected Collection<GTRecipe> doAdd(GTRecipeBuilder builder) { if (builder.getDuration() == -1) { builder.duration(0); } @@ -39,11 +39,11 @@ public class FuelBackend extends RecipeMapBackend { } @Override - public GT_Recipe compileRecipe(GT_Recipe recipe) { + public GTRecipe compileRecipe(GTRecipe recipe) { super.compileRecipe(recipe); - if (recipe.mInputs != null && GT_Utility.getNonnullElementCount(recipe.mInputs) == 1 - && (recipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(recipe.mFluidInputs) == 0)) { - FluidStack fluidStack = GT_Utility.getFluidForFilledItem(recipe.mInputs[0], true); + if (recipe.mInputs != null && GTUtility.getNonnullElementCount(recipe.mInputs) == 1 + && (recipe.mFluidInputs == null || GTUtility.getNonnullElementCount(recipe.mFluidInputs) == 0)) { + FluidStack fluidStack = GTUtility.getFluidForFilledItem(recipe.mInputs[0], true); if (fluidStack != null) { fluidStack.amount = 0; recipesByFluidInput.put( @@ -51,9 +51,9 @@ public class FuelBackend extends RecipeMapBackend { .getName(), recipe); } - } else if ((recipe.mInputs == null || GT_Utility.getNonnullElementCount(recipe.mInputs) == 0) + } else if ((recipe.mInputs == null || GTUtility.getNonnullElementCount(recipe.mInputs) == 0) && recipe.mFluidInputs != null - && GT_Utility.getNonnullElementCount(recipe.mFluidInputs) >= 1 + && GTUtility.getNonnullElementCount(recipe.mFluidInputs) >= 1 && recipe.mFluidInputs[0] != null) { recipesByFluidInput.put( recipe.mFluidInputs[0].getFluid() @@ -64,12 +64,12 @@ public class FuelBackend extends RecipeMapBackend { } @Nullable - public GT_Recipe findFuel(FluidStack fluidStack) { + public GTRecipe findFuel(FluidStack fluidStack) { return findFuel(fluidStack.getFluid()); } @Nullable - public GT_Recipe findFuel(Fluid fluid) { + public GTRecipe findFuel(Fluid fluid) { return recipesByFluidInput.get(fluid.getName()); } } diff --git a/src/main/java/gregtech/api/recipe/maps/FurnaceBackend.java b/src/main/java/gregtech/api/recipe/maps/FurnaceBackend.java index c4095eeb4e..e501db3c40 100644 --- a/src/main/java/gregtech/api/recipe/maps/FurnaceBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/FurnaceBackend.java @@ -6,11 +6,11 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -25,18 +25,18 @@ public class FurnaceBackend extends NonGTBackend { } @Override - protected GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe) { + protected GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe) { if (items.length == 0 || items[0] == null) { return null; } if (cachedRecipe != null && cachedRecipe.isRecipeInputEqual(false, true, fluids, items)) { return cachedRecipe; } - ItemStack output = GT_ModHandler.getSmeltingOutput(items[0], false, null); + ItemStack output = GTModHandler.getSmeltingOutput(items[0], false, null); return output == null ? null - : GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) + : GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) .itemOutputs(output) .duration(128) .eut(4) @@ -47,6 +47,6 @@ public class FurnaceBackend extends NonGTBackend { @Override public boolean containsInput(ItemStack item) { - return GT_ModHandler.getSmeltingOutput(item, false, null) != null; + return GTModHandler.getSmeltingOutput(item, false, null) != null; } } diff --git a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java index b38b66e41b..a27e425efb 100644 --- a/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/LargeBoilerFuelBackend.java @@ -9,11 +9,11 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; @SuppressWarnings({ "unused", "UnusedReturnValue" }) @@ -46,11 +46,11 @@ public class LargeBoilerFuelBackend extends RecipeMapBackend { return ALLOWED_SOLID_FUELS.add(itemregistryName + ":" + meta); } - public GT_Recipe addDenseLiquidRecipe(GT_Recipe recipe) { + public GTRecipe addDenseLiquidRecipe(GTRecipe recipe) { return addRecipe(recipe, ((double) recipe.mSpecialValue) / 10, false); } - public GT_Recipe addDieselRecipe(GT_Recipe recipe) { + public GTRecipe addDieselRecipe(GTRecipe recipe) { return addRecipe(recipe, ((double) recipe.mSpecialValue) / 40, false); } @@ -61,12 +61,12 @@ public class LargeBoilerFuelBackend extends RecipeMapBackend { } @Nullable - public GT_Recipe addSolidRecipe(@Nullable ItemStack fuelItemStack) { + public GTRecipe addSolidRecipe(@Nullable ItemStack fuelItemStack) { if (fuelItemStack == null) { return null; } if (!addedGeneralDesc) { - GT_Values.RA.stdBuilder() + GTValues.RA.stdBuilder() .duration(1) .eut(1) .specialValue(1) @@ -82,17 +82,17 @@ public class LargeBoilerFuelBackend extends RecipeMapBackend { String registryName = Item.itemRegistry.getNameForObject(fuelItemStack.getItem()); boolean isHighTierAllowed = ALLOWED_SOLID_FUELS.contains(registryName + ":" + fuelItemStack.getItemDamage()); - return GT_Values.RA.stdBuilder() + return GTValues.RA.stdBuilder() .itemInputs(fuelItemStack) .duration(1) .eut(0) - .specialValue(GT_ModHandler.getFuelValue(fuelItemStack) / 1600) + .specialValue(GTModHandler.getFuelValue(fuelItemStack) / 1600) .build() - .map(r -> addRecipe(r, ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600, isHighTierAllowed)) + .map(r -> addRecipe(r, ((double) GTModHandler.getFuelValue(fuelItemStack)) / 1600, isHighTierAllowed)) .orElse(null); } - private GT_Recipe addRecipe(GT_Recipe recipe, double baseBurnTime, boolean isHighTierAllowed) { + private GTRecipe addRecipe(GTRecipe recipe, double baseBurnTime, boolean isHighTierAllowed) { // Some recipes will have a burn time like 15.9999999 and % always rounds down double floatErrorCorrection = 0.0001; diff --git a/src/main/java/gregtech/api/recipe/maps/MicrowaveBackend.java b/src/main/java/gregtech/api/recipe/maps/MicrowaveBackend.java index 53623cb0c7..ae4b5f5d35 100644 --- a/src/main/java/gregtech/api/recipe/maps/MicrowaveBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/MicrowaveBackend.java @@ -1,8 +1,8 @@ package gregtech.api.recipe.maps; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.util.GT_RecipeConstants.EXPLODE; -import static gregtech.api.util.GT_RecipeConstants.ON_FIRE; +import static gregtech.api.enums.GTValues.W; +import static gregtech.api.util.GTRecipeConstants.EXPLODE; +import static gregtech.api.util.GTRecipeConstants.ON_FIRE; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -13,18 +13,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.SubTag; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTLog; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTOreDictUnificator; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -39,8 +39,8 @@ public class MicrowaveBackend extends NonGTBackend { } @Override - protected GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe) { + protected GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe) { if (items.length == 0 || items[0] == null) { return null; } @@ -48,12 +48,12 @@ public class MicrowaveBackend extends NonGTBackend { return cachedRecipe; } - ItemStack output = GT_ModHandler.getSmeltingOutput(items[0], false, null); + ItemStack output = GTModHandler.getSmeltingOutput(items[0], false, null); - if (GT_Utility.areStacksEqual(items[0], new ItemStack(Items.book, 1, W))) { - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) - .itemOutputs(GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))) + if (GTUtility.areStacksEqual(items[0], new ItemStack(Items.book, 1, W))) { + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) + .itemOutputs(GTUtility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))) .duration(32) .eut(4) .noOptimize() @@ -63,37 +63,36 @@ public class MicrowaveBackend extends NonGTBackend { // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of // Output and last check the Output itself - for (ItemStack item : new ItemStack[] { GT_Utility.getContainerItem(items[0], true), items[0], - GT_Utility.getContainerItem(output, true), output }) { + for (ItemStack item : new ItemStack[] { GTUtility.getContainerItem(items[0], true), items[0], + GTUtility.getContainerItem(output, true), output }) { if (item == null) continue; - if (GT_Utility.areStacksEqual(item, new ItemStack(Blocks.netherrack, 1, W), true) - || GT_Utility.areStacksEqual(item, new ItemStack(Blocks.tnt, 1, W), true) - || GT_Utility.areStacksEqual(item, new ItemStack(Items.egg, 1, W), true) - || GT_Utility.areStacksEqual(item, new ItemStack(Items.firework_charge, 1, W), true) - || GT_Utility.areStacksEqual(item, new ItemStack(Items.fireworks, 1, W), true) - || GT_Utility.areStacksEqual(item, new ItemStack(Items.fire_charge, 1, W), true)) { - GT_Log.exp - .println("Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); - return GT_RecipeBuilder.empty() + if (GTUtility.areStacksEqual(item, new ItemStack(Blocks.netherrack, 1, W), true) + || GTUtility.areStacksEqual(item, new ItemStack(Blocks.tnt, 1, W), true) + || GTUtility.areStacksEqual(item, new ItemStack(Items.egg, 1, W), true) + || GTUtility.areStacksEqual(item, new ItemStack(Items.firework_charge, 1, W), true) + || GTUtility.areStacksEqual(item, new ItemStack(Items.fireworks, 1, W), true) + || GTUtility.areStacksEqual(item, new ItemStack(Items.fire_charge, 1, W), true)) { + GTLog.exp.println("Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); + return GTRecipeBuilder.empty() .metadata(EXPLODE, true) .build() .orElse(null); } - ItemData itemData = GT_OreDictUnificator.getItemData(item); + ItemData itemData = GTOreDictUnificator.getItemData(item); if (itemData != null) { if (itemData.mMaterial != null && itemData.mMaterial.mMaterial != null) { if (itemData.mMaterial.mMaterial.contains(SubTag.METAL) || itemData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { - GT_Log.exp.println("Microwave Explosion due to METAL insertion"); - return GT_RecipeBuilder.empty() + GTLog.exp.println("Microwave Explosion due to METAL insertion"); + return GTRecipeBuilder.empty() .metadata(EXPLODE, true) .build() .orElse(null); } if (itemData.mMaterial.mMaterial.contains(SubTag.FLAMMABLE)) { - GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion"); - return GT_RecipeBuilder.empty() + GTLog.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion"); + return GTRecipeBuilder.empty() .metadata(ON_FIRE, true) .build() .orElse(null); @@ -103,15 +102,15 @@ public class MicrowaveBackend extends NonGTBackend { if (materialStack == null) continue; if (materialStack.mMaterial.contains(SubTag.METAL) || materialStack.mMaterial.contains(SubTag.EXPLOSIVE)) { - GT_Log.exp.println("Microwave Explosion due to METAL insertion"); - return GT_RecipeBuilder.empty() + GTLog.exp.println("Microwave Explosion due to METAL insertion"); + return GTRecipeBuilder.empty() .metadata(EXPLODE, true) .build() .orElse(null); } if (materialStack.mMaterial.contains(SubTag.FLAMMABLE)) { - GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion"); - return GT_RecipeBuilder.empty() + GTLog.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion"); + return GTRecipeBuilder.empty() .metadata(ON_FIRE, true) .build() .orElse(null); @@ -119,8 +118,8 @@ public class MicrowaveBackend extends NonGTBackend { } } if (TileEntityFurnace.getItemBurnTime(item) > 0) { - GT_Log.exp.println("Microwave INFLAMMATION due to BURNABLE insertion"); - return GT_RecipeBuilder.empty() + GTLog.exp.println("Microwave INFLAMMATION due to BURNABLE insertion"); + return GTRecipeBuilder.empty() .metadata(ON_FIRE, true) .build() .orElse(null); @@ -128,8 +127,8 @@ public class MicrowaveBackend extends NonGTBackend { } return output == null ? null - : GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) + : GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) .itemOutputs(output) .duration(32) .eut(4) @@ -140,6 +139,6 @@ public class MicrowaveBackend extends NonGTBackend { @Override public boolean containsInput(ItemStack item) { - return GT_ModHandler.getSmeltingOutput(item, false, null) != null; + return GTModHandler.getSmeltingOutput(item, false, null) != null; } } diff --git a/src/main/java/gregtech/api/recipe/maps/NonGTBackend.java b/src/main/java/gregtech/api/recipe/maps/NonGTBackend.java index 1e871df372..3a66a1c980 100644 --- a/src/main/java/gregtech/api/recipe/maps/NonGTBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/NonGTBackend.java @@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -24,8 +24,8 @@ public abstract class NonGTBackend extends RecipeMapBackend { } @Override - protected abstract GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, - @Nullable ItemStack specialSlot, @Nullable GT_Recipe cachedRecipe); + protected abstract GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, + @Nullable ItemStack specialSlot, @Nullable GTRecipe cachedRecipe); @Override protected boolean doesOverwriteFindRecipe() { @@ -46,7 +46,7 @@ public abstract class NonGTBackend extends RecipeMapBackend { public void reInit() {} @Override - protected GT_Recipe addToItemMap(GT_Recipe recipe) { + protected GTRecipe addToItemMap(GTRecipe recipe) { return recipe; } } diff --git a/src/main/java/gregtech/api/recipe/maps/OilCrackerBackend.java b/src/main/java/gregtech/api/recipe/maps/OilCrackerBackend.java index c2c312a48a..6417334d34 100644 --- a/src/main/java/gregtech/api/recipe/maps/OilCrackerBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/OilCrackerBackend.java @@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @@ -23,7 +23,7 @@ public class OilCrackerBackend extends RecipeMapBackend { } @Override - public GT_Recipe compileRecipe(GT_Recipe recipe) { + public GTRecipe compileRecipe(GTRecipe recipe) { super.compileRecipe(recipe); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 1 && recipe.mFluidInputs[1] != null) { validCatalystFluidNames.add( diff --git a/src/main/java/gregtech/api/recipe/maps/PrinterBackend.java b/src/main/java/gregtech/api/recipe/maps/PrinterBackend.java index a933886447..788828df52 100644 --- a/src/main/java/gregtech/api/recipe/maps/PrinterBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/PrinterBackend.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.maps; -import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GTValues.L; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -12,13 +12,13 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -33,14 +33,14 @@ public class PrinterBackend extends RecipeMapBackend { } @Override - protected GT_Recipe modifyFoundRecipe(GT_Recipe recipe, ItemStack[] items, FluidStack[] fluids, + protected GTRecipe modifyFoundRecipe(GTRecipe recipe, ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { if (items[0].getItem() == Items.paper) { assert specialSlot != null; if (!ItemList.Tool_DataStick.isStackEqual(specialSlot, false, true)) return null; NBTTagCompound nbt = specialSlot.getTagCompound(); - if (nbt == null || GT_Utility.isStringInvalid(nbt.getString("title")) - || GT_Utility.isStringInvalid(nbt.getString("author"))) return null; + if (nbt == null || GTUtility.isStringInvalid(nbt.getString("title")) + || GTUtility.isStringInvalid(nbt.getString("author"))) return null; recipe = recipe.copy(); recipe.mCanBeBuffered = false; @@ -67,7 +67,7 @@ public class PrinterBackend extends RecipeMapBackend { recipe = recipe.copy(); recipe.mCanBeBuffered = false; recipe.mOutputs[0].setTagCompound( - GT_Utility.getNBTContainingString( + GTUtility.getNBTContainingString( new NBTTagCompound(), "GT.PunchCardData", nbt.getString("GT.PunchCardData"))); @@ -77,7 +77,7 @@ public class PrinterBackend extends RecipeMapBackend { } @Override - protected GT_Recipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { + protected GTRecipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { if (items.length == 0 || items[0] == null || fluids.length == 0 || fluids[0] == null) { return null; } @@ -88,7 +88,7 @@ public class PrinterBackend extends RecipeMapBackend { } if (dye == null) return null; - ItemStack batchRecolorOutput = GT_ModHandler.getAllRecipeOutput( + ItemStack batchRecolorOutput = GTModHandler.getAllRecipeOutput( null, items[0], items[0], @@ -100,8 +100,8 @@ public class PrinterBackend extends RecipeMapBackend { items[0], items[0]); if (batchRecolorOutput != null) { - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(8, items[0])) + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(8, items[0])) .itemOutputs(batchRecolorOutput) .fluidInputs(new FluidStack(fluids[0].getFluid(), (int) L)) .duration(256) @@ -112,11 +112,11 @@ public class PrinterBackend extends RecipeMapBackend { .orElse(null); } - ItemStack singleRecolorOutput = GT_ModHandler + ItemStack singleRecolorOutput = GTModHandler .getAllRecipeOutput(null, items[0], ItemList.DYE_ONLY_ITEMS[dye.mIndex].get(1)); if (singleRecolorOutput != null) { - return GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])) + return GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])) .itemOutputs(singleRecolorOutput) .fluidInputs(new FluidStack(fluids[0].getFluid(), (int) L)) .duration(32) diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitClarifierFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitClarifierFrontend.java index c7dad7ea3a..e681c95403 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitClarifierFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitClarifierFrontend.java @@ -11,13 +11,13 @@ import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.PositionedStack; import gregtech.api.enums.ItemList; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.common.gui.modularui.UIHelper; -import gregtech.common.tileentities.machines.multi.purification.GT_MetaTileEntity_PurificationUnitClarifier; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.common.tileentities.machines.multi.purification.MTEPurificationUnitClarifier; +import gregtech.nei.GTNEIDefaultHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @@ -28,7 +28,7 @@ public class PurificationUnitClarifierFrontend extends PurificationUnitRecipeMap super( 80, uiPropertiesBuilder.logoPos(new Pos2d(160, 100)) - .progressBarTexture(new FallbackableUITexture(GT_UITextures.PROGRESSBAR_CLARIFIER)) + .progressBarTexture(new FallbackableUITexture(GTUITextures.PROGRESSBAR_CLARIFIER)) .logoPos(new Pos2d(152, 90)), neiPropertiesBuilder.recipeBackgroundSize(new Size(170, 120))); } @@ -60,12 +60,12 @@ public class PurificationUnitClarifierFrontend extends PurificationUnitRecipeMap } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { super.drawNEIOverlays(neiCachedRecipe); for (PositionedStack stack : neiCachedRecipe.mInputs) { if (stack.item.isItemEqual(ItemList.ActivatedCarbonFilterMesh.get(1))) { - drawNEIOverlayText((int) (GT_MetaTileEntity_PurificationUnitClarifier.FILTER_DAMAGE_RATE) + "%", stack); + drawNEIOverlayText((int) (MTEPurificationUnitClarifier.FILTER_DAMAGE_RATE) + "%", stack); } } } diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitFlocculatorFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitFlocculatorFrontend.java index 9366237b67..d0373d4310 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitFlocculatorFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitFlocculatorFrontend.java @@ -15,14 +15,14 @@ import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.PositionedStack; import gregtech.api.enums.Materials; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.common.gui.modularui.UIHelper; -import gregtech.common.tileentities.machines.multi.purification.GT_MetaTileEntity_PurificationUnitFlocculation; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.common.tileentities.machines.multi.purification.MTEPurificationUnitFlocculation; +import gregtech.nei.GTNEIDefaultHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @@ -33,7 +33,7 @@ public class PurificationUnitFlocculatorFrontend extends PurificationUnitRecipeM super( 80, uiPropertiesBuilder.logoPos(new Pos2d(160, 100)) - .progressBarTexture(new FallbackableUITexture(GT_UITextures.PROGRESSBAR_FLOCCULATION)) + .progressBarTexture(new FallbackableUITexture(GTUITextures.PROGRESSBAR_FLOCCULATION)) .logoPos(new Pos2d(152, 100)), neiPropertiesBuilder.recipeBackgroundSize(new Size(170, 120))); } @@ -60,30 +60,29 @@ public class PurificationUnitFlocculatorFrontend extends PurificationUnitRecipeM @Override @NotNull public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip, - GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { - if (stack - .isItemEqual(GT_Utility.getFluidDisplayStack(Materials.PolyAluminiumChloride.getFluid(1000L), false))) { + GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + if (stack.isItemEqual(GTUtility.getFluidDisplayStack(Materials.PolyAluminiumChloride.getFluid(1000L), false))) { currentTip.add("Consumed during operation"); currentTip.add( - "+" + GT_MetaTileEntity_PurificationUnitFlocculation.SUCCESS_PER_LEVEL + "+" + MTEPurificationUnitFlocculation.SUCCESS_PER_LEVEL + "%/" - + GT_MetaTileEntity_PurificationUnitFlocculation.INPUT_CHEMICAL_PER_LEVEL + + MTEPurificationUnitFlocculation.INPUT_CHEMICAL_PER_LEVEL + "L"); } else if (stack - .isItemEqual(GT_Utility.getFluidDisplayStack(Materials.FlocculationWasteLiquid.getFluid(1000L), false))) { + .isItemEqual(GTUtility.getFluidDisplayStack(Materials.FlocculationWasteLiquid.getFluid(1000L), false))) { currentTip.add("Returned in amount equivalent to consumed flocculant."); } return super.handleNEIItemTooltip(stack, currentTip, neiCachedRecipe); } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { super.drawNEIOverlays(neiCachedRecipe); // Display flocculation chemical neiCachedRecipe.mInputs.add( new PositionedStack( - GT_Utility.getFluidDisplayStack(Materials.PolyAluminiumChloride.getFluid(100000L), true), + GTUtility.getFluidDisplayStack(Materials.PolyAluminiumChloride.getFluid(100000L), true), 5, -1, false)); @@ -91,7 +90,7 @@ public class PurificationUnitFlocculatorFrontend extends PurificationUnitRecipeM // Display waste output neiCachedRecipe.mOutputs.add( new PositionedStack( - GT_Utility.getFluidDisplayStack(Materials.FlocculationWasteLiquid.getFluid(100000L), true), + GTUtility.getFluidDisplayStack(Materials.FlocculationWasteLiquid.getFluid(100000L), true), 147, 48, false)); diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java index df42259864..9c90acd8ad 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java @@ -11,8 +11,8 @@ import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; import gregtech.common.gui.modularui.UIHelper; -import gregtech.common.tileentities.machines.multi.purification.GT_MetaTileEntity_PurificationUnitUVTreatment; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.common.tileentities.machines.multi.purification.MTEPurificationUnitUVTreatment; +import gregtech.nei.GTNEIDefaultHandler; public class PurificationUnitLaserFrontend extends RecipeMapFrontend { @@ -22,13 +22,13 @@ public class PurificationUnitLaserFrontend extends RecipeMapFrontend { } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { - final int numLenses = GT_MetaTileEntity_PurificationUnitUVTreatment.LENS_ITEMS.size(); + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + final int numLenses = MTEPurificationUnitUVTreatment.LENS_ITEMS.size(); List<Pos2d> positions = UIHelper.getGridPositions(numLenses, 12, -4, 3, 3); // Put in lens items for (int i = 0; i < numLenses; ++i) { Pos2d position = positions.get(i); - ItemStack lens = GT_MetaTileEntity_PurificationUnitUVTreatment.LENS_ITEMS.get(i); + ItemStack lens = MTEPurificationUnitUVTreatment.LENS_ITEMS.get(i); neiCachedRecipe.mInputs.add(new PositionedStack(lens, position.x, position.y, false)); } super.drawNEIOverlays(neiCachedRecipe); diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitOzonationFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitOzonationFrontend.java index cdfd41b78c..e9c1277cb3 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitOzonationFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitOzonationFrontend.java @@ -9,7 +9,7 @@ import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.util.MethodsReturnNonnullByDefault; @@ -24,7 +24,7 @@ public class PurificationUnitOzonationFrontend extends PurificationUnitRecipeMap super( 120, uiPropertiesBuilder.logoPos(new Pos2d(160, 100)) - .progressBarTexture(new FallbackableUITexture(GT_UITextures.PROGRESSBAR_OZONATION)) + .progressBarTexture(new FallbackableUITexture(GTUITextures.PROGRESSBAR_OZONATION)) .logoPos(new Pos2d(152, 97)), neiPropertiesBuilder.recipeBackgroundSize(new Size(170, 180))); } diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java index bbbd88fd5f..d738ce0750 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java @@ -12,7 +12,7 @@ import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; import gregtech.common.gui.modularui.UIHelper; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.GTNEIDefaultHandler; public class PurificationUnitParticleExtractorFrontend extends RecipeMapFrontend { @@ -25,7 +25,7 @@ public class PurificationUnitParticleExtractorFrontend extends RecipeMapFrontend } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { List<Pos2d> positions = UIHelper.getGridPositions(2, 30, 14, 2, 1); Pos2d pos1 = positions.get(0); Pos2d pos2 = positions.get(1); diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitPhAdjustmentFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitPhAdjustmentFrontend.java index 7e9eded675..e78d2a395a 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitPhAdjustmentFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitPhAdjustmentFrontend.java @@ -15,13 +15,13 @@ import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.PositionedStack; import gregtech.api.enums.Materials; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; -import gregtech.common.tileentities.machines.multi.purification.GT_MetaTileEntity_PurificationUnitPhAdjustment; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.common.tileentities.machines.multi.purification.MTEPurificationUnitPhAdjustment; +import gregtech.nei.GTNEIDefaultHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @@ -32,7 +32,7 @@ public class PurificationUnitPhAdjustmentFrontend extends PurificationUnitRecipe super( 80, uiPropertiesBuilder.logoPos(new Pos2d(160, 100)) - .progressBarTexture(new FallbackableUITexture(GT_UITextures.PROGRESSBAR_PH_NEUTRALIZATION)) + .progressBarTexture(new FallbackableUITexture(GTUITextures.PROGRESSBAR_PH_NEUTRALIZATION)) .logoPos(new Pos2d(152, 90)), neiPropertiesBuilder.recipeBackgroundSize(new Size(170, 120))); } @@ -54,24 +54,23 @@ public class PurificationUnitPhAdjustmentFrontend extends PurificationUnitRecipe @Override @NotNull public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip, - GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { // Add pH adjustment values if (stack.isItemEqual(Materials.SodiumHydroxide.getDust(1))) { - currentTip - .add("+" + GT_MetaTileEntity_PurificationUnitPhAdjustment.PH_PER_ALKALINE_DUST * 64 + " pH/stack"); + currentTip.add("+" + MTEPurificationUnitPhAdjustment.PH_PER_ALKALINE_DUST * 64 + " pH/stack"); } else - if (stack.isItemEqual(GT_Utility.getFluidDisplayStack(Materials.HydrochloricAcid.getFluid(1000L), false))) { - currentTip.add(GT_MetaTileEntity_PurificationUnitPhAdjustment.PH_PER_10_ACID_LITER * 100 + " pH/1000L"); + if (stack.isItemEqual(GTUtility.getFluidDisplayStack(Materials.HydrochloricAcid.getFluid(1000L), false))) { + currentTip.add(MTEPurificationUnitPhAdjustment.PH_PER_10_ACID_LITER * 100 + " pH/1000L"); } return super.handleNEIItemTooltip(stack, currentTip, neiCachedRecipe); } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { neiCachedRecipe.mInputs.add(new PositionedStack(Materials.SodiumHydroxide.getDust(64), 3, 1, false)); neiCachedRecipe.mInputs.add( new PositionedStack( - GT_Utility.getFluidDisplayStack(Materials.HydrochloricAcid.getFluid(1000L), true), + GTUtility.getFluidDisplayStack(Materials.HydrochloricAcid.getFluid(1000L), true), 147, 1, false)); diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitPlasmaHeaterFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitPlasmaHeaterFrontend.java index 5c63353b98..a7f35c86a5 100644 --- a/src/main/java/gregtech/api/recipe/maps/PurificationUnitPlasmaHeaterFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitPlasmaHeaterFrontend.java @@ -11,12 +11,12 @@ import com.gtnewhorizons.modularui.api.math.Size; import codechicken.nei.PositionedStack; import gregtech.api.enums.Materials; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.GTNEIDefaultHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @@ -27,7 +27,7 @@ public class PurificationUnitPlasmaHeaterFrontend extends PurificationUnitRecipe super( 120, uiPropertiesBuilder.logoPos(new Pos2d(152, 90)) - .progressBarTexture(new FallbackableUITexture(GT_UITextures.PROGRESSBAR_PLASMA_HEATER)), + .progressBarTexture(new FallbackableUITexture(GTUITextures.PROGRESSBAR_PLASMA_HEATER)), neiPropertiesBuilder.recipeBackgroundSize(new Size(170, 120))); } @@ -46,12 +46,12 @@ public class PurificationUnitPlasmaHeaterFrontend extends PurificationUnitRecipe } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { neiCachedRecipe.mInputs.add( - new PositionedStack(GT_Utility.getFluidDisplayStack(Materials.Helium.getPlasma(10L), true), 26, 53, false)); + new PositionedStack(GTUtility.getFluidDisplayStack(Materials.Helium.getPlasma(10L), true), 26, 53, false)); neiCachedRecipe.mInputs.add( new PositionedStack( - GT_Utility.getFluidDisplayStack(Materials.SuperCoolant.getFluid(100L), true), + GTUtility.getFluidDisplayStack(Materials.SuperCoolant.getFluid(100L), true), 107, 52, false)); diff --git a/src/main/java/gregtech/api/recipe/maps/RecyclerBackend.java b/src/main/java/gregtech/api/recipe/maps/RecyclerBackend.java index 55fb9b4cc4..c149be4219 100644 --- a/src/main/java/gregtech/api/recipe/maps/RecyclerBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/RecyclerBackend.java @@ -6,12 +6,12 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; /** @@ -26,17 +26,17 @@ public class RecyclerBackend extends NonGTBackend { } @Override - protected GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe) { + protected GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe) { if (items.length == 0 || items[0] == null) { return null; } if (cachedRecipe != null && cachedRecipe.isRecipeInputEqual(false, true, fluids, items)) { return cachedRecipe; } - GT_RecipeBuilder builder = GT_Values.RA.stdBuilder() - .itemInputs(GT_Utility.copyAmount(1, items[0])); - ItemStack output = GT_ModHandler.getRecyclerOutput(items[0], 0); + GTRecipeBuilder builder = GTValues.RA.stdBuilder() + .itemInputs(GTUtility.copyAmount(1, items[0])); + ItemStack output = GTModHandler.getRecyclerOutput(items[0], 0); if (output != null) { builder.itemOutputs(output) .outputChances(1250); @@ -50,6 +50,6 @@ public class RecyclerBackend extends NonGTBackend { @Override public boolean containsInput(ItemStack item) { - return GT_ModHandler.getRecyclerOutput(item, 0) != null; + return GTModHandler.getRecyclerOutput(item, 0) != null; } } diff --git a/src/main/java/gregtech/api/recipe/maps/ReplicatorBackend.java b/src/main/java/gregtech/api/recipe/maps/ReplicatorBackend.java index f201698457..b40b3dd082 100644 --- a/src/main/java/gregtech/api/recipe/maps/ReplicatorBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/ReplicatorBackend.java @@ -12,34 +12,34 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.enums.Element; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.TierEU; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_RecipeBuilder; -import gregtech.api.util.GT_RecipeConstants; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTRecipeBuilder; +import gregtech.api.util.GTRecipeConstants; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; -import gregtech.common.items.behaviors.Behaviour_DataOrb; +import gregtech.common.items.behaviors.BehaviourDataOrb; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault public class ReplicatorBackend extends RecipeMapBackend { - private final Map<Materials, GT_Recipe> recipesByMaterial = new HashMap<>(); + private final Map<Materials, GTRecipe> recipesByMaterial = new HashMap<>(); public ReplicatorBackend(RecipeMapBackendPropertiesBuilder propertiesBuilder) { super(propertiesBuilder.recipeEmitter(ReplicatorBackend::replicatorRecipeEmitter)); } @Override - public GT_Recipe compileRecipe(GT_Recipe recipe) { + public GTRecipe compileRecipe(GTRecipe recipe) { super.compileRecipe(recipe); - Materials material = recipe.getMetadata(GT_RecipeConstants.MATERIAL); + Materials material = recipe.getMetadata(GTRecipeConstants.MATERIAL); assert material != null; // checked by replicatorRecipeEmitter recipesByMaterial.put(material, recipe); return recipe; @@ -51,8 +51,8 @@ public class ReplicatorBackend extends RecipeMapBackend { } @Override - protected GT_Recipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, - @Nullable GT_Recipe cachedRecipe) { + protected GTRecipe overwriteFindRecipe(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot, + @Nullable GTRecipe cachedRecipe) { if (specialSlot == null) { return null; } @@ -65,19 +65,19 @@ public class ReplicatorBackend extends RecipeMapBackend { @Nullable private static Materials getMaterialFromDataOrb(ItemStack stack) { - if (ItemList.Tool_DataOrb.isStackEqual(stack, false, true) && Behaviour_DataOrb.getDataTitle(stack) + if (ItemList.Tool_DataOrb.isStackEqual(stack, false, true) && BehaviourDataOrb.getDataTitle(stack) .equals("Elemental-Scan")) { - return Element.get(Behaviour_DataOrb.getDataName(stack)).mLinkedMaterials.stream() + return Element.get(BehaviourDataOrb.getDataName(stack)).mLinkedMaterials.stream() .findFirst() .orElse(null); } return null; } - private static Collection<GT_Recipe> replicatorRecipeEmitter(GT_RecipeBuilder builder) { - Materials material = builder.getMetadata(GT_RecipeConstants.MATERIAL); + private static Collection<GTRecipe> replicatorRecipeEmitter(GTRecipeBuilder builder) { + Materials material = builder.getMetadata(GTRecipeConstants.MATERIAL); if (material == null) { - throw new IllegalStateException("GT_RecipeConstants.MATERIAL must be set for replicator recipe"); + throw new IllegalStateException("GTRecipeConstants.MATERIAL must be set for replicator recipe"); } return Optional.of(material) .map(material1 -> material1.mElement) @@ -85,7 +85,7 @@ public class ReplicatorBackend extends RecipeMapBackend { .map(ReplicatorBackend::getUUMAmountFromMass) .flatMap( uum -> builder.fluidInputs(Materials.UUMatter.getFluid(uum)) - .duration(GT_Utility.safeInt(uum * 512L, 1)) + .duration(GTUtility.safeInt(uum * 512L, 1)) .eut(TierEU.RECIPE_LV) .ignoreCollision() .noOptimize() @@ -95,6 +95,6 @@ public class ReplicatorBackend extends RecipeMapBackend { } private static int getUUMAmountFromMass(long mass) { - return GT_Utility.safeInt((long) Math.pow(mass, GT_Mod.gregtechproxy.replicatorExponent), 1); + return GTUtility.safeInt((long) Math.pow(mass, GTMod.gregtechproxy.replicatorExponent), 1); } } diff --git a/src/main/java/gregtech/api/recipe/maps/SpaceProjectFrontend.java b/src/main/java/gregtech/api/recipe/maps/SpaceProjectFrontend.java index 98463dcc4d..70c9605e1b 100644 --- a/src/main/java/gregtech/api/recipe/maps/SpaceProjectFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/SpaceProjectFrontend.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.maps; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import static net.minecraft.util.EnumChatFormatting.GRAY; import static net.minecraft.util.StatCollector.translateToLocal; @@ -22,7 +22,7 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import appeng.util.ReadableNumberConverter; import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; -import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; @@ -31,7 +31,7 @@ import gregtech.common.gui.modularui.UIHelper; import gregtech.common.misc.spaceprojects.SpaceProjectManager; import gregtech.common.misc.spaceprojects.SpaceProjectManager.FakeSpaceProjectRecipe; import gregtech.common.misc.spaceprojects.interfaces.ISpaceProject; -import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.GTNEIDefaultHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @@ -76,7 +76,7 @@ public class SpaceProjectFrontend extends RecipeMapFrontend { @Override protected List<String> handleNEIItemInputTooltip(List<String> currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GTNEIDefaultHandler.FixedPositionedStack pStack) { super.handleNEIItemOutputTooltip(currentTip, pStack); if (pStack.isFluid()) return currentTip; currentTip.add(GRAY + translateToLocal("Item Count: ") + formatNumbers(pStack.realStackSize)); @@ -84,11 +84,11 @@ public class SpaceProjectFrontend extends RecipeMapFrontend { } @Override - public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + public void drawNEIOverlays(GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack stack : neiCachedRecipe.mInputs) { - if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack pStack && stack.item != null + if (stack instanceof GTNEIDefaultHandler.FixedPositionedStack pStack && stack.item != null && !pStack.isFluid()) { - int stackSize = ((GT_NEI_DefaultHandler.FixedPositionedStack) stack).realStackSize; + int stackSize = ((GTNEIDefaultHandler.FixedPositionedStack) stack).realStackSize; String displayString; if (stack.item.stackSize > 9999) { displayString = ReadableNumberConverter.INSTANCE.toWideReadableForm(stackSize); @@ -114,14 +114,14 @@ public class SpaceProjectFrontend extends RecipeMapFrontend { int bar2Width = 18; List<Supplier<Float>> splitProgress = splitProgress(progressSupplier, bar1Width, bar2Width); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) + new ProgressBar().setTexture(GTUITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) .setDirection(ProgressBar.Direction.RIGHT) .setProgress(splitProgress.get(0)) .setSynced(false, false) .setPos(new Pos2d(70, 28).add(windowOffset)) .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) + new ProgressBar().setTexture(GTUITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) .setDirection(ProgressBar.Direction.RIGHT) .setProgress(splitProgress.get(1)) .setSynced(false, false) diff --git a/src/main/java/gregtech/api/recipe/maps/TranscendentPlasmaMixerFrontend.java b/src/main/java/gregtech/api/recipe/maps/TranscendentPlasmaMixerFrontend.java index 7a5d7ff164..7a4036e7ba 100644 --- a/src/main/java/gregtech/api/recipe/maps/TranscendentPlasmaMixerFrontend.java +++ b/src/main/java/gregtech/api/recipe/maps/TranscendentPlasmaMixerFrontend.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.maps; -import static gregtech.api.util.GT_Utility.formatNumbers; +import static gregtech.api.util.GTUtility.formatNumbers; import java.util.List; @@ -11,7 +11,7 @@ import com.gtnewhorizons.modularui.api.math.Pos2d; import gregtech.api.recipe.BasicUIPropertiesBuilder; import gregtech.api.recipe.NEIRecipePropertiesBuilder; import gregtech.api.recipe.RecipeMapFrontend; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; import gregtech.api.util.MethodsReturnNonnullByDefault; import gregtech.common.gui.modularui.UIHelper; import gregtech.nei.RecipeDisplayInfo; @@ -45,12 +45,12 @@ public class TranscendentPlasmaMixerFrontend extends RecipeMapFrontend { // These look odd because recipeInfo.recipe.mEUt is actually the EU per litre of fluid processed, not // the EU/t. recipeInfo.drawText( - GT_Utility.trans("152", "Total: ") + GTUtility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mDuration / 100L * recipeInfo.recipe.mEUt) + " EU"); // 1000 / (20 ticks * 5 seconds) = 10L/t. 10L/t * x EU/L = 10 * x EU/t. long averageUsage = 10L * recipeInfo.recipe.mEUt; recipeInfo.drawText( - "Average: " + formatNumbers(averageUsage) + " EU/t" + GT_Utility.getTierNameWithParentheses(averageUsage)); + "Average: " + formatNumbers(averageUsage) + " EU/t" + GTUtility.getTierNameWithParentheses(averageUsage)); } } diff --git a/src/main/java/gregtech/api/recipe/maps/UnpackagerBackend.java b/src/main/java/gregtech/api/recipe/maps/UnpackagerBackend.java index e7297f0609..9ea34609f6 100644 --- a/src/main/java/gregtech/api/recipe/maps/UnpackagerBackend.java +++ b/src/main/java/gregtech/api/recipe/maps/UnpackagerBackend.java @@ -6,12 +6,12 @@ import javax.annotation.ParametersAreNonnullByDefault; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; +import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.recipe.RecipeMapBackend; import gregtech.api.recipe.RecipeMapBackendPropertiesBuilder; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTRecipe; import gregtech.api.util.MethodsReturnNonnullByDefault; @ParametersAreNonnullByDefault @@ -23,16 +23,16 @@ public class UnpackagerBackend extends RecipeMapBackend { } @Override - protected GT_Recipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { + protected GTRecipe findFallback(ItemStack[] items, FluidStack[] fluids, @Nullable ItemStack specialSlot) { if (items.length == 0 || !ItemList.IC2_Scrapbox.isStackEqual(items[0], false, true)) { return null; } - ItemStack output = GT_ModHandler.getRandomScrapboxDrop(); + ItemStack output = GTModHandler.getRandomScrapboxDrop(); if (output == null) { return null; } - return GT_Values.RA.stdBuilder() + return GTValues.RA.stdBuilder() .itemInputs(ItemList.IC2_Scrapbox.get(1)) .itemOutputs(output) .duration(16) diff --git a/src/main/java/gregtech/api/recipe/metadata/CompressionTierKey.java b/src/main/java/gregtech/api/recipe/metadata/CompressionTierKey.java index 384b5ce2d9..88bd3d6664 100644 --- a/src/main/java/gregtech/api/recipe/metadata/CompressionTierKey.java +++ b/src/main/java/gregtech/api/recipe/metadata/CompressionTierKey.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.metadata; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/gregtech/api/recipe/metadata/PCBFactoryTierKey.java b/src/main/java/gregtech/api/recipe/metadata/PCBFactoryTierKey.java index 05db919b57..ada5574b01 100644 --- a/src/main/java/gregtech/api/recipe/metadata/PCBFactoryTierKey.java +++ b/src/main/java/gregtech/api/recipe/metadata/PCBFactoryTierKey.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.metadata; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/gregtech/api/recipe/metadata/PCBFactoryUpgradeKey.java b/src/main/java/gregtech/api/recipe/metadata/PCBFactoryUpgradeKey.java index 8257f1e6ef..4891c88848 100644 --- a/src/main/java/gregtech/api/recipe/metadata/PCBFactoryUpgradeKey.java +++ b/src/main/java/gregtech/api/recipe/metadata/PCBFactoryUpgradeKey.java @@ -1,6 +1,6 @@ package gregtech.api.recipe.metadata; -import static gregtech.api.util.GT_Utility.trans; +import static gregtech.api.util.GTUtility.trans; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/gregtech/api/registries/LHECoolantRegistry.java b/src/main/java/gregtech/api/registries/LHECoolantRegistry.java index 7944132572..084086c841 100644 --- a/src/main/java/gregtech/api/registries/LHECoolantRegistry.java +++ b/src/main/java/gregtech/api/registries/LHECoolantRegistry.java @@ -7,6 +7,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import gregtech.common.tileentities.machines.multi.MTEHeatExchanger; + public class LHECoolantRegistry { private static final Map<String, LHECoolantInfo> lheCoolants = new HashMap<>(); @@ -15,9 +17,9 @@ public class LHECoolantRegistry { * Registers a coolant for use in Large Heat Exchangers and Whakawhiti Weras. * See the constants in {@link #registerBaseCoolants()} as a reference for what the multipliers should be. * The multipliers are used in - * {@link gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_HeatExchanger#checkProcessing()} - * and {@link gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_HeatExchanger#onRunningTick()}. - * + * {@link MTEHeatExchanger#checkProcessing()} + * and {@link MTEHeatExchanger#onRunningTick()}. + * * @param coldFluidName The fluid name of the resulting cold coolant * @param hotFluidName The fluid name of the input hot coolant * @param steamMultiplier The steam multiplier diff --git a/src/main/java/gregtech/api/render/TextureFactory.java b/src/main/java/gregtech/api/render/TextureFactory.java index 26142fd606..a87b20ccb4 100644 --- a/src/main/java/gregtech/api/render/TextureFactory.java +++ b/src/main/java/gregtech/api/render/TextureFactory.java @@ -6,7 +6,7 @@ import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.ITextureBuilder; -import gregtech.common.render.GT_TextureBuilder; +import gregtech.common.render.GTTextureBuilder; /** * <p> @@ -152,6 +152,6 @@ public final class TextureFactory { * @return An instance of the {@link ITextureBuilder} implementation */ public static ITextureBuilder builder() { - return new GT_TextureBuilder(); + return new GTTextureBuilder(); } } diff --git a/src/main/java/gregtech/api/task/tasks/PollutionTask.java b/src/main/java/gregtech/api/task/tasks/PollutionTask.java index 060a91acab..3770409fb1 100644 --- a/src/main/java/gregtech/api/task/tasks/PollutionTask.java +++ b/src/main/java/gregtech/api/task/tasks/PollutionTask.java @@ -8,7 +8,7 @@ import gregtech.api.enums.TickTime; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.task.TaskHost; import gregtech.api.task.TickableTask; -import gregtech.common.GT_Pollution; +import gregtech.common.Pollution; public class PollutionTask<T extends TaskHost & IMachineProgress> extends TickableTask<T> { @@ -38,7 +38,7 @@ public class PollutionTask<T extends TaskHost & IMachineProgress> extends Tickab public void update(long tick, boolean isServerSide) { if (isServerSide && tick % POLLUTION_TICK == 0 && taskHost.hasThingsToDo()) { if (taskHost instanceof final TileEntity entity) { - GT_Pollution.addPollution(entity, getPollutionPerSecond()); + Pollution.addPollution(entity, getPollutionPerSecond()); } } } diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java b/src/main/java/gregtech/api/threads/RunnableCableUpdate.java index 5e3b36f473..7ed4e28554 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java +++ b/src/main/java/gregtech/api/threads/RunnableCableUpdate.java @@ -6,21 +6,21 @@ import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.gtnhlib.util.CoordinatePacker; -import gregtech.GT_Mod; +import gregtech.GTMod; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.common.GT_Proxy; +import gregtech.api.metatileentity.implementations.MTECable; +import gregtech.common.GTProxy; -public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { +public class RunnableCableUpdate extends RunnableMachineUpdate { - protected GT_Runnable_Cable_Update(World aWorld, int posX, int posY, int posZ) { + protected RunnableCableUpdate(World aWorld, int posX, int posY, int posZ) { super(aWorld, posX, posY, posZ); } public static void setCableUpdateValues(World aWorld, int posX, int posY, int posZ) { if (isEnabled) { - EXECUTOR_SERVICE.submit(new GT_Runnable_Cable_Update(aWorld, posX, posY, posZ)); + EXECUTOR_SERVICE.submit(new RunnableCableUpdate(aWorld, posX, posY, posZ)); } } @@ -36,7 +36,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { final TileEntity tTileEntity; - GT_Proxy.TICK_LOCK.lock(); + GTProxy.TICK_LOCK.lock(); try { // we dont want to go over cables that are in unloaded chunks // keeping the lock just to make sure no CME happens @@ -46,7 +46,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { tTileEntity = null; } } finally { - GT_Proxy.TICK_LOCK.unlock(); + GTProxy.TICK_LOCK.unlock(); } // See if the block itself needs an update @@ -56,7 +56,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { // Now see if we should add the nearby blocks to the queue: // only add blocks the cable is connected to if (tTileEntity instanceof BaseMetaPipeEntity metaPipe - && metaPipe.getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable cable) { + && metaPipe.getMetaTileEntity() instanceof MTECable cable) { for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { final ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[i]; if (cable.isConnectedAtSide(side)) { @@ -70,7 +70,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { } } } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.error( + GTMod.GT_FML_LOGGER.error( "Well this update was broken... " + initialX + ", " + initialY diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/RunnableMachineUpdate.java index 339556e246..d11e176f3d 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/RunnableMachineUpdate.java @@ -11,15 +11,15 @@ import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.gtnhlib.util.CoordinatePacker; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.GTMod; +import gregtech.api.GregTechAPI; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; -import gregtech.common.GT_Proxy; +import gregtech.common.GTProxy; import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue; import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import it.unimi.dsi.fastutil.longs.LongSet; -public class GT_Runnable_MachineBlockUpdate implements Runnable { +public class RunnableMachineUpdate implements Runnable { // used by runner thread protected final int initialX, initialY, initialZ; @@ -36,7 +36,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { protected static ExecutorService EXECUTOR_SERVICE; // This class should never be initiated outside of this class! - protected GT_Runnable_MachineBlockUpdate(World aWorld, int posX, int posY, int posZ) { + protected RunnableMachineUpdate(World aWorld, int posX, int posY, int posZ) { this.world = aWorld; this.initialX = posX; this.initialY = posY; @@ -51,15 +51,15 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { } public static void setEnabled() { - GT_Runnable_MachineBlockUpdate.isEnabled = true; + RunnableMachineUpdate.isEnabled = true; } public static void setDisabled() { - GT_Runnable_MachineBlockUpdate.isEnabled = false; + RunnableMachineUpdate.isEnabled = false; } public static void setEnabled(boolean isEnabled) { - GT_Runnable_MachineBlockUpdate.isEnabled = isEnabled; + RunnableMachineUpdate.isEnabled = isEnabled; } public static boolean isCurrentThreadEnabled() { @@ -67,7 +67,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { } public static void setCurrentThreadEnabled(boolean perThreadEnable) { - GT_Runnable_MachineBlockUpdate.perThreadEnable.set(perThreadEnable); + RunnableMachineUpdate.perThreadEnable.set(perThreadEnable); } protected static boolean isEnabled = true; @@ -75,7 +75,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { public static void setMachineUpdateValues(World aWorld, int posX, int posY, int posZ) { if (isEnabled() && isCurrentThreadEnabled()) { - EXECUTOR_SERVICE.submit(new GT_Runnable_MachineBlockUpdate(aWorld, posX, posY, posZ)); + EXECUTOR_SERVICE.submit(new RunnableMachineUpdate(aWorld, posX, posY, posZ)); } } @@ -91,30 +91,30 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { public static void shutdownExecutorService() { try { - GT_Mod.GT_FML_LOGGER.info("Shutting down Machine block update executor service"); + GTMod.GT_FML_LOGGER.info("Shutting down Machine block update executor service"); EXECUTOR_SERVICE.shutdown(); // Disable new tasks from being submitted // Wait a while for existing tasks to terminate if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) { EXECUTOR_SERVICE.shutdownNow(); // Cancel currently executing tasks // Wait a while for tasks to respond to being cancelled if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) { - GT_Mod.GT_FML_LOGGER.error( + GTMod.GT_FML_LOGGER.error( "Well this didn't terminated well... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); } } } catch (InterruptedException ie) { - GT_Mod.GT_FML_LOGGER.error("Well this interruption got interrupted...", ie); + GTMod.GT_FML_LOGGER.error("Well this interruption got interrupted...", ie); // (Re-)Cancel if current thread also interrupted EXECUTOR_SERVICE.shutdownNow(); // Preserve interrupt status Thread.currentThread() .interrupt(); } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.error("Well this didn't terminated well...", e); + GTMod.GT_FML_LOGGER.error("Well this didn't terminated well...", e); // (Re-)Cancel in case EXECUTOR_SERVICE.shutdownNow(); } finally { - GT_Mod.GT_FML_LOGGER.info("Leaving... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); + GTMod.GT_FML_LOGGER.info("Leaving... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); } } @@ -135,13 +135,13 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { // `loadedTileEntityList`... which might be in the process // of being iterated over during `UpdateEntities()`... which might cause a // ConcurrentModificationException. So, lock that shit. - GT_Proxy.TICK_LOCK.lock(); + GTProxy.TICK_LOCK.lock(); try { tTileEntity = world.getTileEntity(posX, posY, posZ); - isMachineBlock = GregTech_API + isMachineBlock = GregTechAPI .isMachineBlock(world.getBlock(posX, posY, posZ), world.getBlockMetadata(posX, posY, posZ)); } finally { - GT_Proxy.TICK_LOCK.unlock(); + GTProxy.TICK_LOCK.unlock(); } // See if the block itself needs an update @@ -167,7 +167,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { } } } catch (Exception e) { - GT_Mod.GT_FML_LOGGER.error( + GTMod.GT_FML_LOGGER.error( "Well this update was broken... " + initialX + ", " + initialY diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/RunnableSound.java index 9021a60e89..30704f2a97 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java +++ b/src/main/java/gregtech/api/threads/RunnableSound.java @@ -3,10 +3,10 @@ package gregtech.api.threads; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import gregtech.api.util.GT_PlayedSound; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTPlayedSound; +import gregtech.api.util.GTUtility; -public class GT_Runnable_Sound implements Runnable { +public class RunnableSound implements Runnable { private final double mX, mY, mZ; private final int mTimeUntilNextSound; @@ -14,7 +14,7 @@ public class GT_Runnable_Sound implements Runnable { private final ResourceLocation mSoundResourceLocation; private final float mSoundStrength, mSoundModulation; - public GT_Runnable_Sound(World aWorld, double aX, double aY, double aZ, int aTimeUntilNextSound, + public RunnableSound(World aWorld, double aX, double aY, double aZ, int aTimeUntilNextSound, ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) { mWorld = aWorld; mX = aX; @@ -29,11 +29,11 @@ public class GT_Runnable_Sound implements Runnable { @Override public void run() { try { - GT_PlayedSound tSound; - if (GT_Utility.sPlayedSoundMap.containsKey(tSound = new GT_PlayedSound(mSoundResourceLocation, mX, mY, mZ))) + GTPlayedSound tSound; + if (GTUtility.sPlayedSoundMap.containsKey(tSound = new GTPlayedSound(mSoundResourceLocation, mX, mY, mZ))) return; mWorld.playSound(mX, mY, mZ, mSoundResourceLocation.toString(), mSoundStrength, mSoundModulation, false); - GT_Utility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound); + GTUtility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound); } catch (Throwable e) { /**/ } 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; diff --git a/src/main/java/gregtech/api/world/GT_Worldgen.java b/src/main/java/gregtech/api/world/GTWorldgen.java index a3393324c2..da3a66ef7e 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen.java +++ b/src/main/java/gregtech/api/world/GTWorldgen.java @@ -9,17 +9,17 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.DimensionManager; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; -import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import gregtech.common.WorldgenGTOreLayer; +import gregtech.common.WorldgenGTOreSmallPieces; -public abstract class GT_Worldgen { +public abstract class GTWorldgen { public final String mWorldGenName; public final boolean mEnabled; private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<>(); @SuppressWarnings({ "unchecked", "rawtypes" }) // The adding of "this" needs a List<this> which does not exist - public GT_Worldgen(String aName, List aList, boolean aDefault) { + public GTWorldgen(String aName, List aList, boolean aDefault) { mWorldGenName = aName; mEnabled = aDefault; if (mEnabled) aList.add(this); @@ -103,13 +103,13 @@ public abstract class GT_Worldgen { } // ugly, but idk how to do it better without hard depping on tf provider in ore constructors - if (this instanceof GT_Worldgen_GT_Ore_SmallPieces ore) { + if (this instanceof WorldgenGTOreSmallPieces ore) { if (ore.twilightForest && aWorld.provider.dimensionId == 7) { value = true; } } - if (this instanceof GT_Worldgen_GT_Ore_Layer ore) { + if (this instanceof WorldgenGTOreLayer ore) { if (ore.twilightForest && aWorld.provider.dimensionId == 7) { value = true; } |