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 404e068 commit f9c250b
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 @@ -67,7 +67,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 @@ fabric.loom.multiProjectOptimisation=true
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.1
loader_version=0.16.3
fabric_version=0.102.0+1.21.1
fabric_version=0.107.0+1.21.1
# 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 f9c250b

Please sign in to comment.