2021-06-15 05:50:26 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
|
|
Date: Wed, 26 May 2021 17:09:07 -0400
|
|
|
|
Subject: [PATCH] Add BellRevealRaiderEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
2024-01-21 19:37:09 +01:00
|
|
|
index d21f7e9712ac2d9088ce19d415e4ba7863d8cebf..aee8401e72228d0bbf89b940715f405353093585 100644
|
2021-06-15 05:50:26 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
2023-04-07 20:39:13 +02:00
|
|
|
@@ -156,7 +156,7 @@ public class BellBlockEntity extends BlockEntity {
|
|
|
|
return BellBlockEntity.isRaiderWithinRange(pos, entityliving);
|
|
|
|
}).map((entity) -> (org.bukkit.entity.LivingEntity) entity.getBukkitEntity()).collect(java.util.stream.Collectors.toCollection(java.util.ArrayList::new)); // CraftBukkit
|
|
|
|
|
|
|
|
- org.bukkit.craftbukkit.event.CraftEventFactory.handleBellResonateEvent(world, pos, entities).forEach(BellBlockEntity::glow);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBellResonateEvent(world, pos, entities).forEach(entity -> glow(entity, pos)); // Paper - Add BellRevealRaiderEvent
|
2023-04-07 20:39:13 +02:00
|
|
|
// CraftBukkit end
|
2021-06-15 05:50:26 +02:00
|
|
|
}
|
|
|
|
|
2023-04-07 20:39:13 +02:00
|
|
|
@@ -191,7 +191,11 @@ public class BellBlockEntity extends BlockEntity {
|
2022-03-01 06:43:03 +01:00
|
|
|
return entity.isAlive() && !entity.isRemoved() && pos.closerToCenterThan(entity.position(), 48.0D) && entity.getType().is(EntityTypeTags.RAIDERS);
|
2021-06-15 05:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- private static void glow(LivingEntity entity) {
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper start - Add BellRevealRaiderEvent
|
2021-06-15 05:50:26 +02:00
|
|
|
+ private static void glow(LivingEntity entity) { glow(entity, null); }
|
2021-11-24 23:50:33 +01:00
|
|
|
+ private static void glow(LivingEntity entity, @javax.annotation.Nullable BlockPos pos) {
|
2023-06-08 22:56:13 +02:00
|
|
|
+ if (pos != null && !new io.papermc.paper.event.block.BellRevealRaiderEvent(entity.level().getWorld().getBlockAt(io.papermc.paper.util.MCUtil.toLocation(entity.level(), pos)), entity.getBukkitEntity()).callEvent()) return;
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper end - Add BellRevealRaiderEvent
|
2021-06-15 05:50:26 +02:00
|
|
|
entity.addEffect(new MobEffectInstance(MobEffects.GLOWING, 60));
|
|
|
|
}
|
|
|
|
|