diff options
author | Aikar <[email protected]> | 2020-08-06 22:49:50 -0400 |
---|---|---|
committer | Daniel Ennis <[email protected]> | 2020-08-06 22:55:24 -0400 |
commit | adadf16548ad220bf178596f8b9bc0a0ffeaef19 (patch) | |
tree | 35cb9d5d115d5c46287914614d5512ed0864aca7 /Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch | |
parent | 6f66fa57143ad9a48a8f812cf13acf62393aa56c (diff) | |
download | Paper-adadf16548ad220bf178596f8b9bc0a0ffeaef19.tar.gz Paper-adadf16548ad220bf178596f8b9bc0a0ffeaef19.zip |
Drop syncPosition on teleportation patch
I'm not sure it was really helping, and now suspecting it might be causing issues
Movement sucks
Diffstat (limited to 'Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch')
-rw-r--r-- | Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch new file mode 100644 index 0000000000..3408f0cdc3 --- /dev/null +++ b/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy <[email protected]> +Date: Fri, 5 Jun 2020 18:24:06 -0400 +Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 4050fa4b8ed060599fb3c14622737117fb2602df..eb21aefa092d00e5ead2177282170fcf3617808c 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -2514,9 +2514,15 @@ public class PlayerConnection implements PacketListenerPlayIn { + PlayerConnectionUtils.ensureMainThread(packetplayinautorecipe, this, this.player.getWorldServer()); + this.player.resetIdleTimer(); + if (!this.player.isSpectator() && this.player.activeContainer.windowId == packetplayinautorecipe.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer instanceof ContainerRecipeBook) { +- this.minecraftServer.getCraftingManager().a(packetplayinautorecipe.c()).ifPresent((irecipe) -> { +- ((ContainerRecipeBook) this.player.activeContainer).a(packetplayinautorecipe.d(), irecipe, this.player); +- }); ++ // Paper start - fire event for clicking recipes in the recipe book ++ com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent event = new com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent( ++ player.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(packetplayinautorecipe.c()), packetplayinautorecipe.d()); ++ if (event.callEvent()) { ++ this.minecraftServer.getCraftingManager().a(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> { ++ ((ContainerRecipeBook) this.player.activeContainer).a(event.isMakeAll(), irecipe, this.player); ++ }); ++ } ++ // Paper end + } + } + |