mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Make VehicleCreateEvent Cancellable.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
217c93b86b
commit
9d860f7ef6
1 changed files with 13 additions and 1 deletions
|
@ -1,18 +1,30 @@
|
||||||
package org.bukkit.event.vehicle;
|
package org.bukkit.event.vehicle;
|
||||||
|
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle is created.
|
* Raised when a vehicle is created.
|
||||||
*/
|
*/
|
||||||
public class VehicleCreateEvent extends VehicleEvent {
|
public class VehicleCreateEvent extends VehicleEvent implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
public VehicleCreateEvent(final Vehicle vehicle) {
|
public VehicleCreateEvent(final Vehicle vehicle) {
|
||||||
super(vehicle);
|
super(vehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancelled) {
|
||||||
|
this.cancelled = cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
|
|
Loading…
Reference in a new issue