geforkt von Mirrors/Paper
Fix opening inv in PlayerRecipeBookClickEvent handler (#7552)
Dieser Commit ist enthalten in:
Ursprung
ea12aebb11
Commit
883d523cc7
@ -14,13 +14,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) {
|
||||
- this.server.getRecipeManager().byKey(packet.getRecipe()).ifPresent((irecipe) -> {
|
||||
- ((RecipeBookMenu) this.player.containerMenu).handlePlacement(packet.isShiftDown(), 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(packet.getRecipe()), packet.isShiftDown());
|
||||
+ if (event.callEvent()) {
|
||||
+ if (event.callEvent() && this.player.containerMenu instanceof RecipeBookMenu<?> recipeBookMenu) { // check if inventory changed during event handling
|
||||
+ this.server.getRecipeManager().byKey(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> {
|
||||
+ ((RecipeBookMenu) this.player.containerMenu).handlePlacement(event.isMakeAll(), irecipe, this.player);
|
||||
});
|
||||
+ recipeBookMenu.handlePlacement(event.isMakeAll(), irecipe, this.player);
|
||||
+ });
|
||||
+ } // Paper end
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren