geforkt von Mirrors/Paper
2873869bb1
Signs no longer have a specific isEdiable state, the entire API in this regard needs updating/deprecation. The boolean field is completely gone, replaced by a uuid (which will need a new setEditingPlayer(UUID) method on the Sign interface), and the current upstream implementation of setEdiable simply flips the is_waxed state. This patch is hence not needed as it neither allows editing (which will be redone in a later patch) nor is required to copy the is_waxed boolean flag as it lives in the signs compound tag and is covered by applyTo.
24 Zeilen
1.4 KiB
Diff
24 Zeilen
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: HexedHero <6012891+HexedHero@users.noreply.github.com>
|
|
Date: Sun, 10 Apr 2022 06:26:32 +0100
|
|
Subject: [PATCH] Add pre-unbreaking amount to PlayerItemDamageEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
index 3bd5338e66ee52d2ba5b89d050dd996dfc82ba7e..7c1f33082f84049544f958bfaa6552012b8cacd7 100644
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
@@ -607,10 +607,11 @@ public final class ItemStack {
|
|
}
|
|
}
|
|
|
|
+ int originalDamage = amount; // Paper
|
|
amount -= k;
|
|
// CraftBukkit start
|
|
if (player instanceof ServerPlayer serverPlayer) { // Paper
|
|
- PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); // Paper
|
|
+ PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount, originalDamage); // Paper
|
|
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
|
|
|
if (amount != event.getDamage() || event.isCancelled()) {
|