From a57b5621c6304421f232a8b6c399a434004e1a92 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:45:36 +0200 Subject: A few GT Apiary Upgrade changes (#1164) * Upgrade changes * 6 * Handle some crazy bee outputs --- .../machines/basic/GT_MetaTileEntity_IndustrialApiary.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java index f442b6812c..7562946e51 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java @@ -207,8 +207,16 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM { ItemStack s = dropstacks.get(entry.getKey()).copy(); s.stackSize = entry.getValue().intValue() + (getWorld().rand.nextFloat() < (entry.getValue() - (float) entry.getValue().intValue()) ? 1 : 0); - if(s.stackSize > 0) - this.mOutputItems[i++] = s; + if(s.stackSize > 0 && i < 7) + while(true) { + if (s.stackSize <= s.getMaxStackSize()) { + this.mOutputItems[i++] = s; + break; + } else + this.mOutputItems[i++] = s.splitStack(s.getMaxStackSize()); + if(i >= 7) + break; + } } IApiaristTracker breedingTracker = beeRoot.getBreedingTracker(getWorld(), getOwner()); -- cgit