diff options
| author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:47:13 -0400 |
|---|---|---|
| committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:47:13 -0400 |
| commit | bea4cfc54566b4f3b9971d1da93782b03410f669 (patch) | |
| tree | 0c736c222d38dcc1d016fd5318790c583e1bdf98 /src/main/java/gregtech/common/tileentities/machines/multi | |
| parent | 1185424fa7c692f9932623b965a99392d969e3c5 (diff) | |
| download | GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.tar.gz GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.tar.bz2 GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.zip | |
Bring in experimental branch
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
21 files changed, 1233 insertions, 112 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java new file mode 100644 index 0000000000..86a7120605 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java @@ -0,0 +1,261 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +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_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_TileEntity_Ores; + +public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase{ + + public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_AdvMiner2(String aName) + { + super(aName); + } + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Advanced Miner II", + "Size: 3x7x3", "Controller (front middle at bottom)", + "3x3 Base of Solid Steel Casings", + "Also part of Base: MV+ Energy Input Hatch", + "Fluid Input Hatch, Output Bus and Maintainance Hatch", + "3x Solid Steel Casings on top the Center of the base", + "Steel Frame Boxes on each side and 3 more on top"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] }; + } + public ArrayList<ChunkPosition> mMineList = new ArrayList(); + private boolean completedCycle = false; + + @Override + public boolean checkRecipe(ItemStack aStack) { + if(mInventory[1]==null||(mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize<mInventory[1].getMaxStackSize())){ + ArrayList<ItemStack> tItems = getStoredInputs(); + for(ItemStack tStack : tItems){ + if(tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))){ + if(tStack.stackSize<2){ + tStack = null; + }else{tStack.stackSize--;} + + } + if(mInventory[1]==null){ + mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L); + }else{ + mInventory[1].stackSize++;} + } + } + if(mInputHatches==null||mInputHatches.get(0).mFluid==null||mInputHatches.get(0).mFluid.getFluid().getID()!=ItemList.sDrillingFluid.getID()){ + return false;} + FluidStack tFluid = mInputHatches.get(0).mFluid.copy(); + if(tFluid==null){ + return false; + } + if(tFluid.amount<20){ + return false; + } + tFluid.amount=100; + depleteInput(tFluid); + long tVoltage = getMaxInputVoltage(); + if(getBaseMetaTileEntity().getRandomNumber(20)==0){ + if(mMineList.isEmpty()){ + int yLevel = getYOfPumpHead(); + for(int i=-48;i<49;i++){ + for(int f=-48;f<49;f++){ + Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f); + if(tBlock==GregTech_API.sBlockOres1){ + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f); + if ((tTileEntity instanceof GT_TileEntity_Ores)&&((GT_TileEntity_Ores)tTileEntity).mNatural == true&&!mMineList.contains(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f))){ + mMineList.add(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f)); + } + } + } + } + } + if(mMineList.isEmpty()&&getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead()-1-getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ)!=Blocks.bedrock){ + if(mEnergyHatches.size()>0&&mEnergyHatches.get(0).getEUVar()>(512+getMaxInputVoltage()*4)){moveOneDown();} + } + ArrayList<ItemStack> tDrops = new ArrayList(); + if(!mMineList.isEmpty()){ + Block tMineBlock = getBaseMetaTileEntity().getBlockOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ); + tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ, getBaseMetaTileEntity().getMetaIDOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ), 1); + if(!tDrops.isEmpty()){ + if(GT_OreDictUnificator.getItemData(tDrops.get(0)).mPrefix != OrePrefixes.crushed){ + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, tVoltage, null , tDrops.get(0)); + if(tRecipe!=null){ + this.mOutputItems=new ItemStack[tRecipe.mOutputs.length]; + for(int g=0;g<mOutputItems.length;g++){ + mOutputItems[g] = tRecipe.mOutputs[g].copy(); + mOutputItems[g].stackSize = mOutputItems[g].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1); + } + } + }else{ + this.mOutputItems=null; + ItemStack[] tStack = new ItemStack[tDrops.size()]; + for(int j=0;j<tDrops.size();j++){ + tStack[j]=tDrops.get(j).copy(); + tStack[j].stackSize = tStack[j].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1); + } + mOutputItems = tStack; + } + } + getBaseMetaTileEntity().getWorld().setBlockToAir(mMineList.get(0).chunkPosX+getBaseMetaTileEntity().getXCoord(), mMineList.get(0).chunkPosY+getBaseMetaTileEntity().getYCoord(), mMineList.get(0).chunkPosZ+getBaseMetaTileEntity().getZCoord()); + mMineList.remove(0); + } + } + + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tEU = 48; + int tDuration = 40; + if (tEU <= 16) + { + this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tEU; + this.mMaxProgresstime = tDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + return true; + } + + private boolean moveOneDown() { + if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + return false; + } + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int yHead = getYOfPumpHead(); + if (yHead <= 0) { + return false; + } + if(getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead-1, getBaseMetaTileEntity().getZCoord()+zDir) == Blocks.bedrock){ + return false; + } + if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead - 1, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + return false; + } + if (yHead != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + } + getBaseMetaTileEntity().decrStackSize(1, 1); + return true; + } + + private int getYOfPumpHead() { + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int y = getBaseMetaTileEntity().getYCoord() - 1; + while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + y--; + } + if (y == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { + return y + 1; + } + } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[1] != null&&this.mInventory[1].stackSize>0&>_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir, + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().decrStackSize(0, 1); + } + return y; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) + { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) { + return false; + } + } + } + } + } + for(int y=1;y<4;y++){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir+1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir-1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir+1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir-1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y+3, zDir) != GregTech_API.sBlockMachines) { + return false; + } + } + return true; + } + + @Override public boolean isCorrectMachinePart(ItemStack aStack) {return true; } + @Override public int getMaxEfficiency(ItemStack aStack) {return 10000;} + @Override public int getPollutionPerTick(ItemStack aStack) {return 0; } + @Override public int getDamageToComponent(ItemStack aStack) {return 0;} + @Override public int getAmountOfOutputs() {return 0;} + @Override public boolean explodesOnComponentBreak(ItemStack aStack) {return false;} + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_AdvMiner2(this.mName); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java new file mode 100644 index 0000000000..fcfdbfc104 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -0,0 +1,214 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Reinforced; + +public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase{ + + private boolean running = false; + public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_Charcoal_Pit(String aName) + { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_Charcoal_Pit(this.mName); + } + + public String[] getDescription() + { + return new String[] { "Charcoal pit controller", + "Place on top of a pile of wood logs", + "Maximum size of logs below 11x5x11", + "Each log only can have other logs,", + "dirt or grass on its sides or above", + "or only logs or bricks below", + "Turns logs into Brittle Charcoal blocks"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == 1) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10] }; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() + { + return null; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + + return true; + } + + public boolean isCorrectMachinePart(ItemStack aStack) + { + return true; + } + + public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) + { + if(!checkRecursiveBlocks()){ + return false; + } + + if(mEfficiency==0){ + this.mEfficiency = 10000; + this.mEfficiencyIncrease = 10000; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + return true; + }else{ + this.mEfficiency=0; + this.mEfficiencyIncrease = 0; + this.mMaxProgresstime = 0; + } + return false; + } + + private boolean checkRecursiveBlocks(){ + ArrayList<ChunkPosition> tList1 = new ArrayList(); + ArrayList<ChunkPosition> tList2 = new ArrayList(); + + Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0); + if(tBlock!=Blocks.log&&tBlock!=Blocks.log2){ + return false; + }else{ + tList2.add(new ChunkPosition(0,-1,0));//this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord()-1, this.getBaseMetaTileEntity().getZCoord())); + } + while(!tList2.isEmpty()){ + ChunkPosition tPos= (ChunkPosition) tList2.get(0); + tList2.remove(0); + if(!checkAllBlockSides(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ, tList1, tList2)){ + return false; + } + } + if(running){ + for(ChunkPosition tPos : tList1){ + if(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ)==Blocks.log) + this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord()+tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord()+tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord()+tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); + } + running = false; + return false; + }else{ + this.mMaxProgresstime = (int) Math.sqrt(tList1.size()* 240000); + } + running = true; + return true; + } + private boolean p1,p2,p3,p4,p5,p6; + private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2){ + p1=false;p2=false;p3=false;p4=false;p5=false;p6=false; + Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX +1, aY, aZ); + if(aX+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX +1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX +1, aY, aZ))))p1=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX -1, aY, aZ); + if(aX-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX -1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX -1, aY, aZ))))p2=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX , aY+1, aZ); + if(aY+1<1&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY+1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY+1, aZ))))p3=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass||(aX==0&&aY==-1&&aZ==0&&tBlock==GregTech_API.sBlockMachines))){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY-1, aZ); + if(aY-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY-1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY-1, aZ))))p4=true; + }else if(tBlock!=Blocks.brick_block){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ+1); + if(aZ+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY, aZ+1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ+1))))p5=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ-1); + if(aZ-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY, aZ-1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ-1))))p6=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + aList1.add(new ChunkPosition(aX,aY,aZ)); + if(p1)aList2.add(new ChunkPosition(aX+1,aY,aZ)); + if(p2)aList2.add(new ChunkPosition(aX-1,aY,aZ)); + if(p3)aList2.add(new ChunkPosition(aX,aY+1,aZ)); + if(p4)aList2.add(new ChunkPosition(aX,aY-1,aZ)); + if(p5)aList2.add(new ChunkPosition(aX,aY,aZ+1)); + if(p6)aList2.add(new ChunkPosition(aX,aY,aZ-1)); + return true; + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) + { + mWrench = true; + mScrewdriver = true; + mSoftHammer = true; + mHardHammer = true; + mSolderingTool = true; + mCrowbar = true; + return true; + } + + public int getMaxEfficiency(ItemStack aStack) + { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) + { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) + { + return 0; + } + + public int getAmountOfOutputs() + { + return 1; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) + { + return false; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 632cdcbd6f..7386e74ed8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -16,7 +16,6 @@ import gregtech.api.util.GT_Utility; import java.util.ArrayList; -import scala.actors.threadpool.Arrays; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -43,7 +42,14 @@ public class GT_MetaTileEntity_DistillationTower public String[] getDescription() { - return new String[] { "Controller Block for the Distillation Tower", "Size: 3x6x3 (Hollow)", "Controller (front bottom)", "1x Input Hatch (bottom)", "5x Output Hatch (one each height level besides botton)","1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Clean Stainless Steel Casings for the rest (26 at least!)" }; + return new String[] { + "Controller Block for the Distillation Tower", + "Size: 3x6x3 (Hollow)", "Controller (front bottom)", + "1x Input Hatch (bottom)", + "5x Output Hatch (one each height level besides botton)", + "1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", + "1x Maintenance Hatch (anywhere)", + "Clean Stainless Steel Casings for the rest (26 at least!)" }; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 9a835e625f..e25cfc08f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -60,11 +60,11 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png"); + return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName); } public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); - + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { return aSide != getBaseMetaTileEntity().getFrontFacing(); @@ -283,7 +283,6 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return false; } if (mRunningOnLoad||tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) { - if(mRunningOnLoad)System.out.println("First Recipe!"); this.mLastRecipe = tRecipe; this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); @@ -363,7 +362,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity mMaxProgresstime = 0; mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + try{GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);}catch(Exception e){} } this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); if (aBaseMetaTileEntity.isAllowedToWork()) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 3c23afcbb5..924695b54f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings1; } - + @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION1; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index d101875ba2..cd0790ba91 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -44,7 +44,6 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings4; } - @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION2; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index b7334bd449..6aabc38cb8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -44,11 +44,9 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings4; } - @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION3; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index 3a6a51fa46..446c52f460 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -30,6 +30,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase{ + public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index df129f8fd7..2657bddbb4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoil |
