mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
36 lines
1.8 KiB
Diff
36 lines
1.8 KiB
Diff
--- a/net/minecraft/world/entity/projectile/EntityEnderSignal.java
|
|
+++ b/net/minecraft/world/entity/projectile/EntityEnderSignal.java
|
|
@@ -16,6 +16,10 @@
|
|
import net.minecraft.world.level.World;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class EntityEnderSignal extends Entity implements ItemSupplier {
|
|
|
|
private static final DataWatcherObject<ItemStack> DATA_ITEM_STACK = DataWatcher.defineId(EntityEnderSignal.class, DataWatcherRegistry.ITEM_STACK);
|
|
@@ -146,7 +150,7 @@
|
|
++this.life;
|
|
if (this.life > 80 && !this.level().isClientSide) {
|
|
this.playSound(SoundEffects.ENDER_EYE_DEATH, 1.0F, 1.0F);
|
|
- this.discard();
|
|
+ this.discard(this.surviveAfterDeath ? EntityRemoveEvent.Cause.DROP : EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
if (this.surviveAfterDeath) {
|
|
this.level().addFreshEntity(new EntityItem(this.level(), this.getX(), this.getY(), this.getZ(), this.getItem()));
|
|
} else {
|
|
@@ -167,7 +171,12 @@
|
|
@Override
|
|
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
|
if (nbttagcompound.contains("Item", 10)) {
|
|
- this.setItem((ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem()));
|
|
+ // CraftBukkit start - SPIGOT-6103 summon, see also SPIGOT-5474
|
|
+ ItemStack itemstack = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem());
|
|
+ if (!itemstack.isEmpty()) {
|
|
+ this.setItem(itemstack);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
} else {
|
|
this.setItem(this.getDefaultItem());
|
|
}
|