Skip to content

Commit

Permalink
build: 1.20-pre5
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed May 24, 2023
1 parent 01a0935 commit 5b05795
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class MixinChunkHolder {
@Inject(method = "getChunkAt", at = @At("RETURN"))
private void postGetChunkAt(ChunkStatus targetStatus, ThreadedAnvilChunkStorage chunkStorage, CallbackInfoReturnable<CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>>> cir) {
if (FlightProfiler.INSTANCE instanceof IVanillaJfrProfiler profiler && this.world instanceof ServerWorld serverWorld && !cir.getReturnValue().isDone()) {
final Finishable finishable = profiler.startChunkLoadSchedule(this.getPos(), serverWorld.getRegistryKey(), targetStatus.getId());
final Finishable finishable = profiler.startChunkLoadSchedule(this.getPos(), serverWorld.getRegistryKey(), targetStatus.toString());
if (finishable != null) {
cir.getReturnValue().exceptionally(unused -> null).thenRun(finishable::finish);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import java.util.function.Function;

@Mixin(value = ChunkStatus.class, priority = 990)
public class MixinChunkStatus {
public abstract class MixinChunkStatus {

@Shadow @Final private ChunkStatus.GenerationTask generationTask;

@Shadow @Final private String id;
@Shadow public abstract String toString();

/**
* @author ishland
Expand All @@ -46,7 +46,7 @@ public CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> runGenerationTask(
final ChunkStatus thiz = (ChunkStatus) (Object) this;
CurrentWorldGenState.setCurrentRegion(new ChunkRegion(world,chunks, thiz, -1));
Chunk chunk = chunks.get(chunks.size() / 2);
Finishable finishable = FlightProfiler.INSTANCE.startChunkGenerationProfiling(chunk.getPos(), world.getRegistryKey(), this.id);
Finishable finishable = FlightProfiler.INSTANCE.startChunkGenerationProfiling(chunk.getPos(), world.getRegistryKey(), this.toString());
CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> completableFuture = this.generationTask.doWork(thiz, executor, world, generator, structureTemplateManager, lightingProvider, fullChunkConverter, chunks, chunk);
return completableFuture.thenApply((either) -> {
if (chunk instanceof ProtoChunk protoChunk && !protoChunk.getStatus().isAtLeast(thiz)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ public abstract class MixinChunkStatus implements IChunkStatus {
@Final
private int taskMargin;

@Shadow
@Final
private String id;

@Shadow
public static List<ChunkStatus> createOrderedList() {
throw new AbstractMethodError();
}

@Shadow public abstract String toString();

private int reducedTaskRadius = -1;

public void calculateReducedTaskRadius() {
Expand Down Expand Up @@ -102,7 +100,7 @@ public CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> runGenerationTask(
final ChunkStatus thiz = (ChunkStatus) (Object) this;
final Chunk targetChunk = list.get(list.size() / 2);

Finishable finishable = FlightProfiler.INSTANCE.startChunkGenerationProfiling(targetChunk.getPos(), world.getRegistryKey(), this.id);
Finishable finishable = FlightProfiler.INSTANCE.startChunkGenerationProfiling(targetChunk.getPos(), world.getRegistryKey(), this.toString());

final Supplier<CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>>> generationTask = () -> {
try {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.20-pre4
yarn_mappings=1.20-pre4+build.3
minecraft_version=1.20-pre5
yarn_mappings=1.20-pre5+build.2
loader_version=0.14.19
# Mod Properties
mod_version=0.2.0+alpha.10
Expand Down

0 comments on commit 5b05795

Please sign in to comment.