diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/raid/PersistentRaid.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/entity/raid/PersistentRaid.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/raid/PersistentRaid.patch b/patch-remap/og/net/minecraft/world/entity/raid/PersistentRaid.patch new file mode 100644 index 0000000000..72213d9b13 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/entity/raid/PersistentRaid.patch @@ -0,0 +1,37 @@ +--- a/net/minecraft/world/entity/raid/PersistentRaid.java ++++ b/net/minecraft/world/entity/raid/PersistentRaid.java +@@ -121,19 +121,33 @@ + boolean flag = false; + + if (!raid.isStarted()) { ++ /* CraftBukkit - moved down + if (!this.raidMap.containsKey(raid.getId())) { + this.raidMap.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.connection.send(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.raidMap.containsKey(raid.getId())) { ++ this.raidMap.put(raid.getId(), raid); ++ } ++ // CraftBukkit end + raid.absorbBadOmen(entityplayer); + entityplayer.connection.send(new PacketPlayOutEntityStatus(entityplayer, (byte) 43)); + if (!raid.hasFirstWaveSpawned()) { |