diff options
author | Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> | 2022-02-20 20:34:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-20 13:34:52 +0100 |
commit | c713272a48dcc5091b680d2a5b41b82c411e2ab6 (patch) | |
tree | 35ab71a061edc7356ae1a3c3e6f7da3e6c3993c5 /src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java | |
parent | 9e3ad3d03eb4b854353549316f9a5b438e95a6da (diff) | |
download | GT5-Unofficial-c713272a48dcc5091b680d2a5b41b82c411e2ab6.tar.gz GT5-Unofficial-c713272a48dcc5091b680d2a5b41b82c411e2ab6.tar.bz2 GT5-Unofficial-c713272a48dcc5091b680d2a5b41b82c411e2ab6.zip |
Large Fusion (#16)
* large fusion structure
* gui stuff for large fusion
* minor fix
* more fusion and coils
* new structure block
* redesign the sturcture
* mk4 compact
* recipes
* oversight
* fix crash with latest tt
* fix PA recipe buttom
* casing tooltip
* nerf the controler and coil recipe
* remove the origin glass
* fix casing amount
* compact mk5
* remove shit
* cache
* no null positionstack
* fix OF in mk5 and balance
* balance
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java')
-rw-r--r-- | src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java new file mode 100644 index 0000000000..76ff59d65d --- /dev/null +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java @@ -0,0 +1,216 @@ +package goodgenerator.blocks.tileEntity; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import goodgenerator.blocks.tileEntity.base.LargeFusionComputerPP; +import goodgenerator.loader.Loaders; +import goodgenerator.util.DescTextLocalization; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TAE; +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_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; + +import java.lang.reflect.Field; + +import static goodgenerator.util.DescTextLocalization.BLUE_PRINT_INFO; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; + +public class LargeFusionComputer4 extends LargeFusionComputerPP { + + public LargeFusionComputer4(int id, String name, String nameRegional) { + super(id,name,nameRegional); + } + + public LargeFusionComputer4(String name) { + super(name); + } + + //Some hacky shit + public static Block mMK4Casing = null; + public static int mMK4CasingMeta; + + @Override + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("Galaxy Collapse.") + .addInfo("Controller block for the Compact Fusion Reactor MK-IV Prototype.") + .addInfo("33,554,432EU/t and 80M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chuck area of the ring center (not controller).") + .addInfo("Performs 4/4 overclock.") + .addInfo("Startup < 160,000,000 EU: 256x Parallel") + .addInfo("Startup < 320,000,000 EU: 192x Parallel") + .addInfo("Startup < 640,000,000 EU: 128x Parallel") + .addInfo("Startup < 1,200,000,000 EU: 64x Parallel") + .addInfo("Support" + EnumChatFormatting.BLUE + " Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.GRAY + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("Fusion Machine Casing MK III", 1666) + .addCasingInfo("Compact Fusion Coil MK-II Prototype", 558) + .addCasingInfo("Infinity Catalyst Frame Box", 128) + .addCasingInfo("Uranium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 3", 3) + .addInputHatch("2-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 2", 2) + .addStructureInfo("ALL Hatches must be UHV or better") + .toolTipFinisher("Good Generator"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } + } + + @Override + public long maxEUStore() { + return 2560060000L * (Math.min(32, this.mEnergyHatches.size() + this.eEnergyMulti.size())) / 32L; + } + + @Override + public Block getCasingBlock() { + if (mMK4Casing == null) + doCasingInit(); + return mMK4Casing; + } + + @Override + public int getCasingMeta() { + if (mMK4Casing == null) + doCasingInit(); + return mMK4CasingMeta; + } + + private void doCasingInit() { + try { + Field f = ModBlocks.class.getDeclaredField("blockCasings6Misc"); + mMK4Casing = (Block) f.get(null); + mMK4CasingMeta = 0; + } catch (NoSuchFieldException | IllegalAccessException e) { + mMK4Casing = ModBlocks.blockCasings3Misc; + mMK4CasingMeta = 12; + } + } + + @Override + public Block getCoilBlock() { + return Loaders.compactFusionCoil; + } + + @Override + public int getCoilMeta() { + return 3; + } + + @Override + public Block getGlassBlock() { + return ItemRegistry.bw_realglas; + } + + @Override + public int getGlassMeta() { + return 13; + } + + @Override + public int hatchTier() { + return 9; + } + + @Override + public Materials getFrameBox() { + return Materials.InfinityCatalyst; + } + + @Override + public ITexture getTextureOverlay() { + if (this.mMaxProgresstime > 0) + return TextureFactory.of(TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_3).extFacing().build()); + else + return TextureFactory.of(TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_1).extFacing().build()); + } + + @Override + public int getMaxPara() { + return 64; + } + + @Override + public int tierOverclock() { + return 64; + } + + @Override + public int overclock(int mStartEnergy) { + return (mStartEnergy < 160000000) ? 64 : ((mStartEnergy < 320000000) ? 16 : (mStartEnergy < 640000000) ? 4 : 1); + } + + @Override + public int extraPara(int startEnergy) { + if (startEnergy < 160000000) + return 4; + if (startEnergy < 320000000) + return 3; + if (startEnergy < 640000000) + return 2; + return 1; + } + + @Override + public String[] getStructureDescription(ItemStack stackSize) { + return DescTextLocalization.addText("LargeFusion4.hint", 9); + } + + @Override + public boolean turnCasingActive(boolean status) { + if (this.mEnergyHatches != null) { + for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) { + hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + } + } + if (this.eEnergyMulti != null) { + for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : this.eEnergyMulti) { + hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + } + } + if (this.mOutputHatches != null) { + for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) { + hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + } + } + if (this.mInputHatches != null) { + for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { + hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + } + } + return true; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) return new ITexture[]{TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(), getTextureOverlay()}; + if (!aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(52)}; + return new ITexture[]{TextureFactory.builder().addIcon(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA).extFacing().build()}; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new LargeFusionComputer4(mName); + } +} |