mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Merge branch '1.7-final' of github.com:Thaumic-Tinkerer/ThaumicTinkerer into 1.7-final
This commit is contained in:
2 files changed
+10
-8
No files matched your search
@@ -38,13 +38,15 @@ public class AspectCropLootManager {
|
||||
for (Integer i : aspectHashmap.values()) {
|
||||
sum += i;
|
||||
}
|
||||
|
||||
Random rand = new Random();
|
||||
int randInt = rand.nextInt(sum);
|
||||
for (Map.Entry<ItemStack, Integer> pair : aspectHashmap.entrySet()) {
|
||||
randInt -= pair.getValue();
|
||||
if (randInt <= 0) {
|
||||
return pair.getKey().copy();
|
||||
if(sum>0)
|
||||
{
|
||||
Random rand = new Random();
|
||||
int randInt = rand.nextInt(sum);
|
||||
for (Map.Entry<ItemStack, Integer> pair : aspectHashmap.entrySet()) {
|
||||
randInt -= pair.getValue();
|
||||
if (randInt <= 0) {
|
||||
return pair.getKey().copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user