File tree Expand file tree Collapse file tree
core/src/main/java/github/nighter/smartspawner/spawner/lootgen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,33 +90,13 @@ public void spawnLootToSpawner(SpawnerData spawner) {
9090
9191 try {
9292 final long currentTime = System .currentTimeMillis ();
93-
94- boolean dataLockAcquired = false ;
95- try {
96- dataLockAcquired = spawner .getDataLock ().tryLock (50 , java .util .concurrent .TimeUnit .MILLISECONDS );
97- } catch (InterruptedException e ) {
98- Thread .currentThread ().interrupt ();
99- return ;
100- }
101-
102- if (!dataLockAcquired ) {
103- boolean resetLockAcquired = spawner .getDataLock ().tryLock ();
104- if (resetLockAcquired ) {
105- try {
106- spawner .setLastSpawnTime (currentTime );
107- } finally {
108- spawner .getDataLock ().unlock ();
109- }
110- }
111- return ;
112- }
113-
11493 final long spawnTime ;
11594 final int minMobs ;
11695 final int maxMobs ;
11796 final AtomicInteger usedSlots ;
11897 final AtomicInteger maxSlots ;
11998
99+ spawner .getDataLock ().lock ();
120100 try {
121101 long lastSpawnTime = spawner .getLastSpawnTime ();
122102 long spawnDelay = spawner .getSpawnDelay ();
You can’t perform that action at this time.
0 commit comments