mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-22 16:39:30 +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 e8dc99752d06ca40f17f3ad2c829b2447b703d7c..43d15afe4c121c3c808639b6737e157d8cd08f91 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) {
|
|
@@ -4371,3 +4371,4 @@ public abstract class LivingEntity extends Entity {
|
|
|
|
}
|
|
}
|
|
+
|