--- a/net/minecraft/world/entity/raid/Raids.java
+++ b/net/minecraft/world/entity/raid/Raids.java
@@ -25,9 +_,9 @@
 
 public class Raids extends SavedData {
     private static final String RAID_FILE_ID = "raids";
-    public final Map<Integer, Raid> raidMap = Maps.newHashMap();
+    public final Map<Integer, Raid> raidMap = new java.util.concurrent.ConcurrentHashMap<>(); // Folia - make raids thread-safe
     private final ServerLevel level;
-    private int nextAvailableID;
+    private final java.util.concurrent.atomic.AtomicInteger nextAvailableID = new java.util.concurrent.atomic.AtomicInteger(); // Folia - make raids thread-safe
     private int tick;
 
     public static SavedData.Factory<Raids> factory(ServerLevel level) {
@@ -36,7 +_,7 @@
 
     public Raids(ServerLevel level) {
         this.level = level;
-        this.nextAvailableID = 1;
+        this.nextAvailableID.set(1); // Folia - make raids thread-safe
         this.setDirty();
     }
 
@@ -44,12 +_,25 @@
         return this.raidMap.get(id);
     }
 
+    // Folia start - make raids thread-safe
+    public void globalTick() {
+        ++this.tick;
+        if (this.tick % 200 == 0) {
+            this.setDirty();
+        }
+    }
+
     public void tick() {
-        this.tick++;
+        // Folia end - make raids thread-safe
         Iterator<Raid> iterator = this.raidMap.values().iterator();
 
         while (iterator.hasNext()) {
             Raid raid = iterator.next();
+            // Folia start - make raids thread-safe
+            if (!raid.ownsRaid()) {
+                continue;
+            }
+            // Folia end - make raids thread-safe
             if (this.level.getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) {
                 raid.stop();
             }
@@ -62,14 +_,17 @@
             }
         }
 
-        if (this.tick % 200 == 0) {
-            this.setDirty();
-        }
+        // Folia - make raids thread-safe - move to globalTick()
 
         DebugPackets.sendRaids(this.level, this.raidMap.values());
     }
 
     public static boolean canJoinRaid(Raider raider, Raid raid) {
+        // Folia start - make raids thread-safe
+        if (!raid.ownsRaid()) {
+            return false;
+        }
+        // Folia end - make raids thread-safe
         return raider != null
             && raid != null
             && raid.getLevel() != null
@@ -87,7 +_,7 @@
             return null;
         } else {
             DimensionType dimensionType = player.level().dimensionType();
-            if (!dimensionType.hasRaids()) {
+            if (!dimensionType.hasRaids() || !ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(player) || !ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, pos.getX() >> 4, pos.getZ() >> 4, 8) || !ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, player.chunkPosition().x, player.chunkPosition().z, 8)) { // Folia - region threading
                 return null;
             } else {
                 List<PoiRecord> list = this.level
@@ -145,7 +_,7 @@
 
     public static Raids load(ServerLevel level, CompoundTag tag) {
         Raids raids = new Raids(level);
-        raids.nextAvailableID = tag.getInt("NextAvailableID");
+        raids.nextAvailableID.set(tag.getInt("NextAvailableID")); // Folia - make raids thread-safe
         raids.tick = tag.getInt("Tick");
         ListTag list = tag.getList("Raids", 10);
 
@@ -160,7 +_,7 @@
 
     @Override
     public CompoundTag save(CompoundTag tag, HolderLookup.Provider registries) {
-        tag.putInt("NextAvailableID", this.nextAvailableID);
+        tag.putInt("NextAvailableID", this.nextAvailableID.get()); // Folia - make raids thread-safe
         tag.putInt("Tick", this.tick);
         ListTag listTag = new ListTag();
 
@@ -179,7 +_,7 @@
     }
 
     private int getUniqueId() {
-        return ++this.nextAvailableID;
+        return this.nextAvailableID.incrementAndGet(); // Folia - make raids thread-safe
     }
 
     @Nullable
@@ -188,6 +_,11 @@
         double d = distance;
 
         for (Raid raid1 : this.raidMap.values()) {
+            // Folia start - make raids thread-safe
+            if (!raid1.ownsRaid()) {
+                continue;
+            }
+            // Folia end - make raids thread-safe
             double d1 = raid1.getCenter().distSqr(pos);
             if (raid1.isActive() && d1 < d) {
                 raid = raid1;
