mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
c97ce029e9
PaperMC believes that 1.16.2 is now ready for general release as we fixed the main issue plagueing the 1.16.x release, the MapLike data conversion issues. Until now, it was not safe for a server to convert a world to 1.16.2 without data conversion issues around villages and potentially other things. If you did, those MapLike errors meant something went wrong. This is now resolved. Big thanks to all those that helped, notably @BillyGalbreath and @Proximyst who did large parts of the update process with me. Please as always, backup your worlds and test before updating to 1.16.2! If you update to 1.16.2, there is no going back to an older build than this. --------------------------------- Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com> Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com> Co-authored-by: krolik-exe <69214078+krolik-exe@users.noreply.github.com> Co-authored-by: BillyGalbreath <BillyGalbreath@users.noreply.github.com> Co-authored-by: stonar96 <minecraft.stonar96@gmail.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Jason <jasonpenilla2@me.com> Co-authored-by: kashike <kashike@vq.lc> Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com> Co-authored-by: KennyTV <kennytv@t-online.de> Co-authored-by: commandblockguy <commandblockguy1@gmail.com> Co-authored-by: DigitalRegent <misterwener@gmail.com> Co-authored-by: ishland <ishlandmc@yeah.net>
110 lines
4.2 KiB
Diff
110 lines
4.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Sun, 18 Nov 2018 15:53:43 +0000
|
|
Subject: [PATCH] Support cancellation supression of EntityDismount/VehicleExit
|
|
events"
|
|
|
|
Entities must be dismounted before teleportation in order to avoid
|
|
multiple issues in the server with regards to teleportation, shamefully,
|
|
too many plugins rely on the events firing, which means that not firing
|
|
these events caues more issues than it solves;
|
|
|
|
In order to counteract this, Entity dismount/exit vehicle events have
|
|
been modified to supress cancellation (and has a method to allow plugins
|
|
to check if this has been set), noting that cancellation will be silently
|
|
surpressed given that plugins are not expecting this event to not be cancellable.
|
|
|
|
This is a far from ideal scenario, however: given the current state of this
|
|
event and other alternatives causing issues elsewhere, I believe that
|
|
this is going to be the best soultion all around.
|
|
|
|
Improvements/suggestions welcome!
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java
|
|
index 963b9ead4ca0426b2e95c5641b0e89317c48853d..a976c32de6ad5e90b0a96a0f387136ab0f5eb52e 100644
|
|
--- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java
|
|
+++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java
|
|
@@ -13,10 +13,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private boolean cancelled;
|
|
private final LivingEntity exited;
|
|
+ private final boolean isCancellable; // Paper
|
|
|
|
- public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) {
|
|
+ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited, boolean isCancellable) { // Paper
|
|
super(vehicle);
|
|
this.exited = exited;
|
|
+ // Paper start
|
|
+ this.isCancellable = isCancellable;
|
|
+ }
|
|
+
|
|
+ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) {
|
|
+ this(vehicle, exited, true);
|
|
+ // Paper end
|
|
}
|
|
|
|
/**
|
|
@@ -36,9 +44,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
|
|
|
@Override
|
|
public void setCancelled(boolean cancel) {
|
|
+ // Paper start
|
|
+ if (cancel && !isCancellable) {
|
|
+ return;
|
|
+ }
|
|
this.cancelled = cancel;
|
|
}
|
|
|
|
+ public boolean isCancellable() {
|
|
+ return isCancellable;
|
|
+ // paper end
|
|
+ }
|
|
+
|
|
@NotNull
|
|
@Override
|
|
public HandlerList getHandlers() {
|
|
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
|
index 00d8ec81b4ae6ca5e438161ec9135e3c1edea6f4..a7632c8f5cb1bce4be0e456ec34f4a69c5ce80f3 100644
|
|
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
|
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
|
@@ -14,10 +14,19 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private boolean cancelled;
|
|
private final Entity dismounted;
|
|
+ private final boolean isCancellable; // Paper
|
|
|
|
public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) {
|
|
- super(what);
|
|
+ // Paper start
|
|
+ this(what, dismounted, true);
|
|
+ }
|
|
+
|
|
+
|
|
+ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) {
|
|
+ // Paper end
|
|
+ super( what );
|
|
this.dismounted = dismounted;
|
|
+ this.isCancellable = isCancellable; // Paper
|
|
}
|
|
|
|
@NotNull
|
|
@@ -32,9 +41,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
|
|
|
|
@Override
|
|
public void setCancelled(boolean cancel) {
|
|
+ // Paper start
|
|
+ if (cancel && !isCancellable) {
|
|
+ return;
|
|
+ }
|
|
this.cancelled = cancel;
|
|
}
|
|
|
|
+ public boolean isCancellable() {
|
|
+ return isCancellable;
|
|
+ // Paper end
|
|
+ }
|
|
+
|
|
@NotNull
|
|
@Override
|
|
public HandlerList getHandlers() {
|