Skip to content

Commit 7ce8383

Browse files
committed
Fix a bug in porting lib that prevents cross-dimension chunk loading, fixes #12
1 parent e2c1a09 commit 7ce8383

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.hlysine.create_power_loader.mixin.portinglib;
2+
3+
import io.github.fabricators_of_create.porting_lib.chunk.loading.PortingLibChunkManager;
4+
import net.minecraft.server.level.ServerLevel;
5+
import org.spongepowered.asm.mixin.Mixin;
6+
import org.spongepowered.asm.mixin.injection.At;
7+
import org.spongepowered.asm.mixin.injection.Inject;
8+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9+
10+
@Mixin(PortingLibChunkManager.class)
11+
public class PortingLibChunkManagerMixin {
12+
13+
@Inject(
14+
method = "hasForcedChunks",
15+
at = @At("RETURN"),
16+
cancellable = true
17+
)
18+
private static void hasForcedChunks(ServerLevel level, CallbackInfoReturnable<Boolean> cir) {
19+
cir.setReturnValue(!cir.getReturnValue() && level.getForcedChunks().isEmpty());
20+
}
21+
}

src/main/resources/create_power_loader.mixins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"GlobalRailwayManagerMixin",
1010
"GlobalStationMixin",
1111
"TrackEdgePointMixin",
12-
"TrainMixin"
12+
"TrainMixin",
13+
"portinglib.PortingLibChunkManagerMixin"
1314
],
1415
"client": [
1516
],

0 commit comments

Comments
 (0)