From 4f7b7bb31a0fae3a07507f7ec1a148c9da05f0f0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 22 Apr 2016 15:45:22 -0500 Subject: [PATCH] Fix EntityDismountEvent and VehicleExitEvent cancellation Perhaps "workaround" would be the better term --- ...ityRegainHealthEvent-isFastRegen-API.patch | 3 +-- ...Made-EntityDismountEvent-Cancellable.patch | 13 +++++++--- ...oreboards-for-non-players-by-default.patch | 6 ++--- .../0102-Don-t-teleport-dead-entities.patch | 6 ++--- ...45-Fix-VehicleExitEvent-cancellation.patch | 25 +++++++++++++++++++ 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 Spigot-Server-Patches/0145-Fix-VehicleExitEvent-cancellation.patch diff --git a/Spigot-API-Patches/0037-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-API-Patches/0037-EntityRegainHealthEvent-isFastRegen-API.patch index 43e535ea43..26d3b74f5d 100644 --- a/Spigot-API-Patches/0037-EntityRegainHealthEvent-isFastRegen-API.patch +++ b/Spigot-API-Patches/0037-EntityRegainHealthEvent-isFastRegen-API.patch @@ -1,9 +1,8 @@ -From 32304a72413a8faddc6192b78f7bbc5850810763 Mon Sep 17 00:00:00 2001 +From e99524d7eec1240e136ac933dccd3f8ac9e72902 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 22 Apr 2016 01:43:11 -0500 Subject: [PATCH] EntityRegainHealthEvent isFastRegen API -Don't even get me started diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index a7b3517..703520f 100644 diff --git a/Spigot-Server-Patches/0060-Made-EntityDismountEvent-Cancellable.patch b/Spigot-Server-Patches/0060-Made-EntityDismountEvent-Cancellable.patch index 5c682967a5..e71b415a1f 100644 --- a/Spigot-Server-Patches/0060-Made-EntityDismountEvent-Cancellable.patch +++ b/Spigot-Server-Patches/0060-Made-EntityDismountEvent-Cancellable.patch @@ -1,20 +1,25 @@ -From 5c4d7d8d8e6ff1d01202e5de62da63fe66c55c96 Mon Sep 17 00:00:00 2001 +From 031f1df60d5934708755d7afe14817d30fdf8b4d Mon Sep 17 00:00:00 2001 From: Nik Gil Date: Thu, 3 Mar 2016 04:04:19 -0600 Subject: [PATCH] Made EntityDismountEvent Cancellable diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 782abd6..c3e6588 100644 +index 782abd6..b15c5f6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1741,7 +1741,9 @@ public abstract class Entity implements ICommandListener { +@@ -1741,7 +1741,14 @@ public abstract class Entity implements ICommandListener { } } // CraftBukkit end - Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity())); // Spigot + // Paper start - make EntityDismountEvent cancellable -+ if (!new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()).callEvent()) return; ++ if (!new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()).callEvent()) { ++ if (entity instanceof EntityPlayer) { ++ ((EntityPlayer) entity).playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this)); ++ } ++ return; ++ } + // Paper end this.passengers.remove(entity); entity.j = 60; diff --git a/Spigot-Server-Patches/0076-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0076-Disable-Scoreboards-for-non-players-by-default.patch index 3ed71064ca..e60591f494 100644 --- a/Spigot-Server-Patches/0076-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0076-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From 4fd34aff149d7fee35a8e3b18e2e007bb2225d97 Mon Sep 17 00:00:00 2001 +From 5f3dd9383f6ea18ea59df19c28d68bea36d87d98 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 8 Mar 2016 23:25:45 -0500 Subject: [PATCH] Disable Scoreboards for non players by default @@ -37,10 +37,10 @@ index b044f33..1758a56 100644 if (scoreboard.addPlayerToTeam(s2, s)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5ff5c54..f9626d6 100644 +index fc4d72f..14ab2da 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1847,6 +1847,7 @@ public abstract class Entity implements ICommandListener { +@@ -1852,6 +1852,7 @@ public abstract class Entity implements ICommandListener { } public ScoreboardTeamBase aO() { diff --git a/Spigot-Server-Patches/0102-Don-t-teleport-dead-entities.patch b/Spigot-Server-Patches/0102-Don-t-teleport-dead-entities.patch index 9b76bdb6e1..3096058b9d 100644 --- a/Spigot-Server-Patches/0102-Don-t-teleport-dead-entities.patch +++ b/Spigot-Server-Patches/0102-Don-t-teleport-dead-entities.patch @@ -1,4 +1,4 @@ -From 113483e5a4e9d1f9f4f0b98b2d80ceb075c323ba Mon Sep 17 00:00:00 2001 +From 8a8060df1836f7082b54b4fda091c10e1cefd2d6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 22 Mar 2016 00:55:23 -0400 Subject: [PATCH] Don't teleport dead entities @@ -7,10 +7,10 @@ Had some issue with this in past, and this is the vanilla logic. Potentially an old CB change that's no longer needed. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4a4fe34..49e6661 100644 +index 8c26c0e..1bc39f5 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2097,7 +2097,7 @@ public abstract class Entity implements ICommandListener { +@@ -2102,7 +2102,7 @@ public abstract class Entity implements ICommandListener { } public Entity teleportTo(Location exit, boolean portal) { diff --git a/Spigot-Server-Patches/0145-Fix-VehicleExitEvent-cancellation.patch b/Spigot-Server-Patches/0145-Fix-VehicleExitEvent-cancellation.patch new file mode 100644 index 0000000000..8bddedbc74 --- /dev/null +++ b/Spigot-Server-Patches/0145-Fix-VehicleExitEvent-cancellation.patch @@ -0,0 +1,25 @@ +From acbc64e0d3be4b92b05dfb9cac09fd7d2f0f021a Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Fri, 22 Apr 2016 15:42:44 -0500 +Subject: [PATCH] Fix VehicleExitEvent cancellation + + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 8512105..1f59225 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -1739,6 +1739,11 @@ public abstract class Entity implements ICommandListener { + CraftEntity craftn = (CraftEntity) entity.getBukkitEntity().getVehicle(); + Entity n = craftn == null ? null : craftn.getHandle(); + if (event.isCancelled() || n != orig) { ++ // Paper - Fix cancellation ++ if (entity instanceof EntityPlayer) { ++ ((EntityPlayer) entity).playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this)); ++ } ++ // Paper end + return; + } + } +-- +2.8.0 +