Fix carrot item not being added to player inventory on Fast Food challenge.

This commit is contained in:
Thanos paravantis 2015-11-14 13:58:23 +02:00
parent ecbc3f3b5d
commit 3f4955de0d
2 changed files with 9 additions and 6 deletions

View File

@ -146,10 +146,10 @@ public class MineWare extends SoloGame implements IThrown
public void PopulateOrders()
{
_challenges.add(ChallengeTreasureDigger.class);
// _challenges.add(ChallengeFastFood.class);
// _challenges.add(ChallengeBlockRunner.class);
// _challenges.add(ChallengeAnvilDance.class);
// _challenges.add(ChallengeFallingBlocks.class);
_challenges.add(ChallengeFastFood.class);
_challenges.add(ChallengeBlockRunner.class);
_challenges.add(ChallengeAnvilDance.class);
_challenges.add(ChallengeFallingBlocks.class);
// _challenges.add(ChallengeWaveCrush.class);
// _challenges.add(ChallengePickASide.class);

View File

@ -34,7 +34,7 @@ public class ChallengeFastFood extends Challenge
{
private static final Material[] _food =
{ Material.APPLE, Material.BREAD, Material.GRILLED_PORK, Material.COOKED_BEEF, Material.RAW_FISH, Material.COOKED_FISH, Material.CAKE,
Material.COOKIE, Material.MELON, Material.COOKED_CHICKEN, Material.CARROT, Material.BAKED_POTATO, Material.PUMPKIN_PIE };
Material.COOKIE, Material.MELON, Material.COOKED_CHICKEN, Material.CARROT_ITEM, Material.BAKED_POTATO, Material.PUMPKIN_PIE };
private static final Material[] _flowers =
{ Material.LONG_GRASS, Material.YELLOW_FLOWER, Material.RED_ROSE };
@ -86,6 +86,8 @@ public class ChallengeFastFood extends Challenge
for(Player player : Host.GetPlayers(true))
{
System.out.println(player.getName());
for(int i = 0; i < 9; i++)
{
player.getInventory().setItem(i, getRandomFood());
@ -173,7 +175,8 @@ public class ChallengeFastFood extends Challenge
data = (byte) UtilMath.r(1);
}
return new ItemStack(foodMaterial, 5, (byte) data);
ItemStack itemStack = new ItemStack(foodMaterial, 5, (byte) data);
return itemStack;
}
private void chanceItemSlot(Player player)