Skip to content

Commit b83a247

Browse files
Copilotptthanh02
andcommitted
Complete spawner duplication exploit fix with comprehensive validation
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
1 parent 6926a5d commit b83a247

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

core/src/main/java/github/nighter/smartspawner/commands/list/gui/adminstacker/AdminStackerHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ private void handleStackChange(Player player, SpawnerData spawner, String worldN
9393
return;
9494
}
9595

96+
// Validate spawner integrity before allowing admin operations
97+
if (spawnerManager.isGhostSpawner(spawner)) {
98+
messageService.sendMessage(player, "spawner_invalid");
99+
return;
100+
}
101+
96102
int newStackSize = spawner.getStackSize() + change;
97103

98104
// Ensure stack size is within valid bounds

core/src/main/java/github/nighter/smartspawner/spawner/interactions/stack/SpawnerStackHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public boolean handleSpawnerStack(Player player, SpawnerData targetSpawner, Item
9696
return false;
9797
}
9898

99+
// Validate spawner integrity before allowing stacking operations
100+
if (plugin.getSpawnerManager().isGhostSpawner(targetSpawner)) {
101+
messageService.sendMessage(player, "spawner_invalid");
102+
return false;
103+
}
104+
99105
Location location = targetSpawner.getSpawnerLocation();
100106
if (!hasStackPermissions(player, location)) {
101107
return false;

0 commit comments

Comments
 (0)