Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Raids don't trigger correctly

Open VincyZed opened this issue 1 year ago • 3 comments

Expected behavior

If you have Bad Omen, a raid should start as soon as you enter a village.

Observed/Actual behavior

After updating from build 171 to 174, raids won't start until you sleep in a bed at that village.

Steps/models to reproduce

With build 174+ :

  1. Get Bad Omen
  2. Go in a village. The raid won't start until you sleep in that village.

Plugin and Datapack List

Plugins (3): AntiEndermanGrief, NoMoreReports, TabTPS

There are 5 data packs enabled: [vanilla (built-in)], [file/bukkit (world)], [file/afk display v1.1.0.zip (world)], [file/player head drops v1.1.0.zip (world)], [file/OnePlayerSleepV2_5.zip (world)] There are no more data packs available

Paper version

1.19.2, build 174 and up.

Other

This started happening after updating from 1.19.2 build 171 to 174. I have tried disabling all datapacks and plugins, and of course restarting the server, updating to the latest build (177) and such. The only fix that I found was downgrading from 174 back to 171. I enabled the datapacks and plugins back and it still works fine on that build.

I haven't tested 172 nor 173, but I assume that this comes from the new Chunk system.

Let me know if you can't reproduce, I'll gladly give out more info about my config.

VincyZed avatar Sep 28 '22 13:09 VincyZed

Replicable. It appears that the internal village distance tracker is not updated correctly, leading to a desync between the actual POIs indicating a village section and the distance tracker.

As the bad omen effect checks against the map to determine a raid start, this fails until the map is properly updated.

lynxplay avatar Sep 28 '22 17:09 lynxplay

My server also has this issue. (Rewrite chunk system)

Pantera07 avatar Sep 28 '22 17:09 Pantera07

Potential cause of this issue is a premature PoiChunk.loaded = true, or specifically a missing PoiChunk.loaded = false if content was parsed in PoiChunk#parse, which prevents calls to PoiManager#loadInPoiChunk on PoiChunk#load later down the line.

diff --git a/src/main/java/io/papermc/paper/chunk/system/poi/PoiChunk.java b/src/main/java/io/papermc/paper/chunk/system/poi/PoiChunk.java
index b1bdd7904..c288bbb47 100644
--- a/src/main/java/io/papermc/paper/chunk/system/poi/PoiChunk.java
+++ b/src/main/java/io/papermc/paper/chunk/system/poi/PoiChunk.java
@@ -206,6 +206,8 @@ public final class PoiChunk {
             ret.sections[sectionY - ret.minSection] = deserialized;
         }

+        ret.loaded = !readAnything; // we hate branches
+
         return ret;
     }
 }

resolved the issue, however this patch is yet to be analysed to maintain optimisations off the main thread

lynxplay avatar Sep 28 '22 18:09 lynxplay

My server also has this issue. (Rewrite chunk system). There must be some problems in RAID.

sakurawald avatar Sep 29 '22 08:09 sakurawald