mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
--- a/net/minecraft/world/entity/raid/PersistentRaid.java
|
|
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
|
|
@@ -115,11 +115,23 @@
|
|
|
|
Raid raid = this.getOrCreateRaid(entityplayer.serverLevel(), blockposition2);
|
|
|
|
+ /* CraftBukkit - moved down
|
|
if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
|
|
this.raidMap.put(raid.getId(), 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, entityplayer)) {
|
|
+ entityplayer.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
|
|
+ return null;
|
|
+ }
|
|
+
|
|
+ if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
|
|
+ this.raidMap.put(raid.getId(), raid);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
raid.absorbRaidOmen(entityplayer);
|
|
}
|
|
|