Research Completer - Tooltip, recipe and research

This commit is contained in:
KiloJoel committed 2021-10-10 17:14:24 +01:00
1 parent 67b9369cd5
commit 0b869f1dbf
5 files changed
+40 -19

No files matched your search

+10
View File
@@ -5,6 +5,10 @@ import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTCraftingAspects;
import emt.util.EMTResearchAspects;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import ic2.api.item.IC2Items;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputItemStack;
@@ -100,6 +104,8 @@ public class EMTRecipes {
public static ShapedArcaneRecipe electricScribingTools;
public static ShapedArcaneRecipe thaumiumWing;
public static ShapedArcaneRecipe thaumiumWings;
public static ShapedArcaneRecipe researchCompleter;
public static ShapedArcaneRecipe magicalMachineCasing;
public static CrucibleRecipe ignisGenerator;
public static CrucibleRecipe auramGenerator;
public static CrucibleRecipe arborGenerator;
@@ -362,6 +368,10 @@ public class EMTRecipes {
thaumiumWings = addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(EMTItems.thaumiumWing), EMTCraftingAspects.thaumiumWing, "XX", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 14));
magicalMachineCasing = addArcaneCraftingRecipe("ResearchCompleter", new ItemStack(GregTech_API.sBlockCasings8, 1, 5), EMTCraftingAspects.magicalMachineCasing, "XYX", "XZX", "XYX", 'X', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1), 'Y', new ItemStack(ConfigItems.itemResource, 1, 14) , 'Z', GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Thaumium, 1));
researchCompleter = addArcaneCraftingRecipe("ResearchCompleter", new ItemStack(GregTech_API.sBlockMachines, 1, 13001), EMTCraftingAspects.researchCompleter, "XYX", "YZY", "XAX", 'X', GT_OreDictUnificator.get(OrePrefixes.circuit.get(Materials.Good), 1L), 'Y', new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 2), 'Z', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'A', new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5));
/** Crucible Recipes **/
ignisGenerator = addCrucibleRecipe("Ignis Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 1), new ItemStack(EMTBlocks.essentiaGens, 1, 0), EMTCraftingAspects.ignisGeneratorCrafting);
@@ -4,6 +4,7 @@ import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTResearchAspects;
import emt.util.EMTResearchItem;
import gregtech.api.GregTech_API;
import ic2.api.item.IC2Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@@ -32,6 +33,7 @@ public class EMTResearches {
new EMTResearchItem("The One Ring", 6, -7, 0, new ItemStack(EMTItems.onering)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Electric Cloud", 4, -7, 0, new ItemStack(EMTBlocks.electricCloud)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("1"), new ResearchPage("2"));
new EMTResearchItem("Feather Wings", 0, 2, 0, new ItemStack(EMTItems.featherWing)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(EMTRecipes.cardboard), new ResearchPage(EMTRecipes.featherWing), new ResearchPage(EMTRecipes.featherWings));
new EMTResearchItem("ResearchCompleter", -4, -2, 0, new ItemStack(GregTech_API.sBlockMachines, 1, 13001)).setParents("Electric Magic Tools").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.magicalMachineCasing), new ResearchPage(EMTRecipes.researchCompleter));
/*************************************/
/** Research that can be disabled **/
@@ -5,23 +5,19 @@ 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.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.ThaumcraftApi;
import org.lwjgl.input.Keyboard;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.INode;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.lib.research.ResearchManager;
@@ -33,7 +29,6 @@ import java.util.ArrayList;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW;
//TODO make sure completed notes can't go back in
public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_MultiBlockBase {
private final int MAX_LENGTH = 13;
@@ -61,7 +56,6 @@ public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_Mu
super(aName);
}
//TODO deplete nodes, stop if no nodes are available
@Override
public boolean onRunningTick(ItemStack aStack) {
//TODO consider only doing this every x ticks and make sure it finishes x ticks before the end of the recipe
@@ -159,7 +153,7 @@ public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_Mu
public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
//TODO add minimum casing number
this.length = findLength(iGregTechTileEntity, xDir, zDir);
if (this.length < 2)
return false;
@@ -183,10 +177,7 @@ public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_Mu
byte tMeta = iGregTechTileEntity.getMetaIDOffset(offsetCoords.x, offsetCoords.y, offsetCoords.z);
if (h == 0) {
if (sidewaysOffset == 0) { //Check for air or node TODO maybe remove, no need to require specific blocks here
//if (!GT_Utility.isBlockAir(getBaseMetaTileEntity().getWorld(), offsetCoords.x, offsetCoords.y, offsetCoords.z))
} else { //Check for warded glass
//TODO check for new casing once added
if (sidewaysOffset != 0) { //Check for warded glass
if (tBlock != ConfigBlocks.blockCosmeticOpaque || tMeta != 2)
return false;
}
@@ -194,7 +185,7 @@ public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_Mu
if (sidewaysOffset != 0 || forwardsOffset == 0 || Math.abs(forwardsOffset) == this.length - 1) { //Check ring shapes on top and bottom
//TODO change casing index to correct for this multi
if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16) && !this.addOutputToMachineList(tTileEntity, 16) && !this.addEnergyInputToMachineList(tTileEntity, 16)) {
if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0))
if ((tBlock != GregTech_API.sBlockCasings8 || tMeta != 5))
return false;
}
}
@@ -256,13 +247,28 @@ public class TileEntityResearchMultiblockController extends GT_MetaTileEntity_Mu
return new TileEntityResearchMultiblockController(this.mName);
}
//TODO finish tooltip using tooltip builder
@Override
public String[] getDescription() {
return new String[]{
"Controller block for the Thaumcraft Research Multiblock.",
"Completes research notes using EU and Thaumcraft nodes",
};
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Research Completer")
.addInfo("Controller block for the Research Completer")
.addInfo("Completes Thaumcraft research notes using EU and Thaumcraft nodes")
.addInfo("Place nodes in the center row")
.addSeparator()
.beginVariableStructureBlock(3, 3, 3, 3, 3, MAX_LENGTH, true)
.addController("Front center")
.addOtherStructurePart("[x] machine casing", "Top and bottom layers outside")
.addOtherStructurePart("Warded glass", "Middle layer outside")
.addEnergyHatch("Any casing")
.addMaintenanceHatch("Any casing")
.addInputBus("Any casing")
.addOutputBus("Any casing")
.toolTipFinisher("Electro-Magic Tools");
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
return tt.getStructureInformation();
} else {
return tt.getInformation();
}
}
//TODO texture
@@ -54,4 +54,6 @@ public class EMTCraftingAspects {
public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 48).add(Aspect.AIR, 32).add(Aspect.MECHANISM, 48).add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 48);
public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 16).add(Aspect.AIR, 8);
public static AspectList uuMatterCrystal = new AspectList().add(Aspect.CRYSTAL, 8).add(Aspect.COLD, 8).add(Aspect.MAGIC, 8);
public static AspectList researchCompleter = new AspectList().add(Aspect.FIRE, 50).add(Aspect.WATER, 50).add(Aspect.AIR, 50).add(Aspect.EARTH, 50).add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50);
public static AspectList magicalMachineCasing = new AspectList().add(Aspect.FIRE, 8).add(Aspect.AIR, 8).add(Aspect.ORDER, 8);
}
@@ -52,4 +52,5 @@ public class EMTResearchAspects {
public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4);
public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4);
public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AIR, 3);
public static AspectList researchCompleter = new AspectList().add(Aspect.MIND, 8).add(Aspect.MECHANISM, 5).add(Aspect.EXCHANGE, 5).add(Aspect.AURA, 4);
}