              }
          }
      }
-@@ -68,22 +62,11 @@
+@@ -68,22 +60,11 @@
          for (int j = 0; j < par3; ++j)
          {
              WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
 -            int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + par0Random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1);
-+            ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, weightedrandomchestcontent.theItemId, weightedrandomchestcontent.theMinimumChanceToGenerateItem, weightedrandomchestcontent.theMaximumChanceToGenerateItem);
++            ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(par0Random, par2TileEntityDispenser);
  
 -            if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k)
 +            for (ItemStack item : stacks)

 
 public class WeightedRandomChestContent extends WeightedRandomItem
 {
@@ -42,20 +45,11 @@
             WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
             int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + par0Random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1);
 
-            if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k)
+            ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, weightedrandomchestcontent.theItemId, weightedrandomchestcontent.theMinimumChanceToGenerateItem, weightedrandomchestcontent.theMaximumChanceToGenerateItem);
+
+            for (ItemStack item : stacks)
             {
-                ItemStack itemstack = weightedrandomchestcontent.theItemId.copy();

             }
         }
     }
@@ -109,4 +90,18 @@
 
         return aweightedrandomchestcontent1;
     }
