diff --git a/src/main/java/net/minecraft/util/WeightedRandom.java b/src/main/java/net/minecraft/util/WeightedRandom.java index e61d0c8..1643eef 100644 --- a/src/main/java/net/minecraft/util/WeightedRandom.java +++ b/src/main/java/net/minecraft/util/WeightedRandom.java @@ -27,9 +27,15 @@ { throw new IllegalArgumentException(); } - else + return getItem(par1Collection, par0Random.nextInt(par2)); + } + + //Forge: Added to allow custom random implementations, Modder is responsible for making sure the + //'weight' is under the totalWeight of the items. + public static WeightedRandom.Item getItem(Collection par1Collection, int weight) + { { - int j = par0Random.nextInt(par2); + int j = weight; Iterator iterator = par1Collection.iterator(); WeightedRandom.Item item; @@ -75,9 +81,15 @@ { throw new IllegalArgumentException(); } - else + return getItem(par1ArrayOfWeightedRandomItem, par0Random.nextInt(par2)); + } + + //Forge: Added to allow custom random implementations, Modder is responsible for making sure the + //'weight' is under the totalWeight of the items. + public static WeightedRandom.Item getItem(WeightedRandom.Item[] par1ArrayOfWeightedRandomItem, int weight) + { { - int j = par0Random.nextInt(par2); + int j = weight; WeightedRandom.Item[] aitem = par1ArrayOfWeightedRandomItem; int k = par1ArrayOfWeightedRandomItem.length; diff --git a/src/main/resources/fmlversion.properties b/src/main/resources/fmlversion.properties index 23d62b6..76fe9d1 100644 --- a/src/main/resources/fmlversion.properties +++ b/src/main/resources/fmlversion.properties @@ -1,6 +1,6 @@ fmlbuild.major.number=7 fmlbuild.minor.number=2 fmlbuild.revision.number=172 -fmlbuild.build.number=27 +fmlbuild.build.number=28 fmlbuild.mcversion=1.7.2 fmlbuild.mcpversion=9.03