diff options
| author | Mary <33456283+FourIsTheNumber@users.noreply.github.com> | 2024-10-20 09:08:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-20 13:08:15 +0000 |
| commit | 25f01262c6de6a25078ca97822de2b068b23c212 (patch) | |
| tree | 8bfa30bec1391ff4719af4fffe395544e9d5ca87 /src/main/java/gregtech/common/tileentities/machines/multi | |
| parent | c9dd559aa1cc5d1a3659fb11e48bcb4bc22d7214 (diff) | |
| download | GT5-Unofficial-25f01262c6de6a25078ca97822de2b068b23c212.tar.gz GT5-Unofficial-25f01262c6de6a25078ca97822de2b068b23c212.tar.bz2 GT5-Unofficial-25f01262c6de6a25078ca97822de2b068b23c212.zip | |
Blackhole render enhancement (#3390)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
| -rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index 7b444c6573..2d84f032af 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -496,8 +496,8 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl blackHoleStatus = 1; blackHoleStability = 100; catalyzingCostModifier = 1; - rendererTileEntity = null; - destroyRenderBlock(); + if (rendererTileEntity != null) rendererTileEntity.startScaleChange(false); + collapseTimer = 40; return; } } @@ -574,6 +574,10 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl return super.onRunningTick(aStack); } + // Asynchronous timer to destroy render block after collapse animation is done playing. + // This might not sync perfectly to the renderer but this is very low stakes + private int collapseTimer = -1; + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); @@ -581,6 +585,13 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl playBlackHoleSounds(); } + if (collapseTimer != -1) { + if (collapseTimer == 0) { + destroyRenderBlock(); + } + collapseTimer--; + } + // Run stability checks once per second if a black hole is open if (blackHoleStatus == 1 || aTick % 20 != 0) return; @@ -719,6 +730,7 @@ public class MTEBlackHoleCompressor extends MTEExtendedPowerMultiBlockBase<MTEBl rendererTileEntity = (TileEntityBlackhole) base.getWorld() .getTileEntity(base.getXCoord() + x, base.getYCoord() + y, base.getZCoord() + z); + rendererTileEntity.startScaleChange(true); rendererTileEntity.setStability(blackHoleStability / 100F); } |
