Caching of drop rates within LootManager
This commit is contained in:
1 parent
4e01c8e794
commit
95a9e45391
5 files changed
+271
-156
No files matched your search
@@ -12,7 +12,6 @@ package engine.objects;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
@@ -25,6 +24,8 @@ import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static engine.gameManager.LootManager.LOOTMANAGER;
|
||||
|
||||
public class LootTable {
|
||||
|
||||
private static final ConcurrentHashMap<Integer, LootTable> lootGroups = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
@@ -165,7 +166,7 @@ public class LootTable {
|
||||
|
||||
float chance = mlb.getChance() * .01f;
|
||||
|
||||
chance *= Float.parseFloat(ConfigManager.MB_NORMAL_DROP_RATE.getValue());
|
||||
chance *= LOOTMANAGER.NORMAL_DROP_RATE;
|
||||
|
||||
calculatedLootTable = mlb.getLootTableID();
|
||||
|
||||
|
||||
Reference in new issue
Block a user