diff --git a/src/main/java/noppes/npcs/DataInventory.java b/src/main/java/noppes/npcs/DataInventory.java index 22fb23edc..c4e5b8c9a 100644 --- a/src/main/java/noppes/npcs/DataInventory.java +++ b/src/main/java/noppes/npcs/DataInventory.java @@ -15,8 +15,10 @@ import noppes.npcs.entity.EntityNPCInterface; import java.util.ArrayList; import java.util.HashMap; +import java.util.Random; -public class DataInventory implements IInventory{ +public class DataInventory implements IInventory { + public static Random random = new Random(); public HashMap items = new HashMap(); public HashMap dropchance = new HashMap(); public HashMap weapons = new HashMap(); @@ -102,10 +104,12 @@ public class DataInventory implements IInventory{ if(item == null) continue; double dchance = 100; + double chance = random.nextDouble() * 100; if(dropchance.containsKey(i)) dchance = dropchance.get(i); - double chance = Math.random()*100 + dchance; - if(chance >= 100){ + + // double chance = Math.random()*100 + dchance; + if(chance < dchance){ EntityItem e = getEntityItem(item.copy()); if(e != null) list.add(e);