Compare commits

...

6 Commits

Author SHA1 Message Date
Spottedleaf
6841805446 Set version to 0.1.0-beta.13 2025-06-09 02:13:51 -07:00
Spottedleaf
eb20846213 Fix infinite loop in RegionFile IO
If an exception is thrown during decompress then the read process
would be started again, which of course would eventually throw in
the decompress process.
2025-06-09 02:12:01 -07:00
Spottedleaf
66a0850ac9 Set version to 0.1.0-SNAPSHOT 2025-02-24 20:59:03 -08:00
Spottedleaf
9a16a91fb8 Set version to 0.1.0-beta.12 2025-02-24 20:52:25 -08:00
Jason Penilla
580041a1a1 Clear lastSection on game event listener removal (fixes #87) (backport of #99) 2025-02-24 17:40:26 -07:00
Spottedleaf
fb31d0e1f7 Set version to 0.1.0-SNAPSHOT 2025-01-27 08:20:45 -08:00
4 changed files with 28 additions and 2 deletions

View File

@@ -15,6 +15,6 @@ cloth_version=15.0.128
fabric_lithium_version=frXUdgvL
neo_lithium_version=KhdehJ6l
# Mod Properties
mod_version=0.1.0-beta.11
mod_version=0.1.0-beta.13
maven_group=ca.spottedleaf.moonrise
archives_base_name=moonrise

View File

@@ -0,0 +1,25 @@
package ca.spottedleaf.moonrise.mixin.chunk_system;
import net.minecraft.core.SectionPos;
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
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(DynamicGameEventListener.class)
abstract class DynamicGameEventListenerMixin {
@Shadow @Nullable private SectionPos lastSection;
@Inject(method = "remove", at = @At("RETURN"))
private void onRemove(final CallbackInfo ci) {
// We need to unset the last section when removed, otherwise if the same instance is re-added at the same position it
// will assume there was no change and fail to re-register.
// In vanilla, chunks rarely unload and re-load quickly enough to trigger this issue. However, our chunk system has a
// quirk where fast chunk reload cycles will often occur on player login (see PR #22).
// So we fix this vanilla oversight as our changes cause it to manifest in bugs much more often (see issue #87).
this.lastSection = null;
}
}

View File

@@ -1042,7 +1042,7 @@ public final class MoonriseRegionFileIO {
LOGGER.error("Failed to decompress chunk data for task: " + this.toString(), thr);
}
if (compoundTag == null) {
if (throwable == null && compoundTag == null) {
// need to re-try from the start
this.scheduleReadIO();
return;

View File

@@ -30,6 +30,7 @@
"chunk_system.ChunkStepMixin",
"chunk_system.ChunkStorageMixin",
"chunk_system.DistanceManagerMixin",
"chunk_system.DynamicGameEventListenerMixin",
"chunk_system.EntityGetterMixin",
"chunk_system.EntityMixin",
"chunk_system.EntityTickListMixin",