SPIGOT-6616: Cancellable StriderTemperatureChangeEvent

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2021-07-03 09:36:33 +10:00
parent 10f782354b
commit 34e6b033ad

View File

@ -1,6 +1,7 @@
package org.bukkit.event.entity; package org.bukkit.event.entity;
import org.bukkit.entity.Strider; import org.bukkit.entity.Strider;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -8,10 +9,11 @@ import org.jetbrains.annotations.NotNull;
* Called when a {@link Strider}'s temperature has changed as a result of * Called when a {@link Strider}'s temperature has changed as a result of
* entering or existing blocks it considers warm. * entering or existing blocks it considers warm.
*/ */
public class StriderTemperatureChangeEvent extends EntityEvent { public class StriderTemperatureChangeEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private final boolean shivering; private final boolean shivering;
private boolean cancelled;
public StriderTemperatureChangeEvent(@NotNull Strider what, boolean shivering) { public StriderTemperatureChangeEvent(@NotNull Strider what, boolean shivering) {
super(what); super(what);
@ -33,6 +35,16 @@ public class StriderTemperatureChangeEvent extends EntityEvent {
return shivering; return shivering;
} }
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override @Override
@NotNull @NotNull
public HandlerList getHandlers() { public HandlerList getHandlers() {