SteamWar/BauSystem2.0
Archiviert
12
0

Fix BucketEntityEvent on 1.15 (and 1.19 Build servers) #225

Zusammengeführt
YoyoNow hat 1 Commits von fixBucketEntityEvent nach master 2024-03-15 16:34:20 +01:00 zusammengeführt
Nur Änderungen aus Commit aa8d2bfcd0 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -25,6 +25,7 @@ import de.steamwar.bausystem.config.BauServer;
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
import de.steamwar.inventory.SWItem;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import de.steamwar.sql.BauweltMember;
import de.steamwar.techhider.TechHider;
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)
public void onPlayerBucketFill(PlayerBucketFillEvent event) {
if (!Permission.BUILD.hasPermission(event.getPlayer())) {
@ -251,4 +245,15 @@ public class SpectatorListener implements Listener {
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);
}
}
}
}