-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
World generation progress is now tracked/logged properly and chunks in a tickets' radius with infinite duration are also loaded/unloaded.
- Loading branch information
1 parent
003e044
commit 90652b6
Showing
8 changed files
with
129 additions
and
28 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...teveplays28/noisiumchunkmanager/mixin/client/gui/WorldGenerationProgressTrackerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.steveplays28.noisiumchunkmanager.mixin.client.gui; | ||
|
||
import io.github.steveplays28.noisiumchunkmanager.server.world.chunk.event.ServerChunkEvent; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.gui.WorldGenerationProgressTracker; | ||
import net.minecraft.util.math.ChunkPos; | ||
import net.minecraft.world.chunk.ChunkStatus; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Mixin(WorldGenerationProgressTracker.class) | ||
public abstract class WorldGenerationProgressTrackerMixin { | ||
@Shadow | ||
public abstract void setChunkStatus(@NotNull ChunkPos chunkPosition, @Nullable ChunkStatus chunkStatus); | ||
|
||
@Inject(method = "<init>", at = @At(value = "TAIL")) | ||
private void noisiumchunkmanager$registerEventListeners(@NotNull CallbackInfo ci) { | ||
ServerChunkEvent.WORLD_CHUNK_GENERATED.register(worldChunk -> this.setChunkStatus(worldChunk.getPos(), worldChunk.getStatus())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...hub/steveplays28/noisiumchunkmanager/mixin/server/WorldGenerationProgressLoggerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.github.steveplays28.noisiumchunkmanager.mixin.server; | ||
|
||
import io.github.steveplays28.noisiumchunkmanager.server.world.chunk.event.ServerChunkEvent; | ||
import net.minecraft.server.WorldGenerationProgressLogger; | ||
import net.minecraft.util.math.ChunkPos; | ||
import net.minecraft.world.chunk.ChunkStatus; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(WorldGenerationProgressLogger.class) | ||
public abstract class WorldGenerationProgressLoggerMixin { | ||
@Shadow | ||
public abstract void setChunkStatus(@NotNull ChunkPos chunkPosition, @Nullable ChunkStatus chunkStatus); | ||
|
||
@Inject(method = "<init>", at = @At(value = "TAIL")) | ||
private void noisiumchunkmanager$registerEventListeners(@NotNull CallbackInfo ci) { | ||
ServerChunkEvent.WORLD_CHUNK_GENERATED.register(worldChunk -> this.setChunkStatus(worldChunk.getPos(), worldChunk.getStatus())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters