@@ -1,37 +1,27 @@
|
||||
--- a/net/minecraft/world/entity/raid/PersistentRaid.java
|
||||
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
|
||||
@@ -121,19 +121,33 @@
|
||||
boolean flag = false;
|
||||
@@ -115,11 +115,23 @@
|
||||
|
||||
if (!raid.isStarted()) {
|
||||
+ /* CraftBukkit - moved down
|
||||
if (!this.raidMap.containsKey(raid.getId())) {
|
||||
this.raidMap.put(raid.getId(), raid);
|
||||
}
|
||||
+ */
|
||||
Raid raid = this.getOrCreateRaid(entityplayer.serverLevel(), blockposition2);
|
||||
|
||||
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));
|
||||
+ /* CraftBukkit - moved down
|
||||
if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
|
||||
this.raidMap.put(raid.getId(), raid);
|
||||
}
|
||||
+ */
|
||||
|
||||
if (flag) {
|
||||
- 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(MobEffects.BAD_OMEN);
|
||||
+ entityplayer.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ if (!this.raidMap.containsKey(raid.getId())) {
|
||||
+ if (!raid.isStarted() && !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()) {
|
||||
raid.absorbRaidOmen(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user