geforkt von Mirrors/Paper
7ef05fbd8a
CB blindly drops any update flags when recording block modifications, this causes the debug stick to blindly update neighbouring blocks on usage in order to control this, we will special case this item, however, this ideally should be fixed by recording the actual update flags used, but will induce ABI breaks... This patch also maintains the behavior of the BlockPlaceEvent, this behavior will NOT be guaranteed in the future, however.
30 Zeilen
2.0 KiB
Diff
30 Zeilen
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: JRoy <joshroy126@gmail.com>
|
|
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 45379bf4903ca8044145504207acd59c221b7f26..c9b834c38f8d7b21d0a7a0d04762f66d41b0c39d 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -2612,9 +2612,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().getRecipe(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().getRecipe(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> {
|
|
+ ((ContainerRecipeBook) this.player.activeContainer).a(event.isMakeAll(), irecipe, this.player);
|
|
+ });
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
}
|
|
|