Skip to content

Commit 08c2dd5

Browse files
committed
Fix #46: Spawn raids on raid's region
1 parent aec0ea8 commit 08c2dd5

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- a/net/minecraft/world/effect/RaidOmenMobEffect.java
2+
+++ b/net/minecraft/world/effect/RaidOmenMobEffect.java
3+
@@ -1,5 +_,6 @@
4+
package net.minecraft.world.effect;
5+
6+
+import io.multipaper.shreddedpaper.ShreddedPaper;
7+
import net.minecraft.core.BlockPos;
8+
import net.minecraft.core.particles.ParticleOptions;
9+
import net.minecraft.server.level.ServerLevel;
10+
@@ -21,7 +_,9 @@
11+
if (entity instanceof ServerPlayer serverPlayer && !entity.isSpectator()) {
12+
BlockPos raidOmenPosition = serverPlayer.getRaidOmenPosition();
13+
if (raidOmenPosition != null) {
14+
+ ShreddedPaper.runSync(level, raidOmenPosition, () -> { // ShreddedPaper - run on raidOmenPosition's thread. Do not use ensureSync as createOrExtendRaid can call positions that are outside the player's thread
15+
level.getRaids().createOrExtendRaid(serverPlayer, raidOmenPosition);
16+
+ }); // ShreddedPaper - run on raidOmenPosition's thread
17+
serverPlayer.clearRaidOmenPosition();
18+
return false;
19+
}

0 commit comments

Comments
 (0)