mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 12:41:25 +01:00
SPIGOT-6616: Cancellable StriderTemperatureChangeEvent
By: md_5 <git@md-5.net>
This commit is contained in:
parent
10f782354b
commit
34e6b033ad
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user