2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/entity/raid/PersistentRaid.java
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
2024-04-23 17:15:00 +02:00
@@ -115,11 +115,23 @@
2019-08-12 13:43:10 +02:00
2024-04-23 17:15:00 +02:00
Raid raid = this.getOrCreateRaid(entityplayer.serverLevel(), blockposition2);
2019-08-12 13:43:10 +02:00
2024-04-23 17:15:00 +02:00
+ /* CraftBukkit - moved down
if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
this.raidMap.put(raid.getId(), raid);
2019-08-12 13:43:10 +02:00
}
2024-04-23 17:15:00 +02:00
+ */
2019-08-12 13:43:10 +02:00
2024-04-23 17:15:00 +02:00
- 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
2019-08-12 13:43:10 +02:00
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, entityplayer)) {
2024-04-23 17:15:00 +02:00
+ entityplayer.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
2019-08-12 13:43:10 +02:00
+ return null;
+ }
+
2024-04-23 17:15:00 +02:00
+ if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
2021-06-11 07:00:00 +02:00
+ this.raidMap.put(raid.getId(), raid);
2019-08-12 13:43:10 +02:00
+ }
+ // CraftBukkit end
2024-04-23 17:15:00 +02:00
raid.absorbRaidOmen(entityplayer);
}