From 25c54b40d3a8726db9e77d8cd8ef0d98f91124b8 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 4 Jun 2015 19:04:39 -0700 Subject: [PATCH] Fix potential bounds exception in Smeltery. While playing around with trying to find the max row size of a smeltery I ran into this nice bug. Desync between capacity number and temps array. Start out with this setup: http://puu.sh/icShZ/041dc26b52.jpg {underneth the seared brick is more seared brick to be a valid base} Then start digging out the trough to make the smeltery wider. If anything falls in and updates you'll get a crash and the world won't be loadable anymore. This little check allows for the smeltery to recover itself. --- src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 8ee27994..25156986 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -561,7 +561,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci private void updateTemperatures () { - for (int i = 0; i < maxBlockCapacity; i++) + for (int i = 0; i < maxBlockCapacity && i < meltingTemps.length; i++) { meltingTemps[i] = Smeltery.getLiquifyTemperature(inventory[i]) * 10; // temperatures are *10 for more progress control }