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 | |
| 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')
61 files changed, 1278 insertions, 151 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); /** diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java index 5b29d9a636..4842cb891e 100644 --- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java @@ -61,6 +61,7 @@ public final class ModBlocks { public static Block blockSpecialMultiCasings; public static Block blockSpecialMultiCasings2; public static Block blockCustomMachineCasings; + public static Block blockCustomPipeGearCasings; public static Block blockMetaTileEntity; public static Block blockHeliumGenerator; diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java index 035b13dfbf..2dc780bb78 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -17,6 +17,7 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; @@ -29,6 +30,12 @@ public class BlockBaseModular extends BasicBlock { public BlockTypes thisBlock; protected String thisBlockMaterial; protected final String thisBlockType; + + private static HashMap<String, Block> sBlockCache = new HashMap<String, Block>(); + + public static Block getMaterialBlock(Material aMaterial, BlockTypes aType) { + return sBlockCache.get(aMaterial.getUnlocalizedName()+"."+aType.name()); + } public BlockBaseModular(final Material material, final BlockTypes blockType) { this(material, blockType, material.getRgbAsHex()); @@ -39,6 +46,9 @@ public class BlockBaseModular extends BasicBlock { blockType, colour, Math.min(Math.max(material.vTier, 1), 6)); blockMaterial = material; registerComponent(); + if (material != null) { + sBlockCache.put(material.getUnlocalizedName()+"."+blockType.name(), this); + } } protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString, diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java index e1bc3462be..df69a050a6 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java @@ -7,8 +7,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.interfaces.ITexturedBlock; import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer; @@ -18,6 +16,8 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; +import gtPlusPlus.xmod.gregtech.api.objects.GTPP_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EnumCreatureType; @@ -93,9 +93,9 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { public ITexture[] getTexture(Block block, byte side) { if (this.blockMaterial != null){ - GT_RenderedTexture aIconSet = new GT_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); + GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); if (aIconSet != null){ - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; } } @@ -118,7 +118,7 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { } } } - return new ITexture[]{new GT_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; + return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; } @Override @@ -196,9 +196,9 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { public ITexture[] getTexture(Block block, byte side) { if (this.blockMaterial != null){ - GT_RenderedTexture aIconSet = new GT_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); + GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); if (aIconSet != null){ - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + return new ITexture[]{new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; } } @@ -221,7 +221,7 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock { } } } - return new ITexture[]{new GT_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; + return new ITexture[]{new GTPP_RenderedTexture(hiddenTextureArray[0], new short[]{240, 240, 240, 0})}; } } diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 493b7d415d..4f5615b60a 100644 --- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -116,9 +116,10 @@ public class CommandEnableDebugWhileRunning implements ICommand if (aItem != null) { String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; - Logger.INFO(aModID+":"+aRegistryName); + Logger.INFO(aModID+":"+aRegistryName+":"+aItem.getItemDamage()+" | "+aItem.getDisplayName()); } } + PlayerUtils.messagePlayer(P, "Dumped Inventory."); } } else if (argString[0].toLowerCase().equals("hand")) { diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 1faf07dde3..79446db6e6 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -165,6 +165,7 @@ public class COMPAT_HANDLER { GregtechIndustrialElementDuplicator.run(); GregtechIndustrialRockBreaker.run(); GregtechIndustrialChisel.run(); + GregtechIndustrialFluidHeater.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index 159598189e..b77b46d34b 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -297,6 +297,9 @@ public final class ModItems { public static ItemStack itemHotTitaniumIngot; public static Fluid fluidZrF4; + public static Fluid fluidFertBasic; + public static Fluid fluidFertUN32; + public static Fluid fluidFertUN18; public static Item boxTools; public static Item boxFood; @@ -771,10 +774,10 @@ public final class ModItems { temp2 = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1); } if (temp1 != null){ - FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2, true); + fluidFertBasic = FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2, true); } - FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true); - FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true); + fluidFertUN32 = FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true); + fluidFertUN18 = FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true); /*GT_Values.RA.addMixerRecipe( arg0, //Item In diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index d27919c18c..f9ab366285 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -256,6 +256,7 @@ public class RECIPES_Machines { sparging(); chisels(); rockBreaker(); + thermicFluidHeater(); gt4FarmManager(); gt4Redstone(); @@ -276,6 +277,16 @@ public class RECIPES_Machines { } + + private static void thermicFluidHeater() { + + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(5, 1), CI.circuitTier5, CI.getPlate(5, 1), + pipeTier7, ItemList.Machine_IV_FluidHeater.get(1), pipeTier7, + CI.getPlate(5, 1), CI.circuitTier4, CI.getPlate(5, 1), + GregtechItemList.Controller_IndustrialFluidHeater.get(1)); + } + private static void computerCube() { CORE.RA.addSixSlotAssemblingRecipe( @@ -1299,6 +1310,12 @@ public class RECIPES_Machines { "craftingPiston", ALLOY.TUMBAGA.getFrameBox(1), "craftingPiston", aBronzeBricks, "gemDiamond", aBronzeBricks, GregtechItemList.Controller_SteamMaceratorMulti.get(1)); + // Steam Compressor Multi + RecipeUtils.addShapedGregtechRecipe( + aBronzeBricks, "craftingPiston", aBronzeBricks, + ALLOY.TUMBAGA.getGear(1), ALLOY.TUMBAGA.getFrameBox(1), ALLOY.TUMBAGA.getGear(1), + aBronzeBricks, "craftingPiston", aBronzeBricks, + GregtechItemList.Controller_SteamCompressorMulti.get(1)); // Steam Hatch RecipeUtils.addShapedGregtechRecipe( diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index fe1204a661..8acd54c401 100644 --- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -2,11 +2,7 @@ package gtPlusPlus.nei; import java.awt.Rectangle; import java.lang.ref.SoftReference; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; import org.lwjgl.opengl.GL11; @@ -15,20 +11,13 @@ import codechicken.lib.gui.GuiDraw; import co |
