aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch
new file mode 100644
index 0000000000..e1975b1818
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/raid/Raids.java.patch
@@ -0,0 +1,40 @@
+--- a/net/minecraft/world/entity/raid/Raids.java
++++ b/net/minecraft/world/entity/raid/Raids.java
+@@ -121,21 +121,34 @@
+ 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 {
+ serverplayer.removeEffect(MobEffects.BAD_OMEN);
+ serverplayer.connection.send(new ClientboundEntityEventPacket(serverplayer, (byte) 43));
+ }
+
+ if (flag) {
+- raid.absorbBadOmen(serverplayer);
+- serverplayer.connection.send(new ClientboundEntityEventPacket(serverplayer, (byte) 43));
++ // CraftBukkit start
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, serverPlayer)) {
++ serverPlayer.removeEffect(MobEffects.BAD_OMEN);
++ return null;
++ }
++
++ if (!this.raidMap.containsKey(raid.getId())) {
++ this.raidMap.put(raid.getId(), raid);
++ }
++ // CraftBukkit end
++ raid.absorbBadOmen(serverPlayer);
++ serverPlayer.connection.send(new ClientboundEntityEventPacket(serverPlayer, (byte) 43));
+ if (!raid.hasFirstWaveSpawned()) {
+ serverplayer.awardStat(Stats.RAID_TRIGGER);
+ CriteriaTriggers.BAD_OMEN.trigger(serverplayer);