Skip to content

Commit

Permalink
Cancel interact if not owner accessing spawner
Browse files Browse the repository at this point in the history
  • Loading branch information
ceze88 committed Feb 12, 2024
1 parent 0f2ff1e commit b96ba74
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ public void playerInteractEvent(PlayerInteractEvent event) {
}

if (!player.isSneaking()) {
if (!spawner.getPlacedBy().getUniqueId().equals(event.getPlayer().getUniqueId())) {
player.sendMessage(this.plugin.getLocale().getMessage("event.general.protected").getPrefixedMessage());
return;
}
SpawnerTier spawnerTier = this.plugin.getSpawnerManager().getSpawnerTier(item);
if (spawnerTier == null) {
return;
Expand Down

0 comments on commit b96ba74

Please sign in to comment.