aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/generators
diff options
context:
space:
mode:
authorTechlone <techlone.mc@gmail.com>2017-06-04 21:30:51 +0500
committerTechlone <techlone.mc@gmail.com>2017-06-04 21:30:51 +0500
commitdbd2f5800886a36dbe4528aabfb2b30f1e7b0908 (patch)
treebb297a5498fe57f75aedf33e4f3f77f8bb89a202 /src/main/java/gregtech/common/tileentities/generators
parent4f6bdedf963842c74bf1cf59f77ead8ad66b48bc (diff)
parent30de32fb07bdc82ec7dc79fd698ba0a1ab6b06f6 (diff)
downloadGT5-Unofficial-dbd2f5800886a36dbe4528aabfb2b30f1e7b0908.tar.gz
GT5-Unofficial-dbd2f5800886a36dbe4528aabfb2b30f1e7b0908.tar.bz2
GT5-Unofficial-dbd2f5800886a36dbe4528aabfb2b30f1e7b0908.zip
Merge branch 'unstable' of https://github.com/Blood-Asp/GT5-Unofficial into unstable
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/generators')
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java13
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