2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityEnderSignal.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityEnderSignal.java
|
2024-02-21 20:55:34 +11:00
|
|
|
@@ -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);
|
|
|
|
@@ -35,7 +39,7 @@
|
2020-08-28 12:35:14 +10:00
|
|
|
}
|
2020-08-26 18:20:19 +10:00
|
|
|
|
2020-09-11 07:00:00 +10:00
|
|
|
public void setItem(ItemStack itemstack) {
|
2021-11-22 09:00:00 +11:00
|
|
|
- if (!itemstack.is(Items.ENDER_EYE) || itemstack.hasTag()) {
|
|
|
|
+ if (true || !itemstack.is(Items.ENDER_EYE) || itemstack.hasTag()) { // CraftBukkit - always allow item changing
|
2023-06-08 01:30:00 +10:00
|
|
|
this.getEntityData().set(EntityEnderSignal.DATA_ITEM_STACK, itemstack.copyWithCount(1));
|
|
|
|
}
|
|
|
|
|
2024-02-21 20:55:34 +11:00
|
|
|
@@ -150,7 +154,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 {
|
|
|
|
@@ -177,7 +181,7 @@
|
2021-11-22 09:00:00 +11:00
|
|
|
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
|
|
|
ItemStack itemstack = ItemStack.of(nbttagcompound.getCompound("Item"));
|
2020-08-26 18:20:19 +10:00
|
|
|
|
2020-09-11 07:00:00 +10:00
|
|
|
- this.setItem(itemstack);
|
|
|
|
+ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474
|
2020-08-26 18:20:19 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|