Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Fix a possible hangup with random weapon creation
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Aug 26, 2014
1 parent 24de1af commit 6576a2f
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -88,9 +88,10 @@ protected ItemStack[] generateChestContent(Random random, IInventory newInventor
if(items[i] == null)
continue;

// get a material
Integer matId = materialIDs.get(random.nextInt(materialIDs.size()));

do {
// get a material
Integer matId = materialIDs.get(random.nextInt(materialIDs.size()));
parts[i] = new ItemStack(items[i], 1, matId);
} while(((IToolPart)items[i]).getMaterialID(parts[i]) == -1);
}
Expand Down

0 comments on commit 6576a2f

Please sign in to comment.