Skip to content

Commit

Permalink
Improve shutdown speed & mark some ops safe
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Jun 8, 2022
1 parent 4adc038 commit 08d3adc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ public void setNoTickViewDistance(int viewDistance) {
this.pendingActions.add(() -> this.playerNoTickDistanceMap.setViewDistance(viewDistance));
}

public void tick() {
public void tickScheduler() {
this.noThreadScheduler.tick(Throwable::printStackTrace);

}

public void tick() {
tickScheduler();
scheduleTick();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ private void onHandleChunkLeave(ChunkSectionPos pos, ServerPlayerEntity player,
this.noTickSystem.removePlayerSource(pos.toChunkPos());
}

@Inject(method = "removePersistentTickets", at = @At("RETURN"))
private void onRemovePersistentTickets(CallbackInfo ci) {
this.noTickSystem.tick();
}

@Inject(method = "purge", at = @At("RETURN"))
private void onPurge(CallbackInfo ci) {
this.noTickSystem.runPurge(this.age);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static class StacktraceHolder {
private static final String BlendingData$getBlendingData = FabricLoader.getInstance().getMappingResolver()
.mapMethodName("intermediary", "net.minecraft.class_6749", "method_39570", "(Lnet/minecraft/class_3233;II)Lnet/minecraft/class_6749;");
private static final String ChunkGenerator$carve = FabricLoader.getInstance().getMappingResolver()
.mapMethodName("intermediary", "net.minecraft.class_2794", "method_12108", "(Lnet/minecraft/class_3233;JLnet/minecraft/class_4543;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;Lnet/minecraft/class_2893$class_2894;)V");
.mapMethodName("intermediary", "net.minecraft.class_2794", "method_12108", "(Lnet/minecraft/class_3233;JLnet/minecraft/class_7138;Lnet/minecraft/class_4543;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;Lnet/minecraft/class_2893$class_2894;)V");
private static final String SpawnHelper$populateEntities = FabricLoader.getInstance().getMappingResolver()
.mapMethodName("intermediary", "net.minecraft.class_1948", "method_8661", "(Lnet/minecraft/class_5425;Lnet/minecraft/class_1959;Lnet/minecraft/class_1923;Ljava/util/Random;)V");
private static final String StructureAccessor$method_41032 = FabricLoader.getInstance().getMappingResolver()
Expand Down

0 comments on commit 08d3adc

Please sign in to comment.