diff --git a/libs/StructureLib-1.0.10-deobf.jar b/libs/StructureLib-1.0.10-deobf.jar new file mode 100644 index 0000000..3b338ac Binary files /dev/null and b/libs/StructureLib-1.0.10-deobf.jar differ diff --git a/libs/gregtech-5.09.34.17-api.jar b/libs/gregtech-5.09.34.17-api.jar deleted file mode 100644 index baac028..0000000 Binary files a/libs/gregtech-5.09.34.17-api.jar and /dev/null differ diff --git a/libs/gregtech-5.09.38.00-api.jar b/libs/gregtech-5.09.38.00-api.jar new file mode 100644 index 0000000..ac80ed3 Binary files /dev/null and b/libs/gregtech-5.09.38.00-api.jar differ diff --git a/libs/gregtech-5.09.34.17-dev.jar b/libs/gregtech-5.09.38.00-dev.jar similarity index 77% rename from libs/gregtech-5.09.34.17-dev.jar rename to libs/gregtech-5.09.38.00-dev.jar index 17f333e..cde1f7e 100644 Binary files a/libs/gregtech-5.09.34.17-dev.jar and b/libs/gregtech-5.09.38.00-dev.jar differ diff --git a/libs/gregtech-5.09.34.17-sources.jar b/libs/gregtech-5.09.38.00-sources.jar similarity index 79% rename from libs/gregtech-5.09.34.17-sources.jar rename to libs/gregtech-5.09.38.00-sources.jar index 27b73bf..bc85102 100644 Binary files a/libs/gregtech-5.09.34.17-sources.jar and b/libs/gregtech-5.09.38.00-sources.jar differ diff --git a/src/main/java/emt/EMT.java b/src/main/java/emt/EMT.java index 131a26a..62575d8 100644 --- a/src/main/java/emt/EMT.java +++ b/src/main/java/emt/EMT.java @@ -14,6 +14,7 @@ import emt.command.CommandOutputs; import emt.init.EMTEntities; import emt.init.Registry; import emt.network.PacketEMTKeys; +import emt.network.PacketNodeInfo; import emt.proxy.CommonProxy; import emt.tile.solar.Solars; import emt.util.*; @@ -96,5 +97,6 @@ public class EMT { public void registerPackets() { INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER); + INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT); } } diff --git a/src/main/java/emt/gthandler/common/loader/EMT_GT_Loader.java b/src/main/java/emt/gthandler/common/loader/EMT_GT_Loader.java index ba695c8..252c6e4 100644 --- a/src/main/java/emt/gthandler/common/loader/EMT_GT_Loader.java +++ b/src/main/java/emt/gthandler/common/loader/EMT_GT_Loader.java @@ -5,6 +5,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import emt.gthandler.common.implementations.EssentiaHatch; import emt.gthandler.common.items.EMT_CasingBlock; import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen; +import emt.tile.GT_MetaTileEntity_ResearchCompleter; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -26,6 +27,7 @@ public class EMT_GT_Loader implements Runnable { public static int aIDoffset = 13000 - TIERS - 1; public static ItemStack[] EHatch = new ItemStack[TIERS]; public static ItemStack LEG; + public static ItemStack ResearchMultiblock; @Override public void run() { @@ -45,6 +47,8 @@ public class EMT_GT_Loader implements Runnable { for (int i = 0; i < ItemList.HATCHES_INPUT.length; i++) GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.HATCHES_INPUT[i].get(1L), new ItemStack(ConfigBlocks.blockTube, 1, 4)}, Materials.Thaumium.getMolten(288L), EHatch[i], 100, (int) (GT_Values.V[i] - (GT_Values.V[i] / 10))); + + ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(aIDoffset + TIERS + 2, "Research Completer", "Research Completer").getStackForm(1L); } public void runlate() { diff --git a/src/main/java/emt/init/EMTRecipes.java b/src/main/java/emt/init/EMTRecipes.java index 4b18b38..b77c2cd 100644 --- a/src/main/java/emt/init/EMTRecipes.java +++ b/src/main/java/emt/init/EMTRecipes.java @@ -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, 6), 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, 6), '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); diff --git a/src/main/java/emt/init/EMTResearches.java b/src/main/java/emt/init/EMTResearches.java index e7a2f46..746dc8f 100644 --- a/src/main/java/emt/init/EMTResearches.java +++ b/src/main/java/emt/init/EMTResearches.java @@ -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", EMTResearchAspects.researchCompleter, -4, -2, 0, new ItemStack(GregTech_API.sBlockMachines, 1, 13001)).setParents("Electric Magic Tools").setParentsHidden("WANDPED", "WARDEDARCANA").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.magicalMachineCasing), new ResearchPage(EMTRecipes.researchCompleter)); /*************************************/ /** Research that can be disabled **/ diff --git a/src/main/java/emt/network/PacketNodeInfo.java b/src/main/java/emt/network/PacketNodeInfo.java new file mode 100644 index 0000000..548941d --- /dev/null +++ b/src/main/java/emt/network/PacketNodeInfo.java @@ -0,0 +1,69 @@ +package emt.network; + +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import emt.tile.GT_MetaTileEntity_ResearchCompleter; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.tileentity.TileEntity; + +public class PacketNodeInfo implements IMessage, IMessageHandler { + + private int mBlockX, mBlockY, mBlockZ, mDim, nodeDistance, nodeColor; + + public PacketNodeInfo() {} + + public PacketNodeInfo(int mBlockX, int mBlockY, int mBlockZ, int mDim, int nodeDistance, int nodeColor) { + this.mBlockX = mBlockX; + this.mBlockY = mBlockY; + this.mBlockZ = mBlockZ; + this.mDim = mDim; + this.nodeDistance = nodeDistance; + this.nodeColor = nodeColor; + } + + @Override + public void fromBytes(ByteBuf buf) { + mBlockX = buf.readInt(); + mBlockY = buf.readInt(); + mBlockZ = buf.readInt(); + mDim = buf.readInt(); + nodeDistance = buf.readInt(); + nodeColor = buf.readInt(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(mBlockX); + buf.writeInt(mBlockY); + buf.writeInt(mBlockZ); + buf.writeInt(mDim); + buf.writeInt(nodeDistance); + buf.writeInt(nodeColor); + } + + @Override + @SideOnly(Side.CLIENT) + public IMessage onMessage(PacketNodeInfo message, MessageContext ctx) { + WorldClient world = Minecraft.getMinecraft().theWorld; + if (world != null) { + if (world.blockExists(message.mBlockX, message.mBlockY, message.mBlockZ)) { + TileEntity tileEntity = world.getTileEntity(message.mBlockX, message.mBlockY, message.mBlockZ); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity; + if (gtTile.getMetaTileEntity() instanceof GT_MetaTileEntity_ResearchCompleter) { + GT_MetaTileEntity_ResearchCompleter researchCompleter = (GT_MetaTileEntity_ResearchCompleter) gtTile.getMetaTileEntity(); + researchCompleter.setNodeValues(message.nodeDistance, message.nodeColor); + } + } + } + } + return null; + } +} diff --git a/src/main/java/emt/tile/GT_MetaTileEntity_ResearchCompleter.java b/src/main/java/emt/tile/GT_MetaTileEntity_ResearchCompleter.java new file mode 100644 index 0000000..8a94bc3 --- /dev/null +++ b/src/main/java/emt/tile/GT_MetaTileEntity_ResearchCompleter.java @@ -0,0 +1,375 @@ +package emt.tile; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import emt.EMT; +import emt.network.PacketNodeInfo; +import gregtech.api.GregTech_API; +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.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +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; +import thaumcraft.common.lib.research.ResearchNoteData; +import thaumcraft.common.tiles.TileNode; + +import java.util.ArrayList; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +public class GT_MetaTileEntity_ResearchCompleter extends GT_MetaTileEntity_EnhancedMultiBlockBase { + private static final int CASING_INDEX = 184; + private static final int MAX_LENGTH = 13; + private static final int RECIPE_LENGTH = 1200; + private static final int RECIPE_EUT = 120; + private static final float NODE_COST_MULTIPLIER = 1.0f; + + private int recipeAspectCost; + private int aspectsAbsorbed; + + protected int mLength; + protected int mCasing; + protected boolean endFound; + + //For displaying beam + private int lastNodeDistance; + private int lastNodeColor; + private int syncTimer; + + private static final String STRUCTURE_PIECE_FIRST = "first"; + private static final String STRUCTURE_PIECE_LATER = "later"; + private static final String STRUCTURE_PIECE_LAST = "last"; + private static final String STRUCTURE_PIECE_LATER_HINT = "laterHint"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][]{ + {"ccc"}, + {"g~g"}, + {"ccc"}, + })) + .addShape(STRUCTURE_PIECE_LATER, transpose(new String[][]{ + {"c c"}, + {"gxg"}, + {"c c"}, + })) + .addShape(STRUCTURE_PIECE_LAST, transpose(new String[][]{ + {"c"}, + {"g"}, + {"c"}, + })) + .addShape(STRUCTURE_PIECE_LATER_HINT, transpose(new String[][]{ + {"c c"}, + {"g g"}, + {"c c"}, + })) + .addElement('c', ofChain( //Magical machine casing or hatch + ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(GT_MetaTileEntity_ResearchCompleter::onCasingFound, ofBlock(GregTech_API.sBlockCasings8, 8)) + )) + .addElement('x', ofChain( //Check for the end but otherwise treat as a skipped spot + onElementPass(GT_MetaTileEntity_ResearchCompleter::onEndFound, ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)), + isAir(), //Forgive me + notAir() + )) + .addElement('g', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) //Warded glass + .build(); + + + public GT_MetaTileEntity_ResearchCompleter(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_ResearchCompleter(String aName) { + super(aName); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("recipeAspectCost", recipeAspectCost); + aNBT.setInteger("aspectsAbsorbed", aspectsAbsorbed); + aNBT.setInteger("mLength", mLength); + + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + recipeAspectCost = aNBT.getInteger("recipeAspectCost"); + aspectsAbsorbed = aNBT.getInteger("aspectsAbsorbed"); + mLength = aNBT.getInteger("mLength"); + + super.loadNBTData(aNBT); + } + + //For client beam animation + public void setNodeValues(int nodeDistance, int nodeColor) { + this.lastNodeDistance = nodeDistance; + this.lastNodeColor = nodeColor; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isClientSide()) { + if (aBaseMetaTileEntity.isActive()) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + double xCoord = aBaseMetaTileEntity.getXCoord() + 0.5; + double yCoord = aBaseMetaTileEntity.getYCoord() + 0.5; + double zCoord = aBaseMetaTileEntity.getZCoord() + 0.5; + Thaumcraft.proxy.beam(aBaseMetaTileEntity.getWorld(), xCoord + 0.5 * xDir, yCoord + 0.5 * yDir, zCoord + 0.5 * zDir, xCoord + xDir * lastNodeDistance, yCoord + yDir * lastNodeDistance, zCoord + zDir * lastNodeDistance, 3, lastNodeColor, true, 2, 1); + } else { + lastNodeDistance = 0; + lastNodeColor = 0; + } + } + + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + float progressAmount = ((float) this.mProgresstime) / this.mMaxProgresstime; + int requiredVis = (int)Math.ceil(progressAmount * recipeAspectCost - aspectsAbsorbed); + syncTimer--; + + IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int i = 1; + + //Loop through node spaces and drain them from front to back + while (i < this.mLength - 1 && requiredVis > 0) { + int nodeX = aBaseMetaTileEntity.getXCoord() + xDir * i; + int nodeY = aBaseMetaTileEntity.getYCoord() + yDir * i; + int nodeZ = aBaseMetaTileEntity.getZCoord() + zDir * i; + TileEntity tileEntity = aBaseMetaTileEntity.getWorld().getTileEntity(nodeX, nodeY, nodeZ); + + if (tileEntity instanceof TileNode) { + TileNode aNode = (TileNode)tileEntity; + AspectList aspectsBase = aNode.getAspectsBase(); + + for (Aspect aspect : aspectsBase.getAspects()) { + int aspectAmount = aspectsBase.getAmount(aspect); + int drainAmount = Math.min(requiredVis, aspectAmount); + aNode.setNodeVisBase(aspect, (short) (aspectAmount - drainAmount)); + aNode.takeFromContainer(aspect, drainAmount); + requiredVis -= drainAmount; + aspectsAbsorbed += drainAmount; + + if (requiredVis <= 0) { + if (i != lastNodeDistance || aspect.getColor() != lastNodeColor) + sendClientAnimationUpdate(aBaseMetaTileEntity, i, aspect.getColor()); + + break; + } + } + + if (aspectsBase.visSize() <= 0) + aBaseMetaTileEntity.getWorld().setBlockToAir(nodeX, nodeY, nodeZ); + else { + aNode.markDirty(); + aBaseMetaTileEntity.getWorld().markBlockForUpdate(nodeX, nodeY, nodeZ); + } + } + i++; + } + + if (syncTimer <= 0) + sendClientAnimationUpdate(aBaseMetaTileEntity, lastNodeDistance, lastNodeColor); + + if (requiredVis > 0) + this.criticalStopMachine(); + + return super.onRunningTick(aStack); + } + + private void sendClientAnimationUpdate(IGregTechTileEntity aBaseMetaTileEntity, int nodeDistance, int nodeColor) { + int xCoord = aBaseMetaTileEntity.getXCoord(); + int yCoord = aBaseMetaTileEntity.getYCoord(); + int zCoord = aBaseMetaTileEntity.getZCoord(); + int dim = aBaseMetaTileEntity.getWorld().provider.dimensionId; + + PacketNodeInfo packet = new PacketNodeInfo(xCoord, yCoord, zCoord, dim, nodeDistance, nodeColor); + EMT.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(dim, xCoord, yCoord, zCoord, 128)); + + lastNodeDistance = nodeDistance; + lastNodeColor = nodeColor; + syncTimer = 100; + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ArrayList tInputList = this.getStoredInputs(); + + for (ItemStack stack : tInputList) { + if (GT_Utility.isStackValid(stack) && stack.stackSize > 0) { + if (stack.getItem() == ConfigItems.itemResearchNotes && !stack.stackTagCompound.getBoolean("complete")) { + ResearchNoteData noteData = ResearchManager.getData(stack); + if (noteData == null) + continue; + ResearchItem researchItem = ResearchCategories.getResearch(noteData.key); + if (researchItem == null) + continue; + + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + this.calculateOverclockedNessMulti(RECIPE_EUT, RECIPE_LENGTH, 1, this.getMaxInputVoltage()); + if (this.mMaxProgresstime == 2147483646 && this.mEUt == 2147483646) { + return false; + } + if (this.mEUt > 0) { + this.mEUt = -this.mEUt; + } + + //Create a completed version of the note to output + this.mOutputItems = new ItemStack[]{GT_Utility.copyAmount(1L, stack)}; + this.mOutputItems[0].stackTagCompound.setBoolean("complete", true); + this.mOutputItems[0].setItemDamage(64); + stack.stackSize -= 1; + this.aspectsAbsorbed = 0; + this.recipeAspectCost = (int)Math.ceil(researchItem.tags.visSize() * NODE_COST_MULTIPLIER); + + this.lastNodeDistance = 0; + this.lastNodeColor = 0; + + this.sendLoopStart((byte) 20); + this.updateSlots(); + return true; + } + } + } + + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + mLength = 1; + mCasing = 0; + endFound = false; + + //check front + if (!checkPiece(STRUCTURE_PIECE_FIRST, 1, 1, 0)) + return false; + + //check middle pieces + while (!endFound && mLength++ < MAX_LENGTH) { + if (!checkPiece(STRUCTURE_PIECE_LATER, 1, 1, -(mLength - 1))) + return false; + } + + return endFound && mLength >= 3 && checkPiece(STRUCTURE_PIECE_LAST, 0, 1, -(mLength - 1)) && mCasing >= mLength * 3; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_ResearchCompleter(this.mName); + } + + protected void onCasingFound() { + mCasing++; + } + + protected void onEndFound() { + endFound = true; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + 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("Magical machine casing", "Top and bottom layers outside. 3 x L minimum") + .addOtherStructurePart("Warded glass", "Middle layer outside") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Electro-Magic Tools"); + return tt; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 1, 1, 0); + int tTotalLength = Math.min(MAX_LENGTH, stackSize.stackSize + 2); + for (int i = 1; i < tTotalLength; i++) { + buildPiece(STRUCTURE_PIECE_LATER_HINT, stackSize, hintsOnly, 1, 1, -i); + } + buildPiece(STRUCTURE_PIECE_LAST, stackSize, hintsOnly, 0, 1, -(tTotalLength - 1)); + } +} diff --git a/src/main/java/emt/util/EMTCraftingAspects.java b/src/main/java/emt/util/EMTCraftingAspects.java index 70512d7..cfefa5e 100644 --- a/src/main/java/emt/util/EMTCraftingAspects.java +++ b/src/main/java/emt/util/EMTCraftingAspects.java @@ -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); } diff --git a/src/main/java/emt/util/EMTResearchAspects.java b/src/main/java/emt/util/EMTResearchAspects.java index b415efe..d2ae7aa 100644 --- a/src/main/java/emt/util/EMTResearchAspects.java +++ b/src/main/java/emt/util/EMTResearchAspects.java @@ -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); } diff --git a/src/main/resources/assets/emt/lang/en_US.lang b/src/main/resources/assets/emt/lang/en_US.lang index da645b5..5edb002 100644 --- a/src/main/resources/assets/emt/lang/en_US.lang +++ b/src/main/resources/assets/emt/lang/en_US.lang @@ -379,3 +379,7 @@ emt.text.Quantum Wings=After exploring all the possibilities of nanotechnologies emt.rsname.Infused Quantum Armor=Infused Quantum Сhestplate. emt.tag.Infused Quantum Armor=The last step is here... emt.text.Infused Quantum Armor=You had been nothing to do and you decided to do something useful. You had an idea in your head of making armor which you can fasten the wings or backpack for being protected in flight. Take the wings or backpack in your hands and sit down to put their on armor. To remove them, hold Shift + "Unequip"(see in options). + +emt.rsname.ResearchCompleter=Automated Research +emt.tag.ResearchCompleter=No more ordo spam +emt.text.ResearchCompleter=It was fun at first, but you've decided it's time to find a better way to handle all this research. By mixing technology and magic you have come up with a multiblock that can complete a research note by itself.

To function, it needs nodes to be placed in the center of the structure and will slowly destroy them while running. Node stabilizers are optional but recommended for keeping so many nodes close together without them destroying each other. \ No newline at end of file