Skip to content

Commit 2f2049f

Browse files
Fix spawners issue
1 parent c0286c4 commit 2f2049f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/parallelmc/parallelutils/modules/custommobs/registry/SpawnerRegistry.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public boolean deleteSpawner(Location location) {
125125
SpawnerData result = spawners.remove(location);
126126

127127
if (result != null) {
128-
deleteSpawnerDatabase(location);
128+
deleteSpawnerDatabase(result.getUuid());
129129
return true;
130130
}
131131

@@ -364,15 +364,9 @@ public void run() {
364364

365365
/**
366366
* Removes a spawner from the database
367-
* @param loc The location of the spawner
367+
* @param uuid The UUID of the spawner
368368
*/
369-
private void deleteSpawnerDatabase(Location loc) {
370-
SpawnerData spawner = getSpawner(loc);
371-
372-
if (spawner == null) return;
373-
374-
String uuid = spawner.getUuid();
375-
369+
private void deleteSpawnerDatabase(String uuid) {
376370
Bukkit.getScheduler().runTaskAsynchronously(puPlugin, new Runnable() {
377371
@Override
378372
public void run() {

0 commit comments

Comments
 (0)