diff options
Diffstat (limited to 'src/Java/miscutil/core/xmod/gregtech')
3 files changed, 150 insertions, 132 deletions
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java index a034121cf5..36a541c7eb 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -4,7 +4,6 @@ import gregtech.api.enums.Textures; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; -import miscutil.core.lib.CORE; import miscutil.core.xmod.gregtech.api.enums.GregtechItemList; import miscutil.core.xmod.gregtech.common.blocks.textures.CasingTextureHandler; import net.minecraft.item.ItemStack; @@ -18,89 +17,7 @@ extends GregtechMetaCasingBlocksAbstract { public final static int GTID = 57; - CasingTextureHandler TextureHandler = new CasingTextureHandler(); - - private static Textures.BlockIcons.CustomIcon frontFace_0; - private static Textures.BlockIcons.CustomIcon frontFace_1; - private static Textures.BlockIcons.CustomIcon frontFace_2; - private static Textures.BlockIcons.CustomIcon frontFace_3; - private static Textures.BlockIcons.CustomIcon frontFace_4; - private static Textures.BlockIcons.CustomIcon frontFace_5; - private static Textures.BlockIcons.CustomIcon frontFace_6; - private static Textures.BlockIcons.CustomIcon frontFace_7; - private static Textures.BlockIcons.CustomIcon frontFace_8; - private static Textures.BlockIcons.CustomIcon frontFaceActive_0; - private static Textures.BlockIcons.CustomIcon frontFaceActive_1; - private static Textures.BlockIcons.CustomIcon frontFaceActive_2; - private static Textures.BlockIcons.CustomIcon frontFaceActive_3; - private static Textures.BlockIcons.CustomIcon frontFaceActive_4; - private static Textures.BlockIcons.CustomIcon frontFaceActive_5; - private static Textures.BlockIcons.CustomIcon frontFaceActive_6; - private static Textures.BlockIcons.CustomIcon frontFaceActive_7; - private static Textures.BlockIcons.CustomIcon frontFaceActive_8; - - Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{ - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 - }; - Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{ - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 - }; - - private static Textures.BlockIcons.CustomIcon GT9_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE1"); - private static Textures.BlockIcons.CustomIcon GT9_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST1"); - private static Textures.BlockIcons.CustomIcon GT9_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE2"); - private static Textures.BlockIcons.CustomIcon GT9_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST2"); - private static Textures.BlockIcons.CustomIcon GT9_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE3"); - private static Textures.BlockIcons.CustomIcon GT9_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST3"); - private static Textures.BlockIcons.CustomIcon GT9_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE4"); - private static Textures.BlockIcons.CustomIcon GT9_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST4"); - private static Textures.BlockIcons.CustomIcon GT9_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT9_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5"); - private static Textures.BlockIcons.CustomIcon GT9_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE6"); - private static Textures.BlockIcons.CustomIcon GT9_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST6"); - private static Textures.BlockIcons.CustomIcon GT9_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE7"); - private static Textures.BlockIcons.CustomIcon GT9_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST7"); - private static Textures.BlockIcons.CustomIcon GT9_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE8"); - private static Textures.BlockIcons.CustomIcon GT9_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST8"); - private static Textures.BlockIcons.CustomIcon GT9_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE9"); - private static Textures.BlockIcons.CustomIcon GT9_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST9"); - - private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1"); - private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1"); - private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2"); - private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2"); - private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3"); - private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3"); - private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4"); - private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4.png"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5"); - private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6"); - private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6"); - private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7"); - private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7"); - private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8"); - private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8"); - private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9"); - private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9"); - - + CasingTextureHandler TextureHandler = new CasingTextureHandler(); public GregtechMetaCasingBlocks() { super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE); @@ -138,50 +55,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Coil_U1.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_Coil_U2.set(new ItemStack(this, 1, 13)); GregtechItemList.Casing_Coil_U3.set(new ItemStack(this, 1, 14)); - GregtechItemList.Casing_Coil_U4.set(new ItemStack(this, 1, 15)); - - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - frontFace_0 = GT9_1; - frontFaceActive_0 = (GT9_1_Active); - frontFace_1 = (GT9_2); - frontFaceActive_1 = (GT9_2_Active); - frontFace_2 = (GT9_3); - frontFaceActive_2 = (GT9_3_Active); - frontFace_3 = (GT9_4); - frontFaceActive_3 = (GT9_4_Active); - frontFace_4 = (GT9_5); - frontFaceActive_4 = (GT9_5_Active); - frontFace_5 = (GT9_6); - frontFaceActive_5 = (GT9_6_Active); - frontFace_6 = (GT9_7); - frontFaceActive_6 = (GT9_7_Active); - frontFace_7 = (GT9_8); - frontFaceActive_7 = (GT9_8_Active); - frontFace_8 = (GT9_9); - frontFaceActive_8 = (GT9_9_Active); - } - else{ - frontFace_0 = (GT8_1); - frontFaceActive_0 = (GT8_1_Active); - frontFace_1 = (GT8_2); - frontFaceActive_1 = (GT8_2_Active); - frontFace_2 = (GT8_3); - frontFaceActive_2 = (GT8_3_Active); - frontFace_3 = (GT8_4); - frontFaceActive_3 = (GT8_4_Active); - frontFace_4 = (GT8_5); - frontFaceActive_4 = (GT8_5_Active); - frontFace_5 = (GT8_6); - frontFaceActive_5 = (GT8_6_Active); - frontFace_6 = (GT8_7); - frontFaceActive_6 = (GT8_7_Active); - frontFace_7 = (GT8_8); - frontFaceActive_7 = (GT8_8_Active); - frontFace_8 = (GT8_9); - frontFaceActive_8 = (GT8_9_Active); - } - - + GregtechItemList.Casing_Coil_U4.set(new ItemStack(this, 1, 15)); } @Override diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java new file mode 100644 index 0000000000..4af96ec97e --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java @@ -0,0 +1,144 @@ +package miscutil.core.xmod.gregtech.common.tileentities.generators; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_Solar + extends GT_MetaTileEntity_Boiler { + public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]); + } + + public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[4][17][]; + for (byte i = -1; i < 16; i = (byte) (i + 1)) { + ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[0][(i + 1)] = tmp0; + ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)}; + rTextures[1][(i + 1)] = tmp1; + ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[2][(i + 1)] = tmp2; + ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[3][(i + 1)] = tmp3; + } + return rTextures; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1]; + } + + public int maxProgresstime() { + return 500; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + private int mRunTime = 0; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mRunTime", this.mRunTime); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mRunTime = aNBT.getInteger("mRunTime"); + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { + if (this.mTemperature <= 20) { + this.mTemperature = 20; + this.mLossTimer = 0; + } + if (++this.mLossTimer > 45) { + this.mTemperature -= 1; + this.mLossTimer = 0; + } + if (this.mSteam != null) { + byte i = aBaseMetaTileEntity.getFrontFacing(); + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); + if (tTileEntity != null) { + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained != null) { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + if (tFilledAmount > 0) { + tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); + } + } + } + } + if (aTick % 25L == 0L) { + if (this.mTemperature > 100) { + if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { + this.mHadNoWater = true; + } else { + if (this.mHadNoWater) { + aBaseMetaTileEntity.doExplosion(2048L); + return; + } + this.mFluid.amount -= 1; + mRunTime += 1; + int tOutput = 150; + if(mRunTime > 10000){ + tOutput = Math.max(50, 150 - ((mRunTime-10000)/100)); + } + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam(tOutput); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += tOutput; + } else { + this.mSteam = GT_ModHandler.getSteam(tOutput); + } + } + } else { + this.mHadNoWater = false; + } + } + if ((this.mSteam != null) && + (this.mSteam.amount > 16000)) { + sendSound((byte) 1); + this.mSteam.amount = 12000; + } + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { + boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F; + mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; + } + if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { + this.mProcessingEnergy -= 1; + this.mTemperature += 1; + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + } +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java index 1296d2c87e..cbdbf56d85 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java @@ -40,17 +40,17 @@ public class GregtechMetaTileEntityIndustrialCokeOven @Override public String[] getDescription() { - return new String[]{"Smelts up to 6-18 Items at once", - "Controller Block for the Multi Smelter", + return new String[]{"Processes Logs and Coal into Charcoal and Coal Coke.", + "Controller Block for the Industrial Coke Oven", "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)", - "8x Heating Coils (middle Layer, hollow)", + "8x Heat Resistant/Proof Coils (middle Layer, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", - "Heat Proof Machine Casings for the rest"}; + "Structural Coke Oven Casings for the rest"}; } @Override |