Skip to content

Commit

Permalink
new: call ServerChunkEvents.CHUNK_GENERATE (FabricMC/fabric#4183)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Oct 27, 2024
1 parent ffe2dc0 commit b5053dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

public class LifecycleEventInvoker {

public static void invokeChunkLoaded(ServerWorld world, WorldChunk chunk) {
public static void invokeChunkLoaded(ServerWorld world, WorldChunk chunk, boolean newChunk) {
try {
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad(world, chunk);
if (newChunk) {
ServerChunkEvents.CHUNK_GENERATE.invoker().onChunkGenerate(world, chunk);
}
} catch (Throwable t) {
t.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public CompletionStage<Void> upgradeToThis(ChunkLoadingContext context) {
worldChunk.updateAllBlockEntities();
worldChunk.addChunkTickSchedulers(serverWorld);
if (ModStatuses.fabric_lifecycle_events_v1) {
LifecycleEventInvoker.invokeChunkLoaded(serverWorld, worldChunk);
LifecycleEventInvoker.invokeChunkLoaded(serverWorld, worldChunk, !(protoChunk instanceof WrapperProtoChunk));
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.warning.mode=all
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.7
fabric_version=0.106.1+1.21.3
fabric_version=0.107.0+1.21.3
# Mod Properties
mod_version=0.3.0+alpha.0
maven_group=com.ishland.c2me
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"breaks": {
"tic_tacs": "*",
"optifabric": "*"
"optifabric": "*",
"fabric-api": "<0.107.0"
}
}

0 comments on commit b5053dc

Please sign in to comment.