work on adventure
This commit is contained in:
parent
bb1351cb8d
commit
1444b3632e
20 changed files with 288 additions and 155 deletions
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityDamageItemEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf1c1e5a21 100644
|
||||
index c8af2f886ad834d6a405df00560b0f8225fcf471..2623df859c2e484515abf53e3f35d0335467dceb 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -639,7 +639,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -648,7 +648,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
return (Integer) this.getOrDefault(DataComponents.MAX_DAMAGE, 0);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf
|
|||
if (this.isDamageableItem()) {
|
||||
int j;
|
||||
|
||||
@@ -655,8 +655,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -664,8 +664,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
||||
amount -= k;
|
||||
// CraftBukkit start
|
||||
|
@ -28,7 +28,7 @@ index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf
|
|||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (amount != event.getDamage() || event.isCancelled()) {
|
||||
@@ -667,6 +667,14 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -676,6 +676,14 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
|
||||
amount = event.getDamage();
|
||||
|
@ -43,7 +43,7 @@ index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf
|
|||
}
|
||||
// CraftBukkit end
|
||||
if (amount <= 0) {
|
||||
@@ -674,8 +682,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -683,8 +691,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf
|
|||
}
|
||||
|
||||
j = this.getDamageValue() + amount;
|
||||
@@ -708,7 +716,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -717,7 +725,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
entityplayer = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue