Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
[Bleeding] Implemented ProjectileLaunchEvent. Addresses BUKKIT-284
Dieser Commit ist enthalten in:
Ursprung
6f6f8ef008
Commit
92f771a022
@ -897,6 +897,11 @@ public class World implements IBlockAccess {
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
} else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Projectile) {
|
||||
// Not all projectiles extend EntityProjectile, so check for Bukkit interface instead
|
||||
if (CraftEventFactory.callProjectileLaunchEvent(entity).isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
@ -491,4 +491,11 @@ public class CraftEventFactory {
|
||||
|
||||
return CraftItemStack.createNMSItemStack(bitem);
|
||||
}
|
||||
|
||||
public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) {
|
||||
Projectile bukkitEntity = (Projectile) entity.getBukkitEntity();
|
||||
ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren