diff options
author | Johannes Gäßler <updrn@student.kit.edu> | 2017-06-15 12:28:14 +0200 |
---|---|---|
committer | Johannes Gäßler <updrn@student.kit.edu> | 2017-06-15 12:28:14 +0200 |
commit | 34474480f73ca5ab1c711d73bdb4bd809673e063 (patch) | |
tree | 794ef12002b88e2f01b5f6d76c9c1f9b62a48961 /src/main/java/gregtech/api/metatileentity | |
parent | c3f2b2b49dc3911a377fd062908d4df78bd3e58d (diff) | |
parent | 08c75fd813a4b48ba7a6b58391767161791c96e7 (diff) | |
download | GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.gz GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.bz2 GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.zip |
Merge remote-tracking branch 'origin/unstable' into ChemistryUpdate
Conflicts:
src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
src/main/java/gregtech/loaders/load/GT_FuelLoader.java
src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity')
15 files changed, 308 insertions, 52 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 01ca8c0f7b..336c9234fc 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -807,7 +807,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); else enableWorking(); - GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork() ? "Enabled" : "Disabled")); + GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -816,7 +816,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= (1 << tSide); - GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide)) != 0 ? "Strong" : "Weak")); + GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); } return true; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 4aa49a954c..fc46874480 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -65,7 +65,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; private String mOwnerName = ""; private NBTTagCompound mRecipeStuff = new NBTTagCompound(); - + private static final Field ENTITY_ITEM_HEALTH_FIELD; static { @@ -167,8 +167,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } else { if (aID <= 0) mID = (short) aNBT.getInteger("mID"); else mID = aID; - mStoredSteam = aNBT.getInteger("mStoredSteam"); - mStoredEnergy = aNBT.getInteger("mStoredEnergy"); + mStoredSteam = aNBT.getLong("mStoredSteam"); + mStoredEnergy = aNBT.getLong("mStoredEnergy"); mColor = aNBT.getByte("mColor"); mLightValue = aNBT.getByte("mLightValue"); mWorkData = aNBT.getByte("mWorkData"); @@ -1146,7 +1146,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } } } - GT_Pollution.addPollution(getWorld(), new ChunkPosition(getXCoord(), getYCoord(), getZCoord()), 100000); + + GT_Pollution.addPollution(this, 100000); mMetaTileEntity.doExplosion(aAmount); } } @@ -1238,7 +1239,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { mInputDisabled = !mInputDisabled; if (mInputDisabled) mOutputDisabled = !mOutputDisabled; - GT_Utility.sendChatToPlayer(aPlayer, "Auto-Input: " + (mInputDisabled ? "Disabled" : "Enabled") + " Auto-Output: " + (mOutputDisabled ? "Disabled" : "Enabled")); + GT_Utility.sendChatToPlayer(aPlayer, trans("086","Auto-Input: ") + (mInputDisabled ? trans("087","Disabled") : trans("088","Enabled") + trans("089"," Auto-Output: ") + (mOutputDisabled ? trans("087","Disabled") : trans("088","Enabled")))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1247,8 +1248,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { if (mWorks) disableWorking(); - else enableWorking(); - GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork() ? "Enabled" : "Disabled")); + else enableWorking();{ + String tChat = trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")); + if(getMetaTileEntity() !=null && getMetaTileEntity().hasAlternativeModeText()) + tChat = getMetaTileEntity().getAlternativeModeText(); + GT_Utility.sendChatToPlayer(aPlayer, tChat);} GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1258,7 +1262,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= (1 << tSide); - GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide)) != 0 ? "Strong" : "Weak")); + GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); } return true; @@ -1413,7 +1417,12 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE @Override public byte getOutputRedstoneSignal(byte aSide) { - return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : 0; + return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : getGeneralRS(aSide); + } + + public byte getGeneralRS(byte aSide){ + if(mMetaTileEntity==null)return 0; + return mMetaTileEntity.allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java index 02f18ecaec..66d1ade42d 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -3,6 +3,7 @@ package gregtech.api.metatileentity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.net.GT_Packet_Block_Event; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -437,4 +438,8 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public void markDirty() {/* Do not do the super Function */} + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index b34483c31b..f0d70255a7 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -2,6 +2,7 @@ package gregtech.api.metatileentity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,6 +10,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -644,8 +646,9 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord(); World tWorld = getBaseMetaTileEntity().getWorld(); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) + if (GregTech_API.sMachineExplosions) { tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + } } @Override @@ -673,4 +676,19 @@ public abstract class MetaPipeEntity implements IMetaTileEntity { public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { // } + + @Override + public boolean allowGeneralRedstoneOutput() { + return false; + } + + @Override + public boolean hasAlternativeModeText() { + return false; + } + + @Override + public String getAlternativeModeText() { + return ""; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 662dc59d80..884ceac8ba 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -863,4 +863,23 @@ public abstract class MetaTileEntity implements IMetaTileEntity { public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { // } + + @Override + public boolean allowGeneralRedstoneOutput(){ + return false; + } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } + + @Override + public boolean hasAlternativeModeText(){ + return false; + } + + @Override + public String getAlternativeModeText(){ + return ""; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index fdb3c0da8b..c8a3d1e591 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -11,12 +11,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; import gregtech.api.interfaces.tileentity.IColoredTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import ic2.api.energy.tile.IEnergySink; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -80,13 +82,17 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )}; if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.374F)//0.375 x1 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 x2 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.624F)//0.625 x4 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.749F)//0.750 x8 + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.874F)//0.825 x12 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; } @@ -101,8 +107,30 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override @@ -251,7 +279,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile } } } - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -275,6 +303,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index effff677d7..9131f21f8f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; @@ -16,6 +17,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -74,13 +76,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; } @@ -143,7 +147,30 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override @@ -269,7 +296,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { } oLastReceivedFrom = mLastReceivedFrom; - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -386,6 +413,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index e08ae2fb1a..cf405b3639 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -10,6 +11,7 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -17,6 +19,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; @@ -72,13 +77,15 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (mIsRestrictive) { if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)}; } @@ -86,13 +93,15 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE } if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.37F) + if (tThickNess < 0.124F) + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; + if (tThickNess < 0.374F)//0.375 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.49F) + if (tThickNess < 0.499F)//0.500 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.74F) + if (tThickNess < 0.749F)//0.750 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; - if (tThickNess < 0.99F) + if (tThickNess < 0.874F)//0.825 return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; } @@ -217,7 +226,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if (isInventoryEmpty()) mLastReceivedFrom = 6; oLastReceivedFrom = mLastReceivedFrom; - } + }else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate(); } @Override @@ -306,6 +315,36 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public float getThickNess() { + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; return mThickNess; } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); + + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index 76b2e9aaf5..73d3c19a6b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -203,8 +203,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) { long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -216,8 +215,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index fc4ecfeea9..9114780b2f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -346,7 +346,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + if(!GT_Mod.gregtechproxy.mForceFreeFace) { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + for(byte i=0;i < 6; i++){ + if(aBaseMetaTileEntity.getAirAtSide(i)){ + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + GT_Utility.sendChatToPlayer(aPlayer,"No free Side!"); return true; } @@ -701,7 +711,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; - GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden"); + GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? trans("095","Input from Output Side allowed") : trans("096","Input from Output Side forbidden")); } } @@ -741,11 +751,33 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * @return see constants above */ public int checkRecipe() { + return checkRecipe(false); + } + + public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){ + return //TODO check or get a better solution + DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") || + DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") || + DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation"); + } + + + /** + * + * @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method... + * @return + */ + public int checkRecipe(boolean skipOC){ GT_Recipe_Map tMap = getRecipeList(); if (tMap == null) return DID_NOT_FIND_RECIPE; GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && !(DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Orbit")||DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Space"))) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { mOutputBlocked++; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index abbf5b7ee5..3fcef913aa 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -212,9 +212,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking()? -1 : 1)) % 65); if(mTargetStackSize <0){mTargetStackSize = 64;} if (mTargetStackSize == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size"); + GT_Utility.sendChatToPlayer(aPlayer, trans("098","Do not regulate Item Stack Size")); } else { - GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + mTargetStackSize); + GT_Utility.sendChatToPlayer(aPlayer, trans("099","Regulate Item Stack Size to: " + mTargetStackSize)); } } } @@ -256,4 +256,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide != aBaseMetaTileEntity.getBackFacing(); } + + @Override + public boolean allowGeneralRedstoneOutput(){ + return true; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index dde8d7cf4f..1209b9c582 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -1,14 +1,18 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; 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.objects.XSTR; import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { @@ -69,7 +73,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public boolean polluteEnvironment() { if (getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing())) { - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), calculatePollutionReduction(10000)); + GT_Pollution.addPollution(getBaseMetaTileEntity(), calculatePollutionReduction(10000)); return true; } return false; @@ -88,4 +92,57 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if(aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity().isActive()) + pollutionParticles(this.getBaseMetaTileEntity().getWorld(),"largesmoke"); + } + + private static XSTR floatGen=new XSTR(); + + public void pollutionParticles(World aWorld,String name){ + boolean chk1,chk2,chk3; + float ran1=floatGen.nextFloat(),ran2=0,ran3=0; + chk1=ran1*100<calculatePollutionReduction(100); + if(GT_Pollution.getPollution(getBaseMetaTileEntity())>= GT_Mod.gregtechproxy.mPollutionSmogLimit){ + ran2=floatGen.nextFloat(); + ran3=floatGen.nextFloat(); + chk2=ran2*100<calculatePollutionReduction(100); + chk3=ran3*100<calculatePollutionReduction(100); + if(!(chk1||chk2||chk3))return; + }else{ + if(!chk1)return; + chk2=chk3=false; + } + + IGregTechTileEntity aMuffler=this.getBaseMetaTileEntity(); + ForgeDirection aDir=ForgeDirection.getOrientation(aMuffler.getFrontFacing()); + float xPos=aDir.offsetX*0.76F+aMuffler.getXCoord()+0.25F; + float yPos=aDir.offsetY*0.76F+aMuffler.getYCoord()+0.25F; + float zPos=aDir.offsetZ*0.76F+aMuffler.getZCoord()+0.25F; + + float ySpd=aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat(); + float xSpd; + float zSpd; + + if(aDir.offsetY==-1){ + float temp=floatGen.nextFloat()*2*(float)Math.PI; + xSpd=(float)Math.sin(temp)*0.1F; + zSpd=(float)Math.cos(temp)*0.1F; + }else{ + xSpd=aDir.offsetX*(0.1F+0.2F*floatGen.nextFloat()); + zSpd=aDir.offsetZ*(0.1F+0.2F*floatGen.nextFloat()); + } + + if(chk1) + aWorld.spawnParticle(name, xPos + ran1*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + + if(chk2) + aWorld.spawnParticle(name, xPos + ran2*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + + if(chk3) + aWorld.spawnParticle(name, xPos + ran3*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd); + } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java index 8221290459..843cb319b6 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java @@ -5,6 +5,7 @@ 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_LanguageManager; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -155,31 +156,35 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch { mMode = (byte) ((mMode + 1) % 8); switch (mMode) { case 0: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids, Steam and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("108","Outputs Liquids, Steam and Items")); break; case 1: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("109","Outputs Steam and Items")); break; case 2: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Liquids"); + GT_Utility.sendChatToPlayer(aPlayer, trans("110","Outputs Steam and Liquids")); break; case 3: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam"); + GT_Utility.sendChatToPlayer(aPlayer, trans("111","Outputs Steam")); break; case 4: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids and Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("112","Outputs Liquids and Items")); break; case 5: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Items"); + GT_Utility.sendChatToPlayer(aPlayer, trans("113","Outputs only Items")); break; case 6: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Liquids"); + GT_Utility.sendChatToPlayer(aPlayer, trans("114","Outputs only Liquids")); break; case 7: - GT_Utility.sendChatToPlayer(aPlayer, "Outputs nothing"); + GT_Utility.sendChatToPlayer(aPlayer, trans("115","Outputs nothing")); break; } } + + public String trans(String aKey, String aEnglish){ + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); + } public boolean outputsSteam() { return mMode < 4; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 5e06b743d1..963aa2926d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -16,6 +16,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -490,6 +491,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } public void explodeMultiblock() { + GT_Pollution.addPollution(getBaseMetaTileEntity(), 300000); mInventory[1] = null; for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java index 9320c6d8b4..83497797ea 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -205,5 +205,15 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; + } + + @Override + public boolean hasAlternativeModeText(){ + return true; + } + + @Override + public String getAlternativeModeText(){ + return (getBaseMetaTileEntity().isAllowedToWork() ? trans("145","Step Down, In: ") : trans("146","Step Up, In"))+maxEUInput()+trans("148","V@")+maxAmperesIn()+trans("147","Amp, Out: ")+maxEUOutput()+"V@"+maxAmperesOut()+trans("149","Amp"); } }
\ No newline at end of file |