diff --git a/java/net/universe_factory/minecraft/test/Test.java b/java/net/universe_factory/minecraft/test/Test.java index 3ef8df6..de234c2 100644 --- a/java/net/universe_factory/minecraft/test/Test.java +++ b/java/net/universe_factory/minecraft/test/Test.java @@ -1,5 +1,7 @@ package net.universe_factory.minecraft.test; +import java.util.ArrayList; + import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; @@ -35,7 +37,9 @@ public class Test { } @Override - public ItemStack getDrop(World world, int x, int y, int z, int meta, int fortune) { + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) { + ArrayList ret = new ArrayList(); + int chance = 30; if (fortune > 0) { @@ -46,9 +50,9 @@ public class Test { } if (world.rand.nextInt(chance) == 0) - return new ItemStack(cherries, 1); + ret.add(new ItemStack(cherries, 1)); - return null; + return ret; } }); diff --git a/java/net/universe_factory/minecraft/test/generic/GenericWood.java b/java/net/universe_factory/minecraft/test/generic/GenericWood.java index bdee1f9..ac644e1 100644 --- a/java/net/universe_factory/minecraft/test/generic/GenericWood.java +++ b/java/net/universe_factory/minecraft/test/generic/GenericWood.java @@ -1,5 +1,6 @@ package net.universe_factory.minecraft.test.generic; +import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -225,8 +226,7 @@ public class GenericWood { this.dropBlockAsItem(world, x, y, z, new ItemStack(item, 1, this.damageDropped(meta))); } - ItemStack drop = info.getDrop(world, x, y, z, meta, fortune); - if (drop != null) + for (ItemStack drop : info.getDrops(world, x, y, z, meta, fortune)) this.dropBlockAsItem(world, x, y, z, drop); } } @@ -342,8 +342,8 @@ public class GenericWood { public abstract int getMinTreeHeight(); - public ItemStack getDrop(World world, int x, int y, int z, int meta, int fortune) { - return null; + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) { + return new ArrayList(); } } }