mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
Date: Wed, 30 Mar 2022 08:58:45 +0000
|
|
Subject: [PATCH] Add isShrink to EntityResurrectEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index cff7993bdafd2f69e46c9985c7601a69ae47f452..2dee51917888e20768f434b8232430094028b516 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -1530,12 +1530,12 @@ public abstract class LivingEntity extends Entity {
|
|
}
|
|
}
|
|
|
|
- EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity());
|
|
+ EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), true);
|
|
event.setCancelled(itemstack == null);
|
|
this.level.getCraftServer().getPluginManager().callEvent(event);
|
|
|
|
if (!event.isCancelled()) {
|
|
- if (!itemstack1.isEmpty()) {
|
|
+ if (!itemstack1.isEmpty() && event.isShrink()) {
|
|
itemstack1.shrink(1);
|
|
}
|
|
if (itemstack != null && this instanceof ServerPlayer) {
|
|
@@ -4374,3 +4374,4 @@ public abstract class LivingEntity extends Entity {
|
|
|
|
}
|
|
}
|
|
+
|