From 4091c6ac4da4eb8a8aaa1be86fb575478fc09eb0 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Fri, 13 Dec 2024 20:17:05 +0100 Subject: [PATCH] Follow up on block entities --- .../world/level/block/entity/BellBlockEntity.java.patch | 2 +- .../block/entity/ChiseledBookShelfBlockEntity.java.patch | 2 +- .../world/level/block/entity/HopperBlockEntity.java.patch | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/entity/BellBlockEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/entity/BellBlockEntity.java.patch index 1cc3771a2f..0f09f0acaf 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/entity/BellBlockEntity.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/entity/BellBlockEntity.java.patch @@ -35,7 +35,7 @@ private static void makeRaidersGlow(Level level, BlockPos pos, List raiders) { - raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).forEach(BellBlockEntity::glow); + // Paper start - call bell resonate event and bell reveal raider event -+ final List inRangeRaiders = raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).map(e -> e.getBukkitEntity()).toList(); ++ final List inRangeRaiders = raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).map(e -> (org.bukkit.entity.LivingEntity) e.getBukkitEntity()).toList(); + org.bukkit.craftbukkit.event.CraftEventFactory.handleBellResonateEvent(level, pos, inRangeRaiders).forEach(e -> glow(e, pos)); + // Paper end - call bell resonate event and bell reveal raider event } diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java.patch index bb3e767def..746ad85ba8 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java.patch @@ -24,7 +24,7 @@ + } + + @Override -+ public List getViewers() { ++ public java.util.List getViewers() { + return this.transaction; + } + diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch index 9f296844d6..20e268ca9c 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch @@ -76,7 +76,7 @@ + + org.bukkit.inventory.Inventory destinationInventory; + // Have to special case large chests as they work oddly -+ if (attachedContainer instanceof final CompoundContainer compoundContainer) { ++ if (attachedContainer instanceof final net.minecraft.world.CompoundContainer compoundContainer) { + destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest(compoundContainer); + } else if (attachedContainer.getOwner() != null) { + destinationInventory = attachedContainer.getOwner().getInventory(); @@ -140,7 +140,7 @@ + + org.bukkit.inventory.Inventory sourceInventory; + // Have to special case large chests as they work oddly -+ if (container instanceof final CompoundContainer compoundContainer) { ++ if (container instanceof final net.minecraft.world.CompoundContainer compoundContainer) { + sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest(compoundContainer); + } else if (container.getOwner() != null) { + sourceInventory = container.getOwner().getInventory();