diff options
| author | Techlone <techlone.mc@gmail.com> | 2017-06-01 20:59:40 +0500 |
|---|---|---|
| committer | Techlone <techlone.mc@gmail.com> | 2017-06-01 20:59:40 +0500 |
| commit | 067f4491a812497f6bd013690cf9d8b13f8fc4b3 (patch) | |
| tree | 2d2fb412e2f503b9ba5fafa073e0afec6580c464 /src/main/java/gregtech/common/tileentities/generators | |
| parent | 7c48590a49242bb26eddafa26d2cd7b4ce3546d8 (diff) | |
| parent | f2f74c09f931b5e6647037b40d56672d3b605cb2 (diff) | |
| download | GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.tar.gz GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.tar.bz2 GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.zip | |
Merge branch 'unstable' into advminer2_improvements
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/generators')
| -rw-r--r-- | src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 7501924f69..2ae23a0d80 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -29,7 +29,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],aSide==1?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; } @Override @@ -46,7 +46,12 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach World aWorld = aBaseMetaTileEntity.getWorld(); XSTR aXSTR = new XSTR(); if (!aWorld.isRemote) { - if(aBaseMetaTileEntity.getStoredEU()>0)aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false); + if(aBaseMetaTileEntity.getStoredEU()>0){ + aBaseMetaTileEntity.setActive(true); + aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false); + }else { + aBaseMetaTileEntity.setActive(false); + } if (aTick % 256 == 0 && (aWorld.isThundering() || (aWorld.isRaining() && aXSTR.nextInt(10) == 0))) { int aRodValue = 0; @@ -68,10 +73,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0; if (aXSTR.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) { - aBaseMetaTileEntity.setActive(true); aBaseMetaTileEntity.increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ)); - aBaseMetaTileEntity.setActive(false); } } } @@ -94,7 +97,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public boolean isFacingValid(byte aFacing) { - return true; + return aFacing==1; } @Override |
