From 4b237c95ac70f814d475c1d00e9aecf8685ce1ad Mon Sep 17 00:00:00 2001 From: DianeXD <64360468+DianeXD@users.noreply.github.com> Date: Tue, 10 May 2022 01:01:06 +0800 Subject: Add Large Essentia Smeltery (#38) * Add Large Essentia Smeltery * Add info data * Add Essentia Output Hatch (ME) * fix node power * Bug fix * Solve the problems mentioned * Undo wrong changes --- dependencies.gradle | 1 + .../goodgenerator/blocks/regularBlock/TEBlock.java | 33 +- .../blocks/tileEntity/EssentiaOutputHatch.java | 179 ++++++++ .../blocks/tileEntity/EssentiaOutputHatch_ME.java | 172 ++++++++ .../blocks/tileEntity/LargeEssentiaSmeltery.java | 479 +++++++++++++++++++++ .../java/goodgenerator/crossmod/LoadedList.java | 8 + .../crossmod/thaumcraft/Research.java | 128 ++++++ .../java/goodgenerator/items/MyItemBlocks.java | 8 +- src/main/java/goodgenerator/loader/Loaders.java | 13 + src/main/java/goodgenerator/util/ItemRefer.java | 9 +- .../resources/assets/goodgenerator/lang/en_US.lang | 18 + .../resources/assets/goodgenerator/lang/zh_CN.lang | 17 + .../textures/blocks/essentiaFilterCasing.png | Bin 0 -> 10067 bytes .../textures/blocks/essentiaOutputHatch.png | Bin 0 -> 8412 bytes .../textures/blocks/essentiaOutputHatch_ME.png | Bin 0 -> 6533 bytes .../blocks/icons/LargeEssentiaSmeltery_Off.png | Bin 0 -> 2379 bytes .../icons/LargeEssentiaSmeltery_Off_GLOW.png | Bin 0 -> 6181 bytes .../blocks/icons/LargeEssentiaSmeltery_On.png | Bin 0 -> 2598 bytes .../blocks/icons/LargeEssentiaSmeltery_On_GLOW.png | Bin 0 -> 7028 bytes 19 files changed, 1051 insertions(+), 14 deletions(-) create mode 100644 src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch.java create mode 100644 src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java create mode 100644 src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java create mode 100644 src/main/resources/assets/goodgenerator/textures/blocks/essentiaFilterCasing.png create mode 100644 src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch.png create mode 100644 src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch_ME.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_On.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_On_GLOW.png diff --git a/dependencies.gradle b/dependencies.gradle index 5067ccfde2..38af523d6c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -19,6 +19,7 @@ dependencies { compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.30:dev') {transitive = false} compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.9:dev') {transitive = false} compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.3.16-GTNH:dev') {transitive = false} runtime('com.github.GTNewHorizons:NewHorizonsCoreMod:1.9.20:dev') runtime('com.github.GTNewHorizons:ForestryMC:4.4.6:dev') diff --git a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java index b33dbffdec..0d4352e4f9 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java @@ -1,6 +1,8 @@ package goodgenerator.blocks.regularBlock; import goodgenerator.blocks.tileEntity.EssentiaHatch; +import goodgenerator.blocks.tileEntity.EssentiaOutputHatch; +import goodgenerator.blocks.tileEntity.EssentiaOutputHatch_ME; import goodgenerator.main.GoodGenerator; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -138,9 +140,16 @@ public class TEBlock extends BlockContainer { @Override public TileEntity createTileEntity(World world, int meta) { - if (index == 1) - return new EssentiaHatch(); - return null; + switch (index) { + case 1: + return new EssentiaHatch(); + case 2: + return new EssentiaOutputHatch(); + case 3: + return new EssentiaOutputHatch_ME(); + default: + return null; + } } @Override @@ -159,17 +168,23 @@ public class TEBlock extends BlockContainer { ((EssentiaHatch) tile).setLockedAspect(tLocked); GT_Utility.sendChatToPlayer(player, String.format(StatCollector.translateToLocal("essentiahatch.chat.0"), tLocked.getLocalizedDescription())); } - } - else { + } else { ((EssentiaHatch) tile).setLockedAspect(null); GT_Utility.sendChatToPlayer(player, StatCollector.translateToLocal("essentiahatch.chat.1")); } world.markBlockForUpdate(x, y, z); return true; - } - else return false; - } - else return false; + } else return false; + } else if (index == 2) { + if (tile instanceof EssentiaOutputHatch) { + ItemStack tItemStack = player.getHeldItem(); + if (tItemStack == null) { + ((EssentiaOutputHatch) tile).clear(); + GT_Utility.sendChatToPlayer(player, StatCollector.translateToLocal("essentiaoutputhatch.chat.0")); + } + return true; + } else return false; + } else return false; } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch.java new file mode 100644 index 0000000000..77d8004446 --- /dev/null +++ b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch.java @@ -0,0 +1,179 @@ +package goodgenerator.blocks.tileEntity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.ForgeDirection; +import thaumcraft.api.TileThaumcraft; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.IAspectContainer; +import thaumcraft.api.aspects.IEssentiaTransport; + +import java.util.Map; + +public class EssentiaOutputHatch extends TileThaumcraft implements IAspectContainer, IEssentiaTransport { + + public static final int CAPACITY = 256; + protected AspectList mAspects = new AspectList(); + + public void clear() { + this.mAspects.aspects.clear(); + } + + @Override + public void markDirty() { + super.markDirty(); + if (this.worldObj.isRemote) return; + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.mAspects.aspects.clear(); + NBTTagList tlist = nbttagcompound.getTagList("Aspects", 69); + for (int j = 0; j < tlist.tagCount(); ++j) { + NBTTagCompound rs = tlist.getCompoundTagAt(j); + if (rs.hasKey("key")) mAspects.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount")); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + Aspect[] aspectA = this.mAspects.getAspects(); + NBTTagList nbtTagList = new NBTTagList(); + for (Aspect aspect : aspectA) { + if (aspect != null) { + NBTTagCompound f = new NBTTagCompound(); + f.setString("key", aspect.getTag()); + f.setInteger("amount", this.mAspects.getAmount(aspect)); + nbtTagList.appendTag(f); + } + } + nbttagcompound.setTag("Aspects", nbtTagList); + } + + private int remainingCapacity() { + return CAPACITY - this.getEssentiaAmount(null); + } + + @Override + public AspectList getAspects() { + return this.mAspects; + } + + @Override + public void setAspects(AspectList aspectList) { + for (Map.Entry entry : aspectList.aspects.entrySet()) { + this.addEssentia(entry.getKey(), entry.getValue(), null); + } + } + + @Override + public boolean doesContainerAccept(Aspect var1) { + return true; + } + + @Override + public int addToContainer(Aspect aspect, int amount) { + int remaining = 0; + if (amount > this.remainingCapacity()) { + remaining = amount - this.remainingCapacity(); + this.mAspects.add(aspect, this.remainingCapacity()); + } else this.mAspects.add(aspect, amount); + this.markDirty(); + return remaining; + } + + @Override + public boolean takeFromContainer(Aspect aspect, int amount) { + if (this.mAspects != null && this.mAspects.getAmount(aspect) >= amount) { + this.mAspects.remove(aspect, amount); + this.markDirty(); + return true; + } else return false; + } + + @Override + public boolean takeFromContainer(AspectList aspects) { + return true; + } + + @Override + public boolean doesContainerContainAmount(Aspect aspect, int amount) { + return this.mAspects.getAmount(aspect) >= amount; + } + + @Override + public boolean doesContainerContain(AspectList aspectList) { + for (Map.Entry entry : aspectList.aspects.entrySet()) { + if (this.mAspects.getAmount(entry.getKey()) < entry.getValue()) return false; + } + return true; + } + + @Override + public int containerContains(Aspect aspect) { + return this.mAspects.getAmount(aspect); + } + + @Override + public boolean isConnectable(ForgeDirection var1) { + return true; + } + + @Override + public boolean canInputFrom(ForgeDirection var1) { + return false; + } + + @Override + public boolean canOutputTo(ForgeDirection var1) { + return true; + } + + @Override + public void setSuction(Aspect var1, int var2) { + } + + @Override + public Aspect getSuctionType(ForgeDirection var1) { + return null; + } + + @Override + public int getSuctionAmount(ForgeDirection var1) { + return 0; + } + + @Override + public int takeEssentia(Aspect aspect, int amount, ForgeDirection var3) { + return this.takeFromContainer(aspect, amount) ? amount : 0; + } + + @Override + public int addEssentia(Aspect aspect, int amount, ForgeDirection direction) { + return amount - addToContainer(aspect, amount); + } + + @Override + public Aspect getEssentiaType(ForgeDirection var1) { + return this.mAspects.size() > 0 ? this.mAspects.getAspects()[0] : null; + } + + @Override + public int getEssentiaAmount(ForgeDirection var1) { + return this.mAspects.visSize(); + } + + @Override + public int getMinimumSuction() { + return 0; + } + + @Override + public boolean renderExtendedTube() { + return true; + } +} diff --git a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java new file mode 100644 index 0000000000..8f2c4c920f --- /dev/null +++ b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java @@ -0,0 +1,172 @@ +package goodgenerator.blocks.tileEntity; + +import appeng.api.config.Actionable; +import appeng.api.networking.GridFlags; +import appeng.api.networking.IGrid; +import appeng.api.networking.IGridNode; +import appeng.api.networking.security.IActionHost; +import appeng.api.networking.security.MachineSource; +import appeng.api.util.AECableType; +import appeng.api.util.DimensionalCoord; +import appeng.me.helpers.AENetworkProxy; +import appeng.me.helpers.IGridProxyable; +import appeng.tile.TileEvent; +import appeng.tile.events.TileEventType; +import cpw.mods.fml.common.Optional; +import goodgenerator.util.ItemRefer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumicenergistics.api.grid.IEssentiaGrid; +import thaumicenergistics.api.grid.IMEEssentiaMonitor; + +import java.util.Map; + + +@Optional.InterfaceList(value = { + @Optional.Interface(iface = "appeng.api.networking.security.IActionHost", modid = "appliedenergistics2", striprefs = true), + @Optional.Interface(iface = "appeng.me.helpers.IGridProxyable", modid = "appliedenergistics2", striprefs = true),}) +public class EssentiaOutputHatch_ME extends EssentiaOutputHatch implements IActionHost, IGridProxyable { + + private AENetworkProxy gridProxy = null; + private IMEEssentiaMonitor monitor = null; + private MachineSource asMachineSource = new MachineSource(this); + + @Override + public void updateEntity() { + getProxy(); + super.updateEntity(); + } + + @Override + public void invalidate() { + super.invalidate(); + this.invalidateAE(); + } + + @Override + public void onChunkUnload() { + super.onChunkUnload(); + this.onChunkUnloadAE(); + } + + @TileEvent(TileEventType.WORLD_NBT_READ) + @Optional.Method(modid = "appliedenergistics2") + public void readFromNBT_AENetwork(final NBTTagCompound data) { + AENetworkProxy gp = getProxy(); + if (gp != null) + getProxy().readFromNBT(data); + } + + @TileEvent(TileEventType.WORLD_NBT_WRITE) + @Optional.Method(modid = "appliedenergistics2") + public void writeToNBT_AENetwork(final NBTTagCompound data) { + AENetworkProxy gp = getProxy(); + if (gp != null) + gp.writeToNBT(data); + } + + @Optional.Method(modid = "appliedenergistics2") + void onChunkUnloadAE() { + AENetworkProxy gp = getProxy(); + if (gp != null) + gp.onChunkUnload(); + } + + @Optional.Method(modid = "appliedenergistics2") + void invalidateAE() { + AENetworkProxy gp = getProxy(); + if (gp != null) + gp.invalidate(); + } + + @Optional.Method(modid = "appliedenergistics2") + public IGridNode getGridNode(ForgeDirection forgeDirection) { + AENetworkProxy gp = getProxy(); + return gp != null ? gp.getNode() : null; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public void gridChanged() { + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AECableType getCableConnectionType(ForgeDirection forgeDirection) { + return AECableType.SMART; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public void securityBreak() { + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AENetworkProxy getProxy() { + if (gridProxy == null) { + gridProxy = new AENetworkProxy(this, "proxy", ItemRefer.Essentia_Output_Hatch_ME.get(1), true); + gridProxy.onReady(); + gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); + } + return this.gridProxy; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public DimensionalCoord getLocation() { + return new DimensionalCoord(this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public IGridNode getActionableNode() { + AENetworkProxy gp = getProxy(); + return gp != null ? gp.getNode() : null; + } + + @Override + public boolean takeFromContainer(AspectList aspects) { + return false; + } + + @Override + public boolean takeFromContainer(Aspect aspect, int amount) { + return false; + } + + @Override + public int addEssentia(Aspect aspect, int amount, ForgeDirection side) { + return this.addEssentia(aspect, amount, side, Actionable.MODULATE); + } + + public int addEssentia(Aspect aspect, int amount, ForgeDirection side, Actionable mode) { + long rejectedAmount = amount; + if (this.getEssentiaMonitor()) { + rejectedAmount = this.monitor.injectEssentia(aspect, amount, mode, this.getMachineSource(), true); + } + + long acceptedAmount = (long) amount - rejectedAmount; + return (int) acceptedAmount; + } + + protected boolean getEssentiaMonitor() { + IMEEssentiaMonitor essentiaMonitor = null; + IGrid grid = null; + IGridNode node = this.getProxy().getNode(); + + if (node != null) { + grid = node.getGrid(); + if (grid != null) essentiaMonitor = grid.getCache(IEssentiaGrid.class); + } + this.monitor = essentiaMonitor; + return (this.monitor != null); + } + + public MachineSource getMachineSource() { + return this.asMachineSource; + } + +} diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java new file mode 100644 index 0000000000..b3b89e1d4a --- /dev/null +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java @@ -0,0 +1,479 @@ +package goodgenerator.blocks.tileEntity; + +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import goodgenerator.blocks.tileEntity.base.GT_MetaTileEntity_TooltipMultiBlockBase_EM; +import goodgenerator.crossmod.LoadedList; +import goodgenerator.loader.Loaders; +import goodgenerator.util.DescTextLocalization; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.visnet.VisNetHandler; +import thaumcraft.common.config.ConfigBlocks; +import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager; + +import java.util.ArrayList; +import java.util.Map; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBase_EM implements IConstructable { + + private static final IIconContainer textureFontOn = new Textures.BlockIcons.CustomIcon("icons/LargeEssentiaSmeltery_On"); + private static final IIconContainer textureFontOn_Glow = new Textures.BlockIcons.CustomIcon("icons/LargeEssentiaSmeltery_On_GLOW"); + private static final IIconContainer textureFontOff = new Textures.BlockIcons.CustomIcon("icons/LargeEssentiaSmeltery_Off"); + private static final IIconContainer textureFontOff_Glow = new Textures.BlockIcons.CustomIcon("icons/LargeEssentiaSmeltery_Off_GLOW"); + 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 int CASING_INDEX = 1536; + private static final int MAX_STRUCTURE_LENGTH = 8; + private static final int DEFAULT_STRUCTURE_LENGTH = 3; + private static final int MAX_CONFIGURABLE_LENGTH = MAX_STRUCTURE_LENGTH - DEFAULT_STRUCTURE_LENGTH; + + private static final int RECIPE_DURATION = 32; + private static final int RECIPE_EUT = 480; + private static final float NODE_COST_MULTIPLIER = 1.15f; + + public AspectList mOutputAspects = new AspectList(); + protected int mCasing = 0; + protected double mParallel = 0; + protected int nodePower = 0; + protected int nodePurificationEfficiency = 0; + protected int nodeIncrease = 0; + + private IStructureDefinition multiDefinition = null; + private ArrayList mEssentiaOutputHatches = new ArrayList<>(); + private int pTier = 0; + private XSTR xstr = new XSTR(); + + public LargeEssentiaSmeltery(String name) { + super(name); + } + + public LargeEssentiaSmeltery(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + @Override + public void construct(ItemStack itemStack, boolean hintsOnly) { + structureBuild_EM(STRUCTURE_PIECE_FIRST, 2, 2, 0, itemStack, hintsOnly); + //default + structureBuild_EM(STRUCTURE_PIECE_LATER, 2, 2, -1, itemStack, hintsOnly); + structureBuild_EM(STRUCTURE_PIECE_LATER, 2, 2, -2, itemStack, hintsOnly); + int len = itemStack.stackSize; + if (len > MAX_CONFIGURABLE_LENGTH) len = MAX_CONFIGURABLE_LENGTH; + structureBuild_EM(STRUCTURE_PIECE_LAST, 2, 2, -len - 3, itemStack, hintsOnly); + while (len > 0) { + structureBuild_EM(STRUCTURE_PIECE_LATER, 2, 2, -len - 2, itemStack, hintsOnly); + len--; + } + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.mCasing = 0; + this.mParallel = 0; + this.pTier = 0; + this.nodePower = 0; + this.nodePurificationEfficiency = 0; + this.nodeIncrease = 0; + this.mEssentiaOutputHatches.clear(); + + if (!structureCheck_EM(STRUCTURE_PIECE_FIRST, 2, 2, 0)) return false; + if (!structureCheck_EM(STRUCTURE_PIECE_LATER, 2, 2, -1)) return false; + if (!structureCheck_EM(STRUCTURE_PIECE_LATER, 2, 2, -2)) return false; + int len = 2; + while (structureCheck_EM(STRUCTURE_PIECE_LATER, 2, 2, -len - 1)) len++; + if (len > MAX_STRUCTURE_LENGTH - 1 || len < DEFAULT_STRUCTURE_LENGTH) return false; + if (!structureCheck_EM(STRUCTURE_PIECE_LAST, 2, 2, -len - 1)) return false; + if (this.mCasing >= 24 && + this.mMaintenanceHatches.size() == 1 && + this.mInputBusses.size() >= 1 && + this.mEssentiaOutputHatches.size() >= 1) { + this.mParallel = Math.floor(this.mParallel += 1 << this.pTier); + return true; + } + return false; + } + + @Override + public IStructureDefinition getStructure_EM() { + if (this.multiDefinition == null) { + this.multiDefinition = StructureDefinition + .builder() + .addShape("first", transpose(new String[][]{{" A "}, {" AAA "}, {"AA~AA"}, {" AAA "}, {" A "}})) + .addShape("later", transpose(new String[][]{{" ABA "}, {"AECEA"}, {"D---D"}, {"AEFEA"}, {" AAA "}})) + .addShape("last", transpose(new String[][]{{" A "}, {" AAA "}, {"AAAAA"}, {" AAA "}, {" A "}})) + .addElement('C', ofBlock(Loaders.essentiaFilterCasing, 0)) + .addElement('D', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) + .addElement('F', LoadedList.THAUMIC_BASES ? ofBlock(Block.getBlockFromName("thaumicbases:advAlchFurnace"), 0) : ofBlock(ConfigBlocks.blockStoneDevice, 0)) + .addElement('E', ofChain( + onElementPass(x -> x.onEssentiaCellFound(0), + ofBlock(Loaders.essentiaCell, 0)), + onElementPass(x -> x.onEssentiaCellFound(1), + ofBlock(Loaders.essentiaCell, 1)), + onElementPass(x -> x.onEssentiaCellFound(2), + ofBlock(Loaders.essentiaCell, 2)), + onElementPass(x -> x.onEssentiaCellFound(3), + ofBlock(Loaders.essentiaCell, 3)))) + .addElement('A', ofChain( + ofHatchAdder(LargeEssentiaSmeltery::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(LargeEssentiaSmeltery::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(LargeEssentiaSmeltery::addEnergyHatchToMachineList, CASING_INDEX, 1), + ofTileAdder(LargeEssentiaSmeltery::addEssentiaOutputHatchToMachineList, Loaders.magicCasing, 0), + onElementPass(LargeEssentiaSmeltery::onCasingFound, ofBlock(Loaders.magicCasing, 0)))) + .addElement('B', ofHatchAdder(LargeEssentiaSmeltery::addMufflerToMachineList, CASING_INDEX, 2)) + .build(); + } + return this.multiDefinition; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Essentia Smeltery") + .addInfo("Controller block for the Large Essentia Smeltery") + .addInfo("Necessary evil.") + .addInfo("Advanced Essentia smelting technology.") + .addInfo("Max parallel dictated by structure size and Essentia Diffusion Cell tier") + .addInfo("Energy Hatch tier: HV+") + .addInfo("You can find more information about this machine in the Thaumonomicon.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addController("Front center") + .addCasingInfo("Magic Casing", 24) + .addMaintenanceHatch("Hint block with dot 1") + .addInputBus("Hint block with dot 1") + .addInputHatch("Hint block with dot 1") + .addEnergyHatch("Hint block with dot 1") + .addOtherStructurePart("Essentia Output Hatch", "Hint block with dot 1") + .addMufflerHatch("Hint block with dot 2") + .toolTipFinisher("Good Generator"); + return tt; + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return DescTextLocalization.addText("LargeEssentiaSmeltery.hint", 8); + } + + @Override + public String[] getInfoData() { + String[] info = super.getInfoData(); + info[8] = "Node Power: " + EnumChatFormatting.RED + this.nodePower + EnumChatFormatting.RESET + " Purification Efficiency: " + EnumChatFormatting.AQUA + this.nodePurificationEfficiency + "%" + EnumChatFormatting.RESET + " Speed Up: " + EnumChatFormatting.GRAY + this.nodeIncrease + "%" + EnumChatFormatting.RESET; + return info; + } + + @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.of(textureFontOn), + TextureFactory.builder().addIcon(textureFontOn_Glow).glow().build() + }; + else return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.of(textureFontOff), + TextureFactory.builder().addIcon(textureFontOff_Glow).glow().build() + }; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + } + + protected void onCasingFound() { + this.mCasing++; + } + + protected void onEssentiaCellFound(int tier) { + this.mParallel += (1 << tier) * 0.25f; + this.pTier = Math.max(this.pTier, tier); + } + + private boolean addEnergyHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + if (((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier < 3) return false; + ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) { + ((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.eEnergyMulti.add(((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity)); + } else { + return false; + } + } + } + + private boolean addEssentiaOutputHatchToMachineList(TileEntity aTileEntity) { + if (aTileEntity instanceof EssentiaOutputHatch) { + return this.mEssentiaOutputHatches.add((EssentiaOutputHatch) aTileEntity); + } + return false; + } + + @Override + protected void runMachine(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!this.isFullPower()) return; + super.runMachine(aBaseMetaTileEntity, aTick); + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + if (!isFullPower()) return false; + + ArrayList tInputList = getStoredInputs(); +// ArrayList tFluidList = getStoredFluids(); + + if (tInputList.size() == 0) return false; + + int p = (int) this.mParallel; + for (int i = tInputList.size() - 1; i >= 0; i--) { + ItemStack itemStack = tInputList.get(i); + int stackSize = itemStack.stackSize; + int sur = p - stackSize; + + if (sur > 0) { + p -= stackSize; + this.mOutputAspects.add(getEssentia(itemStack, stackSize)); + if (!depleteInput(itemStack)) itemStack.stackSize = 0; + } else if (sur == 0) { + this.mOutputAspects.add(getEssentia(itemStack, stackSize)); + if (!depleteInput(itemStack)) itemStack.stackSize = 0; + break; + } else { + this.mOutputAspects.add(getEssentia(itemStack, p)); + itemStack.stackSize -= p; + break; + } + } + + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + + final World WORLD = this.getBaseMetaTileEntity().getWorld(); + int x = this.getBaseMetaTileEntity().getXCoord(); + int y = this.getBaseMetaTileEntity().getYCoord(); + int z = this.getBaseMetaTileEntity().getZCoord(); + + this.drainNodePower(WORLD, x, y, z); + this.nodePower -= expectedPower(); + + calculatePerfectOverclockedNessMulti(RECIPE_EUT, (int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)), 1, Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM())); + + this.updateSlots(); + if (this.mEUt > 0) this.mEUt = -this.mEUt; + return true; + } + + private AspectList getEssentia(ItemStack itemStack, int amount) { + AspectList aspectList = new AspectList(); + AspectList aspects = ThaumcraftCraftingManager.getObjectTags(itemStack); + if (aspects != null && aspects.size() != 0 && aspects.getAspects()[0] != null) { + for (int i = 0; i < amount; i++) aspectList.add(aspects); + } else aspectList.add(Aspect.ENTROPY, amount); + return aspectList; + } + + private void fillEssentiaOutputHatch() { + for (EssentiaOutputHatch outputHatch : this.mEssentiaOutputHatches) { + for (Map.Entry entry : this.mOutputAspects.aspects.entrySet()) { + Aspect aspect = entry.getKey(); + int amount = entry.getValue(); + this.mOutputAspects.remove(aspect, outputHatch.addEssentia(aspect, amount, null)); + } + } + this.mOutputAspects.aspects.clear(); + } + + private int expectedPower() { + return (int) (Math.pow(this.getMaxEnergyInputTier_EM(), 2) * NODE_COST_MULTIPLIER); + } + + private boolean isFullPower() { + return this.nodePower > expectedPower(); + } + + private void generateFluxGas(World world, int x, int y, int z) { + world.setBlock(x, y, z, ConfigBlocks.blockFluxGas, 8, 3); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setDouble("mParallel", this.mParallel); + aNBT.setDouble("nodePower", this.nodePower); + aNBT.setDouble("nodePurificationEfficiency", this.nodePurificationEfficiency); + aNBT.setDouble("nodeIncrease", this.nodeIncrease); + + Aspect[] aspectA = this.mOutputAspects.getAspects(); + NBTTagList nbtTagList = new NBTTagList(); + for (Aspect aspect : aspectA) { + if (aspect != null) { + NBTTagCompound f = new NBTTagCompound(); + f.setString("key", aspect.getTag()); + f.setInteger("amount", this.mOutputAspects.getAmount(aspect)); + nbtTagList.appendTag(f); + } + } + aNBT.setTag("Aspects", nbtTagList); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + this.mParallel = aNBT.getDouble("mParallel"); + this.nodePower = aNBT.getInteger("nodePower"); + this.nodePurificationEfficiency = aNBT.getInteger("nodePurificationEfficiency"); + this.nodeIncrease = aNBT.getInteger("nodeIncrease"); + + this.mOutputAspects.aspects.clear(); + NBTTagList tlist = aNBT.getTagList("Aspects", 69); + for (int j = 0; j < tlist.tagCount(); ++j) { + NBTTagCompound rs = tlist.getCompoundTagAt(j); + if (rs.hasKey("key")) + this.mOutputAspects.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount")); + } + super.loadNBTData(aNBT); + } + + @Override + protected void addClassicOutputs_EM() { + super.addClassicOutputs_EM(); + fillEssentiaOutputHatch(); + } + + @Override + public void stopMachine() { + super.stopMachine(); + this.mOutputAspects.aspects.clear(); + } + + private void drainNodePower(World world, int x, int y, int z) { + int power = this.expectedPower(); + if (this.nodePower < power * 10) { + this.nodePower += VisNetHandler.drainVis(world, x, y, z, Aspect.WATER, power); + this.nodePower += VisNetHandler.drainVis(world, x, y, z, Aspect.FIRE, power); + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aTick % 5 == 0 && this.mMachine) { + final World WORLD = this.getBaseMetaTileEntity().getWorld(); + int x = this.getBaseMetaTileEntity().getXCoord(); + int y = this.getBaseMetaTileEntity().getYCoord(); + int z = this.getBaseMetaTileEntity().getZCoord(); + + this.drainNodePower(WORLD, x, y, z); + + this.nodePurificationEfficiency = Math.max(0, this.nodePurificationEfficiency - 1); + if (this.nodePurificationEfficiency < 100) { + this.nodePurificationEfficiency = (int) Math.min(100, this.nodePurificationEfficiency + Math.ceil(VisNetHandler.drainVis(WORLD, x, y, z, Aspect.ORDER, 100) * 0.05)); + } + + this.nodeIncrease = Math.min(100, VisNetHandler.drainVis(WORLD, x, y, z, Aspect.ENTROPY, 125)); + } + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + this.nodePurificationEfficiency = Math.max(0, this.nodePurificationEfficiency - 5); + if (xstr.nextInt(20) == 0) { + if (xstr.nextInt(100) < Math.max(100 - this.nodePurificationEfficiency, 0)) { + final World WORLD = this.getBaseMetaTileEntity().getWorld(); + GT_MetaTileEntity_Hatch_Muffler mufflerHatch = this.mMufflerHatches.get(xstr.next(this.mMufflerHatches.size())); + int x = mufflerHatch.getBaseMetaTileEntity().getXCoord(); + int y = mufflerHatch.getBaseMetaTileEntity().getYCoord(); + int z = mufflerHatch.getBaseMetaTileEntity().getZCoord(); + + ForgeDirection facing = ForgeDirection.getOrientation(mufflerHatch.getBaseMetaTileEntity().getFrontFacing()); + switch (facing) { + case SOUTH: + z += 1; + break; + case NORTH: + z -= 1; + break; + case WEST: + x -= 1; + break; + case EAST: + x += 1; + break; + default: + y += 1; + } + if (WORLD.getBlock(x, y, z) instanceof BlockAir) generateFluxGas(WORLD, x, y, z); + } + } + return super.onRunningTick(aStack); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public int getPollutionPerSecond(ItemStack aStack) { + return 22 * (100 - this.nodePurificationEfficiency); + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new LargeEssentiaSmeltery(this.mName); + } + + @Override + protected void maintenance_EM() { + super.maintenance_EM(); + } + +} diff --git a/src/main/java/goodgenerator/crossmod/LoadedList.java b/src/main/java/goodgenerator/crossmod/LoadedList.java index 372b3004ab..f5a30509f8 100644 --- a/src/main/java/goodgenerator/crossmod/LoadedList.java +++ b/src/main/java/goodgenerator/crossmod/LoadedList.java @@ -8,12 +8,20 @@ public class LoadedList { public static boolean GTNH_CORE; public static boolean BOTDUSTRIES; public static boolean EXTRA_CELLS; + public static boolean THAUMIC_BASES; + public static boolean THAUMIC_TINKERER; + public static boolean AUTOMAGY; + public static boolean WITCHING_GADGETS; public static void init() { GTPP = Loader.isModLoaded("miscutils"); GTNH_CORE = Loader.isModLoaded("dreamcraft"); BOTDUSTRIES = Loader.isModLoaded("botdustries"); EXTRA_CELLS = Loader.isModLoaded("extracells"); + THAUMIC_BASES = Loader.isModLoaded("thaumicbases"); + THAUMIC_TINKERER = Loader.isModLoaded("ThaumicTinkerer"); + AUTOMAGY = Loader.isModLoaded("Automagy"); + WITCHING_GADGETS = Loader.isModLoaded("WitchingGadgets"); } } diff --git a/src/main/java/goodgenerator/crossmod/thaumcraft/Research.java b/src/main/java/goodgenerator/crossmod/thaumcraft/Research.java index 72b6918521..274ea5643a 100644 --- a/src/main/java/goodgenerator/crossmod/thaumcraft/Research.java +++ b/src/main/java/goodgenerator/crossmod/thaumcraft/Research.java @@ -608,5 +608,133 @@ public class Research{ "research.ESSENTIA_UPGRADE_ELECTRIC.page.1" } ); + + ItemStack nodeLinkDevice = LoadedList.THAUMIC_BASES ? GT_ModHandler.getModItem("thaumicbases", "nodeLinker", 1, 0) : new ItemStack(ConfigBlocks.blockStoneDevice, 1, 11); + ItemStack alchemicalFurnace = LoadedList.THAUMIC_BASES ? GT_ModHandler.getModItem("thaumicbases", "advAlchFurnace", 1, 0) : new ItemStack(ConfigBlocks.blockStoneDevice, 1, 0); + ItemStack nitor = LoadedList.THAUMIC_TINKERER ? GT_ModHandler.getModItem("ThaumicTinkerer", "brightNitor", 1, 0) : new ItemStack(ConfigItems.itemResource, 1, 1); + ItemStack alchemicalBoiler = LoadedList.AUTOMAGY ? GT_ModHandler.getModItem("Automagy", "blockBoiler", 1, 0) : new ItemStack(ConfigBlocks.blockStoneDevice, 1, 1); + ItemStack essentiaLocus = LoadedList.AUTOMAGY ? GT_ModHandler.getModItem("Automagy", "blockEssentiaLocus", 1, 0) : new ItemStack(ConfigBlocks.blockJar, 1, 1); + ItemStack thauminiteBlock = LoadedList.THAUMIC_BASES ? GT_ModHandler.getModItem("thaumicbases", "thauminiteBlock", 1, 0) : new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4); + GregTech_API.sThaumcraftCompat.addResearch("ESSENTIA_SMELTERY", + "Large Essentia Smeltery", + "You need a bigger boat.", + new String[]{"INFUSION"}, + "ARTIFICE", + ItemRefer.Large_Essentia_Smeltery.get(1), + 4, 0, -16, 3, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 10) + ), + null, + new Object[]{ + "research.ESSENTIA_SMELTERY.page.0", + GregTech_API.sThaumcraftCompat.addInfusionRecipe( + "ESSENTIA_SMELTERY", + ItemList.Casing_Firebox_TungstenSteel.get(1), + new ItemStack[]{ + nodeLinkDevice, + nitor, + alchemicalFurnace, + essentiaLocus, + alchemicalBoiler, + new ItemStack(ConfigBlocks.blockCrystal, 1, 1), + new ItemStack(ConfigBlocks.blockMetalDevice, 1, 3), + ItemList.Electric_Piston_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.FierySteel, 1L), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1L), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1L), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1L), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1L) + }, + ItemRefer.Large_Essentia_Smeltery.get(1), + 16, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256) + ) + ), + "research.ESSENTIA_SMELTERY.page.1", + GregTech_API.sThaumcraftCompat.addInfusionRecipe( + "ESSENTIA_GENERATOR", + ItemList.Hatch_Output_HV.get(1), + new ItemStack[]{ + new ItemStack(ConfigBlocks.blockJar, 1), + ItemRefer.Magic_Casing.get(1), + new ItemStack(ConfigBlocks.blockTube, 1), + ItemList.Electric_Pump_MV.get(1L) + }, + ItemRefer.Essentia_Output_Hatch.get(1), + 6, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 64), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 32), + new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 32) + ) + ), + "research.ESSENTIA_SMELTERY.page.2", + addArcaneCraftingRecipe( + "ESSENTIA_SMELTERY", + ItemRefer.Essentia_Filter_Casing.get(1), + new AspectList().add(Aspect.AIR, 70).add(Aspect.EARTH, 70).add(Aspect.FIRE, 70).add(Aspect.WATER, 70).add(Aspect.ORDER, 70).add(Aspect.ENTROPY, 70), + "ABA", "CDC", "EFE", + 'A', new ItemStack(ConfigBlocks.blockTube, 1, 3), + 'B', new ItemStack(ConfigBlocks.blockStoneDevice, 1, 14), + 'C', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Void, 1), + 'D', new ItemStack(GregTech_API.sBlockCasings3, 1, 11), + 'E', GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.NetherStar, 1), + 'F', thauminiteBlock + ) + } + ); + + ItemStack essentiaPump = LoadedList.WITCHING_GADGETS ? GT_ModHandler.getModItem("WitchingGadgets", "WG_MetalDevice", 1, 0) : new ItemStack(ConfigBlocks.blockTube, 1, 4); + ItemStack inter = LoadedList.THAUMIC_TINKERER ? GT_ModHandler.getModItem("ThaumicTinkerer", "interface", 1, 0) : new ItemStack(ConfigItems.itemResource, 1, 15); + GregTech_API.sThaumcraftCompat.addResearch("ESSENTIA_OUTPUT_HATCH_ME", + "Essentia Output Hatch (ME)", + "It must exist.", + new String[]{"INFUSION"}, + "ARTIFICE", + ItemRefer.Essentia_Output_Hatch_ME.get(1), + 3, 0, -15, 3, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 10), + new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 10) + ), + null, + new Object[]{ + "research.ESSENTIA_OUTPUT_HATCH_ME.page.0", + GregTech_API.sThaumcraftCompat.addInfusionRecipe( + "ESSENTIA_OUTPUT_HATCH_ME", + ItemRefer.Essentia_Output_Hatch.get(1), + new ItemStack[]{ + GT_ModHandler.getModItem("thaumicenergistics", "thaumicenergistics.block.essentia.provider", 1), + new ItemStack(ConfigBlocks.blockEssentiaReservoir,1,0), + essentiaPump, + inter, + }, + ItemRefer.Essentia_Output_Hatch_ME.get(1), + 8, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 256), + new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 256) + ) + ) + } + ); } } diff --git a/src/main/java/goodgenerator/items/MyItemBlocks.java b/src/main/java/goodgenerator/items/MyItemBlocks.java index d1b4bbe4ec..abb55e7f1d 100644 --- a/src/main/java/goodgenerator/items/MyItemBlocks.java +++ b/src/main/java/goodgenerator/items/MyItemBlocks.java @@ -1,6 +1,7 @@ package goodgenerator.items; import goodgenerator.blocks.regularBlock.TEBlock; +import goodgenerator.blocks.tileEntity.EssentiaOutputHatch; import goodgenerator.util.CharExchanger; import goodgenerator.util.DescTextLocalization; import cpw.mods.fml.relauncher.Side; @@ -71,8 +72,11 @@ public class MyItemBlocks extends ItemBlock { TEBlock tile = (TEBlock) Block.getBlockFromItem(p_77624_1_.getItem()); if (tile.getIndex() == 1) p_77624_3_.addAll(Arrays.asList(DescTextLocalization.addText("EssentiaHatch.tooltip", 2))); - } - else p_77624_3_.add(mNoTileEntityToolTip); + if (tile.getIndex() == 2) { + p_77624_3_.add(StatCollector.translateToLocal("EssentiaOutputHatch.tooltip.0")); + p_77624_3_.add(StatCollector.translateToLocal("EssentiaOutputHatch.tooltip.1") + " " + EssentiaOutputHatch.CAPACITY); + } + } else p_77624_3_.add(mNoTileEntityToolTip); if (Block.getBlockFromItem(p_77624_1_.getItem()).equals(yottaFluidTankCell)) { StringBuilder cap = new StringBuilder(); diff --git a/src/main/java/goodgenerator/loader/Loaders.java b/src/main/java/goodgenerator/loader/Loaders.java index f53598eb51..b6ac0d18f6 100644 --- a/src/main/java/goodgenerator/loader/Loaders.java +++ b/src/main/java/goodgenerator/loader/Loaders.java @@ -92,7 +92,10 @@ public class Loaders { public static final Block pressureResistantWalls = new Casing("pressureResistantWalls", new String[]{GoodGenerator.MOD_ID+":pressureResistantWalls"}); public static final Block preciseUnitCasing = new Casing("preciseUnitCasing", new String[]{GoodGenerator.MOD_ID+":preciseUnitCasing/1", GoodGenerator.MOD_ID+":preciseUnitCasing/2", GoodGenerator.MOD_ID+":preciseUnitCasing/3"}); public static final Block compactFusionCoil = new Casing("compactFusionCoil", new String[]{GoodGenerator.MOD_ID+":fuison/1", GoodGenerator.MOD_ID+":fuison/2", GoodGenerator.MOD_ID+":fuison/3", GoodGenerator.MOD_ID+":fuison/4", GoodGenerator.MOD_ID+":fuison/5"}); + public static final Block essentiaFilterCasing = new Casing("essentiaFilterCasing", new String[]{GoodGenerator.MOD_ID + ":essentiaFilterCasing"}); public static Block essentiaHatch; + public static Block essentiaOutputHatch; + public static Block essentiaOutputHatch_ME; public static ItemStack MAR; public static ItemStack FRF; @@ -105,6 +108,7 @@ public class Loaders { public static ItemStack SCTurbine; public static ItemStack XHE; public static ItemStack PA; + public static ItemStack LES; public static ItemStack[] LFC = new ItemStack[5]; public static ItemStack[] NeutronAccelerators = new ItemStack[9]; @@ -198,11 +202,20 @@ public class Loaders { LargeEssentiaEnergyData.processEssentiaData(); GameRegistry.registerItem(upgradeEssentia, "upgradeEssentia", GoodGenerator.MOD_ID); GameRegistry.registerTileEntity(EssentiaHatch.class, "EssentiaHatch"); + GameRegistry.registerTileEntity(EssentiaOutputHatch.class, "EssentiaOutputHatch"); + GameRegistry.registerTileEntity(EssentiaOutputHatch_ME.class, "EssentiaOutputHatch_ME"); Loaders.LEG = new LargeEssentiaGenerator(IDOffset + 1, "LargeEssentiaGenerator", "Large Essentia Generator").getStackForm(1L); + Loaders.LES = new LargeEssentiaSmeltery(IDOffset + 23, "LargeEssentiaSmeltery", "Large Essentia Smeltery").getStackForm(1L); essentiaHatch = new TEBlock("essentiaHatch", new String[]{GoodGenerator.MOD_ID + ":essentiaHatch"}, 1); + essentiaOutputHatch = new TEBlock("essentiaOutputHatch", new String[]{GoodGenerator.MOD_ID + ":essentiaOutputHatch"}, 2); + essentiaOutputHatch_ME = new TEBlock("essentiaOutputHatch_ME", new String[]{GoodGenerator.MOD_ID + ":essentiaOutputHatch_ME"}, 3); GameRegistry.registerBlock(magicCasing, MyItemBlocks.class, "magicCasing"); GameRegistry.registerBlock(essentiaCell, MyItemBlocks.class, "essentiaCell"); GameRegistry.registerBlock(essentiaHatch, MyItemBlocks.class, "essentiaHatch"); + GameRegistry.registerBlock(essentiaOutputHatch, MyItemBlocks.class, "essentiaOutputHatch"); + GameRegistry.registerBlock(essentiaFilterCasing, MyItemBlocks.class, "essentiaFilterCasing"); + GameRegistry.registerBlock(essentiaOutputHatch_ME, MyItemBlocks.class, "essentiaOutputHatch_ME"); + Textures.BlockIcons.casingTexturePages[GoodGeneratorTexturePage][0] = TextureFactory.of(magicCasing); } } diff --git a/src/main/java/goodgenerator/util/ItemRefer.java b/src/main/java/goodgenerator/util/ItemRefer.java index c23ac559c9..5d59bf8fb6 100644 --- a/src/main/java/goodgenerator/util/ItemRefer.java +++ b/src/main/java/goodgenerator/util/ItemRefer.java @@ -1,6 +1,5 @@ package goodgenerator.util; -import goodgenerator.blocks.tileEntity.ExtremeHeatExchanger; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import net.minecraft.block.Block; @@ -127,6 +126,9 @@ public final class ItemRefer { public static ItemRefer Compact_Fusion_Coil_T2 = getItemStack(compactFusionCoil, 2); public static ItemRefer Compact_Fusion_Coil_T3 = getItemStack(compactFusionCoil, 3); public static ItemRefer Compact_Fusion_Coil_T4 = getItemStack(compactFusionCoil, 4); + public static ItemRefer Essentia_Filter_Casing = getItemStack(essentiaFilterCasing); + public static ItemRefer Essentia_Output_Hatch = getItemStack(essentiaOutputHatch); + public static ItemRefer Essentia_Output_Hatch_ME = getItemStack(essentiaOutputHatch_ME); public static ItemRefer Large_Naquadah_Reactor = getItemStack(MAR); public static ItemRefer Naquadah_Fuel_Refinery = getItemStack(FRF); @@ -143,6 +145,7 @@ public final class ItemRefer { public static ItemRefer Compact_Fusion_MK3 = getItemStack(LFC[2]); public static ItemRefer Compact_Fusion_MK4 = getItemStack(LFC[3]); public static ItemRefer Compact_Fusion_MK5 = getItemStack(LFC[4]); + public static ItemRefer Large_Essentia_Smeltery = getItemStack(LES); private Item mItem = null; private Block mBlock = null; @@ -186,8 +189,8 @@ public final class ItemRefer { mItemStack = itemStack; } - public ItemStack get(int amount){ - if (mItem != null ) return new ItemStack(mItem, amount, mMeta); + public ItemStack get(int amount) { + if (mItem != null) return new ItemStack(mItem, amount, mMeta); if (mBlock != null) return new ItemStack(mBlock, amount, mMeta); if (mItemStack != null) return GT_Utility.copyAmount(amount, mItemStack); return new ItemStack(_null_, amount, 0); diff --git a/src/main/resources/assets/goodgenerator/lang/en_US.lang b/src/main/resources/assets/goodgenerator/lang/en_US.lang index 5bc80c834d..677b49c63d 100644 --- a/src/main/resources/assets/goodgenerator/lang/en_US.lang +++ b/src/main/resources/assets/goodgenerator/lang/en_US.lang @@ -38,6 +38,9 @@ compactFusionCoil.1.name=Compact Fusion Coil compactFusionCoil.2.name=Advanced Compact Fusion Coil compactFusionCoil.3.name=Compact Fusion Coil MK-II Prototype compactFusionCoil.4.name=Compact Fusion Coil MK-II Finaltype +essentiaFilterCasing.0.name=Essentia Filter Casing +essentiaOutputHatch.0.name=Essentia Output Hatch +essentiaOutputHatch_ME.0.name=Essentia Output Hatch (ME) #Items item.radiationProtectionPlate.name=Radiation Proof Plate @@ -137,6 +140,8 @@ huiCircuit.tooltip.1=§e76M Processor Units§r huiCircuit.tooltip.2=§aInvalidate RSA§r huiCircuit.tooltip.3=§c56th Mersenne Prime§r huiCircuit.tooltip.4=§5Paradox§r +EssentiaOutputHatch.tooltip.0=Right click it with empty hands to clear the container. +EssentiaOutputHatch.tooltip.1=Capacity: #Fluids fluid.lightlyCrackedNaquadahGas=Lightly Cracked Naquadah Gas @@ -386,6 +391,14 @@ LargeFusion5.hint.5=2 - Output Hatch LargeFusion5.hint.6=3 - Energy Hatch LargeFusion5.hint.7=All Hatches must be UEV or better. LargeFusion5.hint.8=Support TecTech Hatches. +LargeEssentiaSmeltery.hint.0=At least 24x Magic Casings +LargeEssentiaSmeltery.hint.1=At least 12x Essentia Diffusion Cells +LargeEssentiaSmeltery.hint.2=At least 3x Advanced Alchemical Furnace Blocks +LargeEssentiaSmeltery.hint.3=At least 3x Essentia Filter Casings +LargeEssentiaSmeltery.hint.4=0 - Air +LargeEssentiaSmeltery.hint.5=1 - Basic Hatch/Magic Casing +LargeEssentiaSmeltery.hint.6=2 - Muffler Hatch +LargeEssentiaSmeltery.hint.7=Support TecTech Hatches. #Chat largeessentiagenerator.chat= Installed! @@ -397,6 +410,7 @@ yottank.chat.0=Clear the lock filter yottank.chat.1=Lock to %s preciseassembler.chat.0=Precise Mode preciseassembler.chat.1=Normal Mode +essentiaoutputhatch.chat.0=Cleared. #Achievement achievement.gt.blockmachines.nag=Large Naquadah Reactor @@ -473,3 +487,7 @@ research.ESSENTIA_UPGRADE_RADIATION.page.1=Acceptable Aspects:

Radio: 238 research.ESSENTIA_UPGRADE_RADIATION.page.2=Optional Liquid:

Molten Caesium: Efficiency:x2.0

Molten Uranium-235: Efficiency:x3.0

Molten Naquadah: Efficiency:x4.0

Molten Atomic Separation Catalyst: Efficiency:x16.0 research.ESSENTIA_UPGRADE_ELECTRIC.page.0=The ELECTRUM Essentia itself represents electricity!

The higher the voltage of the generator dynamo hatch, the more ELECTRUM will be affected by potential difference and increase the amount of energy. research.ESSENTIA_UPGRADE_ELECTRIC.page.1=Acceptable Aspects: Electrum

The formula to calculate its power:
8x(3.0^Dynamo Hatch Tier)EU +research.ESSENTIA_SMELTERY.page.0=The Advanced Alchemical Furnace is no longer enough to support your Essentia production...

The LES(Large Elemental Smelter) is an advanced version of the Advanced Alchemical Furnace, which consumes electricity and cent-vis to smelt Essentia. +research.ESSENTIA_SMELTERY.page.1=Ignis and Aqua are the basic conditions for the operation of LES. The minimum demand is about the highest Energy Hatch tier^2*1.15cv/work, and the machine can run only after it is satisfied.

Ordo affects the pollution and the generation of Flux Gas (randomly exhaust Flux Gas at the facing of the muffler when smelting Essentia).

Perditio can speed up machine work, up to 200% (100cv/5t). +research.ESSENTIA_SMELTERY.page.2=The Essentia Diffusion Cell tier and structure size only affect the machine parallel, and the max parallel is 64x.

Items without Essentia will be smelted to 1 point of perditio. +research.ESSENTIA_OUTPUT_HATCH_ME.page.0=Someday you will use it...

Be sure to connect to the network. It has no cache! diff --git a/src/main/resources/assets/goodgenerator/lang/zh_CN.lang b/src/main/resources/assets/goodgenerator/lang/zh_CN.lang index 883cea83d2..7d1958787c 100644 --- a/src/main/resources/assets/goodgenerator/lang/zh_CN.lang +++ b/src/main/resources/assets/goodgenerator/lang/zh_CN.lang @@ -38,6 +38,9 @@ compactFusionCoil.1.name=压缩聚变线圈方块 compactFusionCoil.2.name=进阶压缩聚变线圈方块 compactFusionCoil.3.name=压缩聚变线圈方块MK-II原型 compactFusionCoil.4.name=压缩聚变线圈方块MK-II +essentiaFilterCasing.0.name=源质过滤方块 +essentiaOutputHatch.0.name=源质输出仓 +essentiaOutputHatch_ME.0.name=源质输出仓 (ME) #Items item.radiationProtectionPlate.name=防辐射板 @@ -137,6 +140,8 @@ huiCircuit.tooltip.1=§e76M处理单元§r huiCircuit.tooltip.2=§a无效RSA算法§r huiCircuit.tooltip.3=§c第56梅森素数§r huiCircuit.tooltip.4=§5佯谬§r +EssentiaOutputHatch.tooltip.0=空手右键清空容器. +EssentiaOutputHatch.tooltip.1=容量: #Fluids fluid.lightlyCrackedNaquadahGas=轻度裂化硅岩气 @@ -386,6 +391,14 @@ LargeFusion5.hint.5=2 - 输出仓 LargeFusion5.hint.6=3 - 能源仓 LargeFusion5.hint.7=所有仓室必须为UEV以上 LargeFusion5.hint.8=支持TecTech能源仓. +LargeEssentiaSmeltery.hint.0=24x魔法机械方块(至少!) +LargeEssentiaSmeltery.hint.1=12x源质扩散单元(至少!) +LargeEssentiaSmeltery.hint.2=3x高级炼金炉(至少!) +LargeEssentiaSmeltery.hint.3=3x源质过滤方块(至少!) +LargeEssentiaSmeltery.hint.4=0 - 空气 +LargeEssentiaSmeltery.hint.5=1 - 基础仓室/魔法机械方块 +LargeEssentiaSmeltery.hint.6=2 - 消声仓 +LargeEssentiaSmeltery.hint.7=支持TecTech能源仓. #Chat largeessentiagenerator.chat= 已安装! @@ -473,3 +486,7 @@ research.ESSENTIA_UPGRADE_RADIATION.page.1=可用源质:

Radio:238000EU; research.ESSENTIA_UPGRADE_RADIATION.page.2=可选流体:

熔融铯:效率:x2.0

熔融铀-235:效率:x3.0

熔融硅岩:效率:x4.0

熔融原子分离催化剂:效率:x16.0 research.ESSENTIA_UPGRADE_ELECTRIC.page.0=ELECTRUM源质本身就代表了电力!

发电机的动力仓电压越高,ELECTRUM源质被越强的电势差影响,发电量就越高. research.ESSENTIA_UPGRADE_ELECTRIC.page.1=可用源质:Electrum

能量公式:
8x(3.0^动力仓等级)EU +research.ESSENTIA_SMELTERY.page.0=荒古炼金炉已经不足以支撑你的源质生产了...

LES(大型源质冶炼厂)是荒古炼金炉的进阶版,消耗电力和cent-vis冶炼源质. +research.ESSENTIA_SMELTERY.page.1=Ignis与Aqua是LES运行的基本条件,最低需求约为最高能源仓等级^2*1.15cv/每次工作,满足后机器才能运行.

Ordo影响污染、咒波瓦斯生成概率(冶炼源质时随机在消声仓仓口排出咒波瓦斯).

Perditio可以加速机器工作,最高200%(100cv/5t). +research.ESSENTIA_SMELTERY.page.2=扩散单元等级及结构大小仅影响机器并行,最大并行为64x.

不含源质的物品会冶炼出1点perditio. +research.ESSENTIA_OUTPUT_HATCH_ME.page.0=总有一天你会用到它...

务必连接网络使用,它没有缓存! diff --git a/src/main/resources/assets/goodgenerator/textures/blocks/essentiaFilterCasing.png b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaFilterCasing.png new file mode 100644 index 0000000000..fc88af0128 Binary files /dev/null and b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaFilterCasing.png differ diff --git a/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch.png b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch.png new file mode 100644 index 0000000000..cb8ae2931d Binary files /dev/null and b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch.png differ diff --git a/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch_ME.png b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch_ME.png new file mode 100644 index 0000000000..58768ded09 Binary files /dev/null and b/src/main/resources/assets/goodgenerator/textures/blocks/essentiaOutputHatch_ME.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off.png b/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off.png new file mode 100644 index 0000000000..438daa3b97 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off_GLOW.png new file mode 100644 index 0000000000..1ee835a005 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_Off_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/icons/LargeEssentiaSmeltery_On.png b/src/main/resources/assets/gregtech