diff options
Diffstat (limited to 'src')
10 files changed, 663 insertions, 515 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 9d1a054cb0..993099521d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -30,22 +30,27 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; 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.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; @@ -56,11 +61,16 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; -public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_BioVat> { public static final HashMap<Coords, Integer> staticColorMap = new HashMap<>(); - private static final byte MCASING_INDEX = 49; private static final byte TIMERDIVIDER = 20; private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<>(); @@ -74,6 +84,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private byte mGlassTier; private int mSievert; private int mNeededSievert; + private int mCasing = 0; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -83,6 +94,88 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { super(aName); } + private static final int CASING_INDEX = 49; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition<GT_TileEntity_BioVat> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_BioVat>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + })) + .addElement('c', ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)) + )) + .addElement('a', ofChain( + isAir(), + ofBlockAnyMeta(FluidLoader.bioFluidBlock) + )) + .addElement('g', new IStructureElement<GT_TileEntity_BioVat>(){ + + @Override + public boolean check(GT_TileEntity_BioVat te, World world, int x, int y, int z) { + byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); + if(glasstier == 0) + return false; + if(te.mGlassTier == 0) + te.mGlassTier = glasstier; + return te.mGlassTier == glasstier; + } + + @Override + public boolean spawnHint(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 1 /* aDots: 2 */); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { + world.setBlock(x, y, z, Blocks.glass, 0, 2); + return true; + } + }) + .build(); + + @Override + public IStructureDefinition<GT_TileEntity_BioVat> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Bacterial Vat"). + addInfo("Controller block for the Bacterial Vat"). + addInfo("For maximum efficiency boost keep the Output Hatch always half filled!"). + addSeparator(). + beginStructureBlock(5, 4, 5, false). + addController("Front bottom center"). + addCasingInfo("Clean Stainless Steel Casings", 19). + addOtherStructurePart("Glass", "Hollow two middle layers", 2). + addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass"). + addStructureInfo("Some Recipes need more advanced Glass Types"). + addMaintenanceHatch("Any casing", 1). + addOtherStructurePart("Radio Hatch", "Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + addInputHatch("Any casing", 1). + addOutputHatch("Any casing", 1). + addEnergyHatch("Any casing", 1). + toolTipFinisher("Bartworks"); + return tt; + } + public static int[] specialValueUnpack(int aSpecialValue) { int[] ret = new int[4]; ret[0] = aSpecialValue & 0xF; // = glass tier @@ -259,7 +352,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { return this.mOutputHatches.stream().map(GT_MetaTileEntity_Hatch_Output::getFluid).filter(Objects::nonNull).collect(Collectors.toSet()); } - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) { if (aTileEntity == null) { return false; } else { @@ -267,7 +360,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(GT_TileEntity_BioVat.MCASING_INDEX); + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex); return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } else { return false; @@ -277,49 +370,19 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - int blockcounter = 0; this.mRadHatches.clear(); + this.mGlassTier = 0; + this.mCasing = 0; - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - for (int y = 0; y < 4; y++) { - IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); - if (y == 0 || y == 3) { - //controller - if (y == 0 && xDir + x == 0 && zDir + z == 0) - continue; - if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { - if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { - ++blockcounter; - continue; - } - return false; - } - } else { - if (Math.abs(x) < 2 && Math.abs(z) != 2) { - if (!(BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, Blocks.air) || (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, FluidLoader.bioFluidBlock)))) { - return false; - } - } else { - if (x == -2 && z == -2 && y == 1) - this.mGlassTier = BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == this.mGlassTier || this.mGlassTier != BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { - return false; - } - } - } - } - - if (blockcounter > 18 && - this.mRadHatches.size() < 2 && - this.mOutputHatches.size() == 1 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0) - return this.mEnergyHatches.size() > 0; + if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) + return false; - return false; + return this.mCasing >= 19 && + this.mRadHatches.size() <= 1 && + this.mOutputHatches.size() == 1 && + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mEnergyHatches.size() > 0; } @Override @@ -567,18 +630,23 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } @Override - public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.bvat.0.name").split(";"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); + 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_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; } - return fdsc; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX)}; + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index f761543f56..b9c3d36c0e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,28 +22,39 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; +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.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { +public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ElectricImplosionCompressor> { public static GT_Recipe.GT_Recipe_Map eicMap; - private Boolean piston = null; + private Boolean piston = true; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -53,6 +64,98 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity super(aName); } + private static final int CASING_INDEX = 16; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition<GT_TileEntity_ElectricImplosionCompressor> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_ElectricImplosionCompressor>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccc", "cec", "ccc"}, + {"ttt", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"nnn", "nnn", "nnn"}, + {"nNn", "NNN", "nNn"}, + {"nnn", "nnn", "nnn"}, + {"t~t", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"CCC", "CeC", "CCC"}, + })) + .addElement('c', ofChain( + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4) + )) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement('C', ofChain( + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4) + )) + .addElement('e', ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, CASING_INDEX, 2)) + .addElement('N', new IStructureElement<GT_TileEntity_ElectricImplosionCompressor>(){ + + @Override + public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if(!te.piston && !world.isAirBlock(x, y, z)) + return false; + if(te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 && world.getBlockMetadata(x, y, z) == 2)) + return false; + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { + if(te.piston) + StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { + if(te.piston) + world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + else + world.setBlockToAir(x, y, z); + return true; + } + }) + .build(); + + @Override + public IStructureDefinition<GT_TileEntity_ElectricImplosionCompressor> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Implosion Compressor"). + addInfo("Explosions are fun"). + addInfo("Controller block for the Electric Implosion Compressor"). + addInfo("Uses electricity instead of Explosives"). + addSeparator(). + beginStructureBlock(3, 9, 3, false). + addController("Front 3rd layer center"). + addCasingInfo("Solid Steel Machine Casing", 8). + addStructureInfo("Casings can be replaced with Explosion Warning Signs"). + addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8"). + addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8"). + addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6"). + addMaintenanceHatch("Any bottom casing", 1). + addInputBus("Any bottom casing", 1). + addOutputBus("Any bottom casing", 1). + addEnergyHatch("Bottom and top middle", 2). + toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean checkRecipe(ItemStack aStack) { @@ -94,7 +197,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } - + @Override public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -103,7 +206,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false; return true; } - + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mRuntime % 10 == 0) @@ -111,17 +214,16 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return super.onRunningTick(aStack); } + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + public void stopMachine() { this.resetPiston(); super.stopMachine(); } - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if (this.piston == null) - this.piston = true; - } - private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; @@ -174,75 +276,27 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("piston", this.piston); super.saveNBTData(aNBT); + aNBT.setBoolean("piston", this.piston); } @Override public void loadNBTData(NBTTagCompound aNBT) { - this.piston = aNBT.getBoolean("piston"); super.loadNBTData(aNBT); + this.piston = aNBT.getBoolean("piston"); } @Override - @SuppressWarnings("ALL") public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - for (int x = -1; x <= 1; x++) { - for (int y = -2; y < 7; y++) { - for (int z = -1; z <= 1; z++) { - IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, z + zDir); - if (y == -2 || y == 6) { - if (!(x == 0 && z == 0)) { - if (!this.addMaintenanceToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { - return false; - } - } - } else if (x == 0 && z == 0) { - if (y == -2) - if (!this.addEnergyInputToMachineList(te, 16)) - return false; - if (y == 6) - if (!this.addEnergyInputToMachineList(te, 16)) - return false; - } - } else if ((y > -2 && y < 1) || (y > 3 && y < 6)) { - if (y == 0 && xDir + x == 0 && zDir + z == 0) - continue; - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - if (x == 0 && z == 0) { - if (tBlock != BW_BLOCKS[2] || tMeta != 0) - return false; - } else { - if (tBlock != BW_BLOCKS[2] || tMeta != 1) - return false; - } + if(!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) + return false; + return this.mMaintenanceHatches.size() == 1 && + this.mEnergyHatches.size() == 2; + } - } else if (y == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 1, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } else if (y == 2) { - if (!this.piston) { - if (Math.abs(x) == 1 && Math.abs(z) == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 2, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } - } else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } else if (y == 3) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 3, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } - } - } - } - return true; + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; } @@ -252,12 +306,30 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } @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_TileEntity_ElectricImplosionCompressor(this.mName); } + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return aActive ? new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW}).extFacing().glow().build()} : new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW}).extFacing().glow().build()}; + } else { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; + } + } + @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.eic.0.name"); + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index e3b3e64753..a4fab93440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -22,34 +22,35 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; 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_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.*; 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.minecraftforge.common.util.ForgeDirection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; -public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { +public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ManualTrafo> { - private static final byte SINGLE_UPSTEP = 0; - private static final byte SINGLE_DOWNSTEP = 1; - private static final byte MULTI_UPSTEP = 2; - private static final byte MULTI_DOWNSTEP = 3; private byte mode; - private byte texid = 2; - private long mCoilWicks; + private int mTiers; private boolean upstep = true; public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { @@ -60,6 +61,96 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase super(aName); } + private static final int CASING_INDEX = 2; + private static final String STRUCTURE_PIECE_BASE = "base"; + private static final String STRUCTURE_PIECE_LAYER = "layer"; + private static final String STRUCTURE_PIECE_TOP = "top"; + private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; + private static final IStructureDefinition<GT_TileEntity_ManualTrafo> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_ManualTrafo>builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ + {"b~b", "bbb", "bbb"} + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ + {"ttt", "tft", "ttt"} + })) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][]{ + {"ooo", "ooo", "ooo"} + })) + .addShape(STRUCTURE_PIECE_TAP_LAYER, transpose(new String[][]{ + {" TTT ", "TtttT", "TtftT", "TtttT", " TTT "} + })) + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2) + )) + .addElement('o', ofHatchAdderOptional(GT_TileEntity_ManualTrafo::addDynamoToMachineList, CASING_INDEX, 2, GregTech_API.sBlockCasings1, 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement<GT_TileEntity_ManualTrafo>() { + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if(world.isAirBlock(x, y, z)) + return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity == null) + return true; + if(!(tileEntity instanceof IGregTechTileEntity)) + return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if(mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if(((GT_MetaTileEntity_TieredMachineBlock) mte).mTier == intier + (te.upstep ? te.mTiers : -te.mTiers)){ + te.addToMachineList((IGregTechTileEntity)tileEntity, CASING_INDEX); + return true; + } + else + return false; + } + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + } + ) + .build(); + + @Override + public IStructureDefinition<GT_TileEntity_ManualTrafo> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Transformer") + .addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:") + .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") + .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) + .addController("Front bottom center") + .addCasingInfo("MV Machine Casing", 0) + .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") + .addMaintenanceHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2) + .addStructureInfo("---------TAPPED MODE---------") + .addEnergyHatch("Touching Transformer-Winding Blocks", 3) + .addDynamoHatch("Touching Transformer-Winding Blocks", 3) + .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") + .toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -88,8 +179,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase else this.mEfficiency = this.getMaxEfficiency(null); - if (this.mode > GT_TileEntity_ManualTrafo.SINGLE_DOWNSTEP) { - return this.onRunningTickTabbedMode(); + if (this.mode > 1) { + return false;//this.onRunningTickTabbedMode(); Tapped mode is disable } return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); @@ -135,215 +226,64 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.stopMachine(); return false; } - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - this.upstep = (this.mode == 0 || this.mode == 2); + if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + this.upstep = this.mode % 2 == 0; this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); - return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; + return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers : this.getInputTier() - this.getOutputTier() == this.mTiers; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - - if (this.mode <= 1) { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (this.mCoilWicks % 8 == 0) { - ++y; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } + if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, itemStack.getItemDamage()); - if (this.mCoilWicks % 8 != 0) - return false; - - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } - } + this.upstep = this.mode % 2 == 0; + boolean tapmode = this.mode > 1; - //check Bottom - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } + if(!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) + return false; - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - } else { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (this.mCoilWicks % 8 == 0) { - ++y; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } + if(this.mEnergyHatches.size() == 0) + return false; - if (this.mCoilWicks % 8 != 0) + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) + if (in.mTier != intier) return false; - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } + int mHeight; + for(mHeight = 1; mHeight <= 8; mHeight++) { + if(tapmode) + { + this.mTiers = mHeight; + if(!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) + break; } + else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) + break; + } + if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) + return false; + this.mTiers = mHeight - 1; - //check Bottom - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } + if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) + return false; - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) return false; - - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } - - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - - - //check tap hull - for (int ty = 1; ty <= y; ++ty) { - - byte leveltier; - if (this.mInventory[1].getItemDamage() == 2) - leveltier = ((byte) (intier - ty)); - else if (this.mInventory[1].getItemDamage() == 3) - leveltier = ((byte) (intier + ty)); - else - return false; - - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (x == -2 || z == -2 || x == 2 || z == 2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, this.texid, leveltier)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - } - } - } } - return !this.mDynamoHatches.isEmpty() && !this.mEnergyHatches.isEmpty(); + + return true; } @Override @@ -372,63 +312,52 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.manualtravo.0.name"); - } - - @Override public void saveNBTData(NBTTagCompound ntag) { - ntag.setLong("mCoilWicks", this.mCoilWicks); super.saveNBTData(ntag); + ntag.setInteger("mTiers", this.mTiers); + ntag.setByte("mMode", this.mode); + ntag.setBoolean("upstep", this.upstep); } @Override public void loadNBTData(NBTTagCompound ntag) { super.loadNBTData(ntag); - this.mCoilWicks = ntag.getLong("mCoilWicks"); + this.mTiers = ntag.getInteger("mTiers"); + this.mode = ntag.getByte("mMode"); + this.upstep = ntag.getBoolean("upstep"); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid)}; - } - - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - } - return false; - } else { - return false; - } + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } - public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - } - return false; - } else { - return false; - } + @Override + public void construct(ItemStack itemStack, boolean b) { + if(this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, this.mInventory[1].getItemDamage()); + int mHeight = Math.min(itemStack.stackSize, 8); + boolean tapmode = this.mode > 1; + buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); + for(int i = 0; i < mHeight; i++) { + if (tapmode) + buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); + else + buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); } + buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index bb7ac747ad..15deb54ac4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -26,8 +26,11 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -39,9 +42,10 @@ 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.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -55,15 +59,16 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_Windmill> { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -71,7 +76,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final XSTR localRandomInstance = new XSTR(); private BW_RotorBlock rotorBlock; - private byte hasDoor; + private int mDoor = 0; + private int mHardenedClay = 0; public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -81,6 +87,62 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { super(aName); } + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition<GT_TileEntity_Windmill> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_Windmill>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" ", " ", " ", " p ", " ", " ", " "}, + {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, + })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement('c', ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)) + )) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement('s', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) + .build(); + + @Override + public IStructureDefinition<GT_TileEntity_Windmill> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Windmill"). + addInfo("Controller block for the Windmill"). + addInfo("A primitive Grinder powered by Kinetic energy"). + addInfo("The structure is too complex!"). + addInfo("Follow the StructureLib hologram projector to build the main structure."). + addSeparator(). + beginStructureBlock(7, 12, 7, false). + addController("Front bottom center"). + addCasingInfo("Hardened Clay block", 40). + addOtherStructurePart("Dispenser", "Any Hardened Clay block"). + addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block"). + addStructureHint("Primitive Kinetic Shaftbox", 1). + toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -368,6 +430,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; } + public boolean setRotorBlock(TileEntity aTileEntity){ + if (aTileEntity instanceof BW_RotorBlock) { + this.rotorBlock = (BW_RotorBlock) aTileEntity; + return true; + } + return false; + } + @SuppressWarnings("ALL") @Override public boolean addOutput(ItemStack aStack) { @@ -401,85 +471,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - /* - * offset x1 = 3x3 - * offset x2 = 5x5 - * offset x3 = 7x7 - * etc. - */ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - - //floor - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - if (!((Math.abs(x) == 3 && Math.abs(z) == 3) || (xDir + x == 0 && zDir + z == 0))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != Blocks.brick_block) { - return false; - } - } - } - //h_clay shaft - for (int y = 1; y <= 4; y++) - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!((Math.abs(x) == 2 && Math.abs(z) == 2) || (Math.abs(x) < 2 && Math.abs(z) != 2))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.hardened_clay && !this.addDispenserToOutputSet(aBaseMetaTileEntity.getTileEntityOffset(xDir + x, y, zDir + z))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == Blocks.wooden_door && this.hasDoor < 3) { - this.hasDoor++; - continue; - } - return false; - } - } - - //plank layer 1 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!(Math.abs(x) < 2 && Math.abs(z) != 2)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 5, zDir + z) != Blocks.planks) - return false; - } - } + this.tileEntityDispensers.clear(); + this.mDoor = 0; + this.mHardenedClay = 0; - //plank layer 2-4 - for (int x = -3; x <= 3; x++) - for (int y = 6; y <= 8; y++) - for (int z = -3; z <= 3; z++) - if (!(((Math.abs(x) == 3 && Math.abs(z) == 3) || (Math.abs(x) < 3 && (Math.abs(z) != 2 || Math.abs(z) != 1))) || (xDir + x == 0 && zDir + z == 0 && y == 7))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.planks) - return false; - - //plank layer 5 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - if (!(Math.abs(x) < 2 && (Math.abs(z) != 2))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 9, zDir + z) != Blocks.planks) - return false; - } - //plank layer 6 - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) - if (!(Math.abs(x) < 1 && (Math.abs(z) != 1))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 10, zDir + z) != Blocks.planks) - return false; - } - //plank layer 7 - if (aBaseMetaTileEntity.getBlockOffset(xDir, 11, zDir) != Blocks.planks) + if(!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false; - //Rotor Block - TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord() + 7, this.getBaseMetaTileEntity().getZCoord()); - - if (te instanceof BW_RotorBlock) - this.rotorBlock = (BW_RotorBlock) te; - else + if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false; - //check for outputs - if (this.tileEntityDispensers.isEmpty()) - return false; this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -487,9 +489,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mSolderingTool = true; this.mCrowbar = true; - //reset door cause bugs >_> - this.hasDoor = 0; - return true; } @@ -500,11 +499,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.isServerSide()) { if (this.mEfficiency < 0) this.mEfficiency = 0; - //noinspection NonAtomicOperationOnVolatileField - if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { - this.hasDoor = 0; - this.tileEntityDispensers.clear(); - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + if (--this.mUpdate == 0 || --this.mStartUpCheck == 0 || this.mStructureChanged) { + checkStructure(true, aBaseMetaTileEntity); + this.mUpdate = 100; } if (this.mStartUpCheck < 0) { if (this.mMachine) { @@ -536,14 +533,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } } } else { - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + //this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); return; } } else { this.stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); } @@ -586,11 +583,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.windmill.0.name"); - } - - @Override public String[] getInfoData() { return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; } @@ -663,4 +655,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } + + @Override + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 95f5c0f036..744f2a2797 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -24,21 +24,26 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +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.GT_MetaTileEntity_Hatch_Energy; +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_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -48,10 +53,12 @@ import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer implements TecTechEnabledMulti { +public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_MegaVacuumFreezer> implements TecTechEnabledMulti { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -61,10 +68,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre super(aName); } - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.mvf.0.name"); - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_TileEntity_MegaVacuumFreezer(this.mName); @@ -74,6 +77,47 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre public ArrayList TTTunnels = new ArrayList<>(); @SuppressWarnings("rawtypes") public ArrayList TTMultiAmp = new ArrayList<>(); + private int mCasing = 0; + + private static final int CASING_INDEX = 17; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition<GT_TileEntity_MegaVacuumFreezer> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaVacuumFreezer>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccc~ccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"} + })) + .addElement('c', ofChain( + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addInputToMachineList, CASING_INDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)) + )) + .build(); + + + @Override + public IStructureDefinition<GT_TileEntity_MegaVacuumFreezer> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack aStack, boolean aHintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0); + } @Override public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -97,6 +141,11 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; + } + + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); @@ -152,14 +201,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; } - @Override - public IStructureDefinition<GT_MetaTileEntity_VacuumFreezer> getStructureDefinition() { - throw new UnsupportedOperationException(); - } - @Override - public void construct(ItemStack aStack, boolean aHintsOnly) { - } // -------------- TEC TECH COMPAT ---------------- @@ -169,25 +211,80 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } - return ( - BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) - ) && - !this.mMaintenanceHatches.isEmpty() && - LoaderReference.tectech ? - (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : - !this.mEnergyHatches.isEmpty(); + this.mCasing = 0; + if(!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) + return false; + return + this.mMaintenanceHatches.size() == 1 && + (LoaderReference.tectech ? + (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : + !this.mEnergyHatches.isEmpty()) && + this.mCasing >= 900; } + @Override public String[] getInfoData() { return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); } @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Vacuum Freezer"). + addInfo("Controller Block for the Mega Vacuum Freezer"). + addInfo("Cools hot ingots and cells"). + addSeparator(). + beginStructureBlock(15, 15, 15, true). + addController("Front center"). + addCasingInfo("Frost Proof Machine Casing", 900). + addEnergyHatch("Any casing", 1). + addMaintenanceHatch("Any casing", 1). + addInputHatch("Any casing", 1). + addOutputHatch("Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + toolTipFinisher("Bartworks"); + return tt; + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @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 ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + ITexture[] rTexture; + if (aSide == aFacing) { + if (aActive) { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW}).extFacing().glow().build()}; + } else { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW}).extFacing().glow().build()}; + } + } else { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17]}; + } + + return rTexture; + } + + @Override @Optional.Method(modid = "tectech") public List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches() { return this.mEnergyHatches; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index dc0b26776f..39cf609c14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -591,7 +591,7 @@ public class BW_Util { public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { byte boroTier = BorosilicateGlass.getTier(block, meta); - if (boroTier < 0) + if (boroTier != -1) return boroTier; if (block.getUnlocalizedName().equals("blockAlloyGlass")) diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index 98a94abc98..5f47ffc626 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -102,9 +102,7 @@ tooltip.teslastaff.0.name=Keine Garantie! tooltip.tile.acidgen.0.name=Ein Säure Generator tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. -tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: @@ -113,7 +111,6 @@ tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level tooltip.tile.radhatch.2.name=Material: diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index bebfa4161c..b556a2bfe5 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -104,8 +104,6 @@ tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);0-1x Input Bus (Any casing);0-1x Output Bus (Any casing);0-1x Input Hatch (Any casing);0-1x Output Hatch (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: @@ -156,8 +154,6 @@ item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials -tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! - BW.keyphrase.Hint_Details=Hint Details BW.tile.CircuitAssemblyLine.hint.0=1 - Energy Input Hatch BW.tile.CircuitAssemblyLine.hint.1=2 - Maintenance Hatch, Input Hatch diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 1528e26c86..6ccf3387b2 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -102,8 +102,6 @@ tooltip.tile.waterpump.2.name=Doit être placé sur le sol. tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Borosilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc carter);1+ bus de sortie(n'importe quel bloc carter);1+ trappe d'énergie (n'importe quel bloc carter);1x trappe de maintenance (n'importe quel bloc carter);Blocs carter de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs carter de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale. tooltip.tile.mbf.1.name=Pollution par seconde -tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc carter);1x Bus de sortie (n'importe quel bloc carter);1x Trappe de maintenance (n'importe quel bloc carter);1x Trappe d'énergie (n'importe quel bloc carter);Blocs carter de machine résistant au froid pour le reste. -tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc carter en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! tooltip.tile.windmill.0.name=Un broyeur primitif fonctionnant a l'énergie cinétique.;Taille(LxHxP): 7x12x7;Couche 1: 7x7 Briques, les coins sont laissés vide,le contrôleur est centré devant.;(creux), les mur doivent contenir au moins un Dispenseur;Couche 7: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 8: 7x7 Planches de Bois. les coins sont laissés vide, (creux),;le bloc centré devant doit être une Boîte d'arbre de transmission primitive.;Couche 9: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 11: 3x3 Planches de Bois. les coins sont pleins, (creux).;A besoin d'un Rotor d'éolienne dans la Boîte d'arbre de transmission pour fonctionner.;Les objets d'entrée doivent aller dans le contrôleur.;Les objets de sortie apparaîtront dans les Dispenseurs.;C'est plus rapide dans les régions venteuses (comme les éoliennes IC2). tooltip.tile.lesu.0.name=Bloc contrôleur pour le GT2-Stylé L.E.S.U.;Taille: n'importe; tooltip.tile.lesu.1.name=Stockage par carter du LESU: @@ -147,8 +145,6 @@ tile.manutrafo.name=Transformateur Manuel itemGroup.bartworksMetaMaterials=Méta Matériaux De BartWorks -tooltip.tile.eic.0.name=Bloc Contrôleur pour le Compresseur à Implosion Electrique;Taille (LxHxP): 3x9x3;Utilise de l'Electricité à la place d'Explosifs;Contrôleur: couche 3, devant, centré;Couches 1 et 9: carter de machine en acier solide, pour chaque couche: 1 Trappe d'Energie au milieu;Couche 2,3,7,8: Milieu: Bloc de Ferrite en Nickel-Zinc, Extérieur: Bloc de bobinage de Transformateur;Couche 4,5,6: Blocs de Neutronium;1+ Bus d'Entrée, 1+ Bus de Sortie, 1 trappe de maintenance n'importe où dans les Blocs Carter en Acier Solide;Ne PAS obstruer ou miner les Parties mobile pendant le fonctionnement, ou explosion garantie! - planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index f4a1fa6e64..b21456ded1 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -2,7 +2,7 @@ itemGroup.GT2C=GergTech2兼容 item.GT_Rockcutter_Item_LV.name=岩石切割者 LV item.GT_Rockcutter_Item_MV.name=岩石切割者 MV item.GT_Rockcutter_Item_HV.name=岩石切割者 HV -item.GT_Teslastaff_Item.name=特斯拉权杖 +item.GT_Teslastaff_Item.name=特斯拉权杖 BW_ItemBlocks.0.name=蚀刻青金石元件 BW_ItemBlocks.1.name=镀层青金石元件 GT_LESU_CASING.0.name=LESU机械方块 @@ -25,7 +25,7 @@ item.rotors.combinedParts.name=复合材料包层木框架 item.BW_SimpleWindMeter.name=简易风速计 tile.BWHeatedWaterPump.0.name=简易斯特林水泵 item.BWrawtube.name=加长玻璃管 -item.BWmotor.name=简易斯特林引擎 +item.BWmotor.name=简易斯特林引擎 item.BWstove.name=简易加热炉 itemGroup.BioTab=BartWorks-生物工程 @@ -102,8 +102,6 @@ tooltip.tile.waterpump.2.name=必须放在地上. tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼硅酸盐玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);外部15x15的防热机械方块(第20层);1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自物品配方的最小炉温起,每高出900K会减少5%的能耗,使用乘法叠加;自物品配方的最小所需炉温起,每高出1800K将允许一次无损的超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 tooltip.tile.mbf.1.name=污染每秒 -tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 -tooltip.tile.bvat.0.name=生物培养缸的控制器方块;大小(宽x高x长);5x4x5;底层和顶层为洁净不锈钢机械方块;底层或顶层必须含有:;1个维护仓,1个输出仓;1+输入仓,1个以上的输入总线,0-1个放射仓;中间两层必须由玻璃构成,中空;玻璃可以为任何玻璃,例如匠魂的通透玻璃;一些配方需要更高级的玻璃为了最大限度地提高效率,请保持输出仓始终为半满! tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层:7x7砖块,角落空置,控制器方块在正面中央;第2-5层:5x5硬化粘土,角落空置,可包含一扇门,;中空,墙必须至少包含一个发射器;第6层:5x5木板.角落填充,中空.;第7层:7x7木板.角落空置,中空.;第8层:7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层:7x7木板.角落空置,中空.;第10层:5x5木板.角落填充,中空.;第11层:3x3木板.角落填充,中空.;第12层:1x1木板;需要在轴箱中放入风车转子才可运行;在控制器中输入物品;输出物品将出现在发射器中;在风大的地区运行较快(像IC2风机一样) tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器方块;尺寸:任意 tooltip.tile.lesu.1.name=每个LESU机械方块存储: @@ -146,8 +144,6 @@ tile.manutrafo.name=手动变压器 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 -tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! - planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba @@ -155,4 +151,4 @@ star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 itemGroup.bw.MetaItems.0=BartWorks电路更新物品 -#This zh_CN.lang is translated by huajijam for bartworks (19/7/19)
\ No newline at end of file +#This zh_CN.lang is translated by huajijam for bartworks (19/7/19) |