mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
31 lines
1.8 KiB
Diff
31 lines
1.8 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 5b5d8d2430f2b92f56ea3fb0e9a35aa4b9aea48f..f6bff4eb349f51a20516aecb010d19d5f625575e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -1642,12 +1642,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
|
- EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
|
+ EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot, true); // Leaves - can dont shrink
|
|
event.setCancelled(itemstack == null);
|
|
this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
|
|
if (!event.isCancelled()) {
|
|
- if (!itemstack1.isEmpty() && itemstack != null) { // Paper - only reduce item if actual totem was found
|
|
+ if (!itemstack1.isEmpty() && itemstack != null && event.isShrink()) { // Paper - only reduce item if actual totem was found // Leaves - can dont shrink
|
|
itemstack1.shrink(1);
|
|
}
|
|
if (itemstack != null && this instanceof ServerPlayer) {
|
|
@@ -4546,3 +4546,4 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
}
|
|
}
|
|
+
|