0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2025-04-13 21:03:50 +00:00
Files
2025-03-26 03:05:00 +11:00

28 lines
1.5 KiB
Diff

--- a/net/minecraft/world/entity/raid/PersistentRaid.java
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
@@ -151,11 +151,23 @@
Raid raid = this.getOrCreateRaid(worldserver, blockposition2);
+ /* CraftBukkit - moved down
if (!raid.isStarted() && !this.raidMap.containsValue(raid)) {
this.raidMap.put(this.getUniqueId(), raid);
}
+ */
- if (!raid.isStarted() || raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel()) {
+ if (!raid.isStarted() || (raid.isInProgress() && raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel())) { // CraftBukkit - fixed a bug with raid: players could add up Bad Omen level even when the raid had finished
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, worldserver, entityplayer)) {
+ entityplayer.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
+ return null;
+ }
+
+ if (!raid.isStarted() && !this.raidMap.containsValue(raid)) {
+ this.raidMap.put(this.getUniqueId(), raid);
+ }
+ // CraftBukkit end
raid.absorbRaidOmen(entityplayer);
}