fix #2324 - Add check for currentNeededTicks being zero

This commit is contained in:
Justin Vitale 2021-01-15 00:29:01 +11:00
parent b9100fb19b
commit ea0db38b6a

View file

@ -74,7 +74,7 @@ public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
* @return int Scale of progress
*/
public int getProgressScaled(int scale) {
if (crafter != null && crafter.currentTickTime != 0) {
if (crafter != null && crafter.currentTickTime != 0 && crafter.currentNeededTicks != 0) {
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
}
return 0;