SteamWar/BauSystem2.0
Archiviert
12
0

Fix BucketEntityEvent on 1.15 (and 1.19 Build servers)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2024-03-15 16:27:43 +01:00
Ursprung cf329f4236
Commit aa8d2bfcd0

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);
}
}
}
}