mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 12:36:07 +01:00
38 lines
1.8 KiB
Diff
38 lines
1.8 KiB
Diff
--- a/net/minecraft/server/PersistentRaid.java
|
|
+++ b/net/minecraft/server/PersistentRaid.java
|
|
@@ -92,19 +92,33 @@
|
|
boolean flag = false;
|
|
|
|
if (!raid.isStarted()) {
|
|
+ /* CraftBukkit - moved down
|
|
if (!this.raids.containsKey(raid.getId())) {
|
|
this.raids.put(raid.getId(), raid);
|
|
}
|
|
+ */
|
|
|
|
flag = true;
|
|
- } else if (raid.getBadOmenLevel() < raid.getMaxBadOmenLevel()) {
|
|
+ // CraftBukkit start - fixed a bug with raid: players could add up Bad Omen level even when the raid had finished
|
|
+ } else if (raid.isInProgress() && raid.getBadOmenLevel() < raid.getMaxBadOmenLevel()) {
|
|
flag = true;
|
|
+ // CraftBukkit end
|
|
} else {
|
|
entityplayer.removeEffect(MobEffects.BAD_OMEN);
|
|
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) 43));
|
|
}
|
|
|
|
if (flag) {
|
|
+ // CraftBukkit start
|
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, entityplayer)) {
|
|
+ entityplayer.removeEffect(MobEffects.BAD_OMEN);
|
|
+ return null;
|
|
+ }
|
|
+
|
|
+ if (!this.raids.containsKey(raid.getId())) {
|
|
+ this.raids.put(raid.getId(), raid);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
raid.a((EntityHuman) entityplayer);
|
|
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) 43));
|
|
if (!raid.c()) {
|