@@ -95,7 +95,7 @@ public class MetaTileEntityMegaApiary extends MultiblockWithDisplayBase implemen
9595
9696 private EnergyContainerList energyContainer ;
9797
98- private static IBeekeepingMode mode ;
98+ private IBeekeepingMode mode ;
9999
100100 public MetaTileEntityMegaApiary (ResourceLocation metaTileEntityId ) {
101101 super (metaTileEntityId );
@@ -423,30 +423,46 @@ private void processProducts() {
423423
424424 primary .getProductChances ().forEach ((stack , f ) -> {
425425 float v = (speed + f + baseModifier + baseModifier * getMaxTier ()) * applyBonus ;
426- while (v > 1.0F ) {
427- int size = Math .min ((int ) v , 64 );
428- stack .setCount (size );
429- products .add (stack );
430- v -= size ;
426+ int amount = (int ) v ;
427+ if (getWorld ().rand .nextFloat () < v - amount ) {
428+ amount ++;
429+ }
430+ while (amount > 0 ) {
431+ ItemStack newStack = stack .copy ();
432+ int stackSize = Math .min (amount , newStack .getMaxStackSize ());
433+ newStack .setCount (stackSize );
434+ products .add (newStack );
435+ amount -= stackSize ;
431436 }
432437 });
438+
433439 secondary .getProductChances ().forEach ((stack , f ) -> {
434440 float v = (speed + f + baseModifier + baseModifier * getMaxTier ()) * applyBonus ;
435- while (v > 1.0F ) {
436- int size = Math .min ((int ) v , 64 );
437- stack .setCount (size );
438- products .add (stack );
439- v -= size ;
441+ int amount = (int ) v ;
442+ if (getWorld ().rand .nextFloat () < v - amount ) {
443+ amount ++;
444+ }
445+ while (amount > 0 ) {
446+ ItemStack newStack = stack .copy ();
447+ int stackSize = Math .min (amount , newStack .getMaxStackSize ());
448+ newStack .setCount (stackSize );
449+ products .add (newStack );
450+ amount -= stackSize ;
440451 }
441452 });
442453
443454 primary .getSpecialtyChances ().forEach ((stack , f ) -> {
444455 float v = (speed + f + baseModifier + baseModifier * getMaxTier ()) * applyBonus ;
445- while (v > 1.0F ) {
446- int size = Math .min ((int ) v , 64 );
447- stack .setCount (size );
448- products .add (stack );
449- v -= size ;
456+ int amount = (int ) v ;
457+ if (getWorld ().rand .nextFloat () < v - amount ) {
458+ amount ++;
459+ }
460+ while (amount > 0 ) {
461+ ItemStack newStack = stack .copy ();
462+ int stackSize = Math .min (amount , newStack .getMaxStackSize ());
463+ newStack .setCount (stackSize );
464+ products .add (newStack );
465+ amount -= stackSize ;
450466 }
451467 });
452468 royalJerry -= bonus ;
@@ -530,7 +546,7 @@ protected void addDisplayText(List<ITextComponent> textList) {
530546 for (ItemStack stack : merged ) {
531547 tl .add (TextComponentUtil .translationWithColor (
532548 TextFormatting .WHITE ,
533- "gtbm.multiblock.maga_apiary .outputs" ,
549+ "gtbm.multiblock.mega_apiary .outputs" ,
534550 TextComponentUtil .stringWithColor (
535551 TextFormatting .AQUA ,
536552 stack .getDisplayName ()),
0 commit comments