mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Follow up on block entities
This commit is contained in:
parent
b95e27be6c
commit
4091c6ac4d
3 changed files with 4 additions and 4 deletions
|
@ -35,7 +35,7 @@
|
||||||
private static void makeRaidersGlow(Level level, BlockPos pos, List<LivingEntity> raiders) {
|
private static void makeRaidersGlow(Level level, BlockPos pos, List<LivingEntity> raiders) {
|
||||||
- raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).forEach(BellBlockEntity::glow);
|
- raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).forEach(BellBlockEntity::glow);
|
||||||
+ // Paper start - call bell resonate event and bell reveal raider event
|
+ // Paper start - call bell resonate event and bell reveal raider event
|
||||||
+ final List<org.bukkit.entity.LivingEntity> inRangeRaiders = raiders.stream().filter(raider -> isRaiderWithinRange(pos, raider)).map(e -> e.getBukkitEntity()).toList();
|
+ final List<org.bukkit.entity.LivingEntity> 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));
|
+ 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
|
+ // Paper end - call bell resonate event and bell reveal raider event
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public List<org.bukkit.entity.HumanEntity> getViewers() {
|
+ public java.util.List<org.bukkit.entity.HumanEntity> getViewers() {
|
||||||
+ return this.transaction;
|
+ return this.transaction;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
+
|
+
|
||||||
+ org.bukkit.inventory.Inventory destinationInventory;
|
+ org.bukkit.inventory.Inventory destinationInventory;
|
||||||
+ // Have to special case large chests as they work oddly
|
+ // 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);
|
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest(compoundContainer);
|
||||||
+ } else if (attachedContainer.getOwner() != null) {
|
+ } else if (attachedContainer.getOwner() != null) {
|
||||||
+ destinationInventory = attachedContainer.getOwner().getInventory();
|
+ destinationInventory = attachedContainer.getOwner().getInventory();
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
+
|
+
|
||||||
+ org.bukkit.inventory.Inventory sourceInventory;
|
+ org.bukkit.inventory.Inventory sourceInventory;
|
||||||
+ // Have to special case large chests as they work oddly
|
+ // 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);
|
+ sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest(compoundContainer);
|
||||||
+ } else if (container.getOwner() != null) {
|
+ } else if (container.getOwner() != null) {
|
||||||
+ sourceInventory = container.getOwner().getInventory();
|
+ sourceInventory = container.getOwner().getInventory();
|
||||||
|
|
Loading…
Reference in a new issue