diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-02-14 21:25:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 22:25:31 +0100 |
commit | e28ccb5d6b678245c2f78f910e6c39aa29fb3793 (patch) | |
tree | 8331e9ee3a2da9c149b87b3b7a32495e7c1b4509 /src/main/java/gregtech | |
parent | 04cb38d30164fdbf1d0036df5848117643dad9cf (diff) | |
download | GT5-Unofficial-e28ccb5d6b678245c2f78f910e6c39aa29fb3793.tar.gz GT5-Unofficial-e28ccb5d6b678245c2f78f910e6c39aa29fb3793.tar.bz2 GT5-Unofficial-e28ccb5d6b678245c2f78f910e6c39aa29fb3793.zip |
Screwdriver driven development. (#124)
* Added NEI handler for TGS.
Added BoP support to TGS.
Added base work for LFH.
* Added Witchery support to TGS.
* Finished LFH.
Added missing steam multiblock.
Fixed GT++ NEI time values not being precise enough.
* Implement Fert use in TGS.
* Fix broken checkRecipes.
Did initial work for XLHE.
Other misc. stuff.
* Update GregtechLargeTurbinesAndHeatExchanger.java
* Update RECIPES_Machines.java
Changes requested by @Dream-Master
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r-- | src/main/java/gregtech/api/enums/TAE.java | 37 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTPP_Recipe.java | 8 |
2 files changed, 32 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/enums/TAE.java b/src/main/java/gregtech/api/enums/TAE.java index e8fd31d89e..274a29065b 100644 --- a/src/main/java/gregtech/api/enums/TAE.java +++ b/src/main/java/gregtech/api/enums/TAE.java @@ -5,13 +5,13 @@ import java.util.HashMap; import java.util.HashSet; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; public class TAE { @@ -20,7 +20,7 @@ public class TAE { public static int gtPPLastUsedIndex = 64; public static int secondaryIndex = 0; - public static HashMap<Integer, GT_CopiedBlockTexture> mTAE = new HashMap<Integer, GT_CopiedBlockTexture>(); + public static HashMap<Integer, GTPP_CopiedBlockTexture> mTAE = new HashMap<Integer, GTPP_CopiedBlockTexture>(); private static final HashSet<Integer> mFreeSlots = new HashSet<Integer>(64); static { @@ -34,18 +34,18 @@ public class TAE { * * @param aPage - The Texture page (0-3) * @param aID - The ID on the specified page (0-15) - * @param gt_CopiedBlockTexture - The Texture to register + * @param GTPP_CopiedBlockTexture - The Texture to register * @return - Did it register correctly? */ - public static boolean registerTexture(int aPage, int aID, GT_CopiedBlockTexture gt_CopiedBlockTexture) { + public static boolean registerTexture(int aPage, int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { int aRealID = aID + (aPage * 16); - return registerTexture(64 + aRealID, gt_CopiedBlockTexture); + return registerTexture(64 + aRealID, GTPP_CopiedBlockTexture); } - public static boolean registerTexture(int aID, GT_CopiedBlockTexture gt_CopiedBlockTexture) { + public static boolean registerTexture(int aID, GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { if (mFreeSlots.contains(aID)) { mFreeSlots.remove(aID); - mTAE.put(aID, gt_CopiedBlockTexture); + mTAE.put(aID, GTPP_CopiedBlockTexture); return true; } else { @@ -56,17 +56,22 @@ public class TAE { public static void finalizeTAE() { String aFreeSpaces = ""; + String aPageAndSlotFree = ""; AutoMap<Integer> aTemp = new AutoMap<Integer>(mFreeSlots); for (int i = 0; i < mFreeSlots.size() ; i++) { - aFreeSpaces += aTemp.get(i); + int j = aTemp.get(i); + aFreeSpaces += j; + aPageAndSlotFree += getPageFromIndex(j); if (i != (mFreeSlots.size() - 1)) { aFreeSpaces += ", "; + aPageAndSlotFree += ", "; } } Logger.INFO("Free Indexes within TAE: "+aFreeSpaces); + Logger.INFO("Free Page slots within TAE: "+aPageAndSlotFree); Logger.INFO("Filling them with ERROR textures."); for (int aFreeSlot : aTemp.values()) { - registerTexture(aFreeSlot, new GT_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); + registerTexture(aFreeSlot, new GTPP_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); } Logger.INFO("Finalising TAE."); for (int aKeyTae : mTAE.keySet()) { @@ -75,7 +80,7 @@ public class TAE { Logger.INFO("Finalised TAE."); } - private static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) { + private static boolean registerTextures(GTPP_CopiedBlockTexture GTPP_CopiedBlockTexture) { try { //Handle page 2. Logger.INFO("[TAE} Registering Texture, Last used casing ID is "+gtPPLastUsedIndex+"."); @@ -85,7 +90,7 @@ public class TAE { if (x != null) { ITexture[][] h = (ITexture[][]) x.get(null); if (h != null) { - h[64][secondaryIndex++] = gt_CopiedBlockTexture; + h[64][secondaryIndex++] = GTPP_CopiedBlockTexture; x.set(null, h); Logger.INFO("[TAE} Registered Texture with ID "+(secondaryIndex-1)+" in secondary index."); return true; @@ -96,7 +101,7 @@ public class TAE { //set to page 1. else { - Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, gt_CopiedBlockTexture); + Textures.BlockIcons.setCasingTextureForId(gtPPLastUsedIndex, GTPP_CopiedBlockTexture); Logger.INFO("[TAE} Registered Texture with ID "+(gtPPLastUsedIndex)+" in main index."); gtPPLastUsedIndex++; return true; @@ -136,4 +141,12 @@ public class TAE { id += blockMeta; return id; } + public static String getPageFromIndex(int aIndex) { + int aPage = 0; + int aSlot = 0; + int aAdjustedIndex = aIndex > 64 ? (aIndex - 64) : aIndex; + aPage = aAdjustedIndex / 16; + aSlot = aAdjustedIndex - (16 * aPage); + return "["+aIndex+" | "+aPage+", "+aSlot+"]"; + } } diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index ba914e0857..e777a0bf36 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -12,6 +12,7 @@ import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.*; @@ -69,6 +70,10 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { private final void checkModified() { if (hasBeenModified()) { + String[] aInfo = RecipeUtils.getRecipeInfo(this); + for (String s : aInfo) { + Logger.INFO(s); + } CORE.crash("Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus."); } } @@ -432,7 +437,8 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { // Flotation Cell public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); - + // Tree Growth Simulator + public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(100), "gtpp.recipe.treefarm", "Tree Growth Simulator", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, "", 1, "", false, true); /** |