diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-06-12 13:16:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 13:16:56 +0200 |
commit | 1a4dc37902bfe596410f6025695c1b12f546f879 (patch) | |
tree | 82591f3df97c278a732a8d0f154a7f0f178a90d0 /src/main/java/gregtech/common | |
parent | 405af95970b8a79ff5a01941a6e83b7627b3aec8 (diff) | |
download | GT5-Unofficial-1a4dc37902bfe596410f6025695c1b12f546f879.tar.gz GT5-Unofficial-1a4dc37902bfe596410f6025695c1b12f546f879.tar.bz2 GT5-Unofficial-1a4dc37902bfe596410f6025695c1b12f546f879.zip |
Fix stocking bus division by zero (#2658)
Fix stocking bus divide by zero when loading a data stick without refreshTime tag
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java index 6b5ce10387..c1a4bd8395 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java @@ -319,7 +319,11 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch if (autoPullAvailable) { setAutoPullItemList(nbt.getBoolean("autoPull")); minAutoPullStackSize = nbt.getInteger("minStackSize"); - autoPullRefreshTime = nbt.getInteger("refreshTime"); + // Data sticks created before refreshTime was implemented should not cause stocking buses to + // spam divide by zero errors + if (nbt.hasKey("refreshTime")) { + autoPullRefreshTime = nbt.getInteger("refreshTime"); + } } additionalConnection = nbt.getBoolean("additionalConnection"); |