Skip to content

Commit

Permalink
build: 23w33a
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Aug 18, 2023
1 parent 720ed94 commit 5841c2f
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
public interface IChunkHolder {

@Invoker
void invokeTick(ThreadedAnvilChunkStorage chunkStorage, Executor executor);
void invokeUpdateFutures(ThreadedAnvilChunkStorage chunkStorage, Executor executor);

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public interface IServerChunkManager {
ServerChunkManager.MainThreadExecutor getMainThreadExecutor();

@Invoker
boolean invokeTick();
boolean invokeUpdateChunks();

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Mixin(ChunkHolder.class)
public class MixinChunkHolder {

@Inject(method = "tick", at = @At("HEAD"))
@Inject(method = "updateFutures", at = @At("HEAD"))
private void beforeTick(ThreadedAnvilChunkStorage chunkStorage, Executor executor, CallbackInfo ci) {
((IThreadedAnvilChunkStorage) chunkStorage).invokeUpdateHolderMap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class MixinChunkTicketManager {

@SuppressWarnings("unchecked")
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V"))
@Redirect(method = "update", at = @At(value = "INVOKE", target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V"))
private <T> void replaceIterationForHolderTicking(Set<T> instance, Consumer<T> consumer) {
if (instance.isEmpty()) return;
for (Object object : instance.toArray()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ private void onPurge(CallbackInfo ci) {
this.noTickSystem.runPurge(this.age);
}

@Inject(method = "tick", at = @At("HEAD"))
@Inject(method = "update", at = @At("HEAD"))
private void beforeTick(ThreadedAnvilChunkStorage chunkStorage, CallbackInfoReturnable<Boolean> cir) {
this.noTickSystem.beforeTicketTicks();
}

@Inject(method = "tick", at = @At("RETURN"))
@Inject(method = "update", at = @At("RETURN"))
private void onTick(ThreadedAnvilChunkStorage chunkStorage, CallbackInfoReturnable<Boolean> cir) {
if (this.simulationDistanceTracker instanceof NoOPTickingMap map) {
map.setTACS(chunkStorage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class MixinServerChunkManager {
ServerWorld world;

@Shadow
public abstract boolean tick();
public abstract boolean updateChunks();

@Shadow @Final public ThreadedAnvilChunkStorage threadedAnvilChunkStorage;
@Shadow @Final public ServerChunkManager.MainThreadExecutor mainThreadExecutor;
Expand Down Expand Up @@ -95,7 +95,7 @@ private void onGetChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean
if (this.isMissingForLevel(chunkHolder, ticketLevel)) {
Profiler profiler = this.world.getProfiler();
profiler.push("chunkLoad");
this.tick();
this.updateChunks();
chunkHolder = this.getChunkHolder(chunkPosLong);
profiler.pop();
if (this.isMissingForLevel(chunkHolder, ticketLevel)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class MixinChunkHolder {

@Shadow @Final public static Either<Chunk, ChunkHolder.Unloaded> UNLOADED_CHUNK;

// @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/atomic/AtomicReferenceArray;get(I)Ljava/lang/Object;"))
// @Redirect(method = "updateChunks", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/atomic/AtomicReferenceArray;get(I)Ljava/lang/Object;"))
// private <E> E captureWorldGenCancellation(AtomicReferenceArray<E> instance, int i, ThreadedAnvilChunkStorage chunkStorage, Executor executor) {
// if (instance == this.futuresByStatus) {
// final CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> future = this.futuresByStatus.get(i);
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=23w32a
yarn_mappings=23w32a+build.6
minecraft_version=23w33a
yarn_mappings=23w33a+build.1
loader_version=0.14.22
# Mod Properties
mod_version=0.2.0+alpha.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private static ArrayList<ChunkPos> createPreGenChunks0(ChunkPos center, int radi
private static CompletableFuture<Void> getChunkAtAsync(ServerWorld world, ChunkPos pos) {
CompletableFuture<Void> future = new CompletableFuture<>();
world.getChunkManager().addTicket(TICKET, pos, 0, Unit.INSTANCE);
((IServerChunkManager) world.getChunkManager()).invokeTick();
((IServerChunkManager) world.getChunkManager()).invokeUpdateChunks();
final ChunkHolder chunkHolder = ((IThreadedAnvilChunkStorage) world.getChunkManager().threadedAnvilChunkStorage).invokeGetChunkHolder(pos.toLong());
Preconditions.checkNotNull(chunkHolder, "chunkHolder is null");
chunkHolder.getChunkAt(ChunkStatus.FULL, world.getChunkManager().threadedAnvilChunkStorage).thenAcceptAsync(either -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public interface IServerChunkManager {

@Invoker
boolean invokeTick();
boolean invokeUpdateChunks();

@Invoker
CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> invokeGetChunkFuture(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create);
Expand Down

0 comments on commit 5841c2f

Please sign in to comment.