SteamWar/BauSystem2.0
Archiviert
12
0

Merge pull request 'Fix BucketEntityEvent on 1.15 (and 1.19 Build servers)' (#225) from fixBucketEntityEvent into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #225
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
YoyoNow 2024-03-15 16:34:19 +01:00
Commit 719b38f5af

Datei anzeigen

@ -25,6 +25,7 @@ import de.steamwar.bausystem.config.BauServer;
import de.steamwar.bausystem.utils.BauMemberUpdateEvent; import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
import de.steamwar.linkage.Linked; import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import de.steamwar.sql.BauweltMember; import de.steamwar.sql.BauweltMember;
import de.steamwar.techhider.TechHider; import de.steamwar.techhider.TechHider;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -223,13 +224,6 @@ public class SpectatorListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerBucketEntity(PlayerBucketEntityEvent event) {
if (!Permission.BUILD.hasPermission(event.getPlayer())) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerBucketFill(PlayerBucketFillEvent event) { public void onPlayerBucketFill(PlayerBucketFillEvent event) {
if (!Permission.BUILD.hasPermission(event.getPlayer())) { if (!Permission.BUILD.hasPermission(event.getPlayer())) {
@ -251,4 +245,15 @@ public class SpectatorListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
} }
@Linked
@MinVersion(20)
public static class SpectatorListener20 implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerBucketEntity(PlayerBucketEntityEvent event) {
if (!Permission.BUILD.hasPermission(event.getPlayer())) {
event.setCancelled(true);
}
}
}
} }