aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorkaziu687 <kaziu687@gmail.com>2020-10-01 21:06:14 +0200
committerGitHub <noreply@github.com>2020-10-01 21:06:14 +0200
commit6d0cb6ec9146fd98d9b0671a7be92f9fe647d4e1 (patch)
tree440ba71d1fce3bc39b79b9342e75be1e7850f6d1 /src/main/java/gregtech/api
parent83ea1e0a56ce3208363cdaf1c0305e2f30f8a135 (diff)
downloadGT5-Unofficial-6d0cb6ec9146fd98d9b0671a7be92f9fe647d4e1.tar.gz
GT5-Unofficial-6d0cb6ec9146fd98d9b0671a7be92f9fe647d4e1.tar.bz2
GT5-Unofficial-6d0cb6ec9146fd98d9b0671a7be92f9fe647d4e1.zip
Update BaseMetaTileEntity.java
Fixes problem that may cause explosion on Thermos servers with load-chunks-on-request: false When machine stays at the edge of loaded chunk (where siblings is not loaded) worldObj.getPrecipitationHeight will return -1 (cuz chunk wont be loaded on request). Machine will explode even if there is a roof.
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index 2a275a5354..7e711aaccd 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -448,10 +448,10 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
if (getRandomNumber(1000) == 0) {
if ((getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord)
- || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord)
- || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord)
- || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord)
- || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) {
+ || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) > -1)
+ || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) > -1)
+ || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) > -1)
+ || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord) && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) > -1) {
if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) {
if (getRandomNumber(10) == 0) {
try{