This commit is contained in:
embeddedt 2023-08-02 16:14:09 -04:00
parent fa6b93fad2
commit 7fcaf716d8
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
5 changed files with 16 additions and 9 deletions

View File

@ -48,8 +48,8 @@ public abstract class ServerLevelMixin extends Level implements IServerLevel {
*/
@Inject(method = "<init>", at = @At("TAIL"))
private void ensureGeneration(CallbackInfo ci) {
mfix$strongholdCache = this.getDataStorage().computeIfAbsent(StrongholdLocationCache::load,
StrongholdLocationCache::new,
mfix$strongholdCache = this.getDataStorage().computeIfAbsent(
StrongholdLocationCache.factory((ServerLevel)(Object)this),
StrongholdLocationCache.getFileId(this.dimensionTypeRegistration()));
this.chunkSource.getGeneratorState().ensureStructuresGenerated();
}

View File

@ -34,7 +34,7 @@ public class ModernFixConfigScreen extends Screen {
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(guiGraphics);
this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
this.optionList.render(guiGraphics, mouseX, mouseY, partialTicks);
guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 8, 16777215);
this.doneButton.setMessage(madeChanges ? Component.translatable("modernfix.config.done_restart") : CommonComponents.GUI_DONE);

View File

@ -41,7 +41,7 @@ public class ModernFixOptionInfoScreen extends Screen {
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(guiGraphics);
this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 8, 16777215);
this.drawMultilineString(guiGraphics, this.minecraft.font, description, 10, 50);
super.render(guiGraphics, mouseX, mouseY, partialTicks);

View File

@ -3,6 +3,8 @@ package org.embeddedt.modernfix.world;
import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.datafix.DataFixTypes;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.saveddata.SavedData;
@ -17,6 +19,11 @@ public class StrongholdLocationCache extends SavedData {
chunkPosList = new ArrayList<>();
}
public static SavedData.Factory<StrongholdLocationCache> factory(ServerLevel serverLevel) {
// FIXME datafixer will probably throw on update
return new SavedData.Factory<>(StrongholdLocationCache::new, StrongholdLocationCache::load, DataFixTypes.SAVED_DATA_FORCED_CHUNKS);
}
public List<ChunkPos> getChunkPosList() {
return new ArrayList<>(chunkPosList);
}

View File

@ -4,19 +4,19 @@ org.gradle.jvmargs=-Xmx2G
junit_version=5.10.0-M1
mod_id=modernfix
minecraft_version=1.20.1
enabled_platforms=fabric,forge
minecraft_version=23w31a
enabled_platforms=fabric
forge_version=1.20.1-47.0.14
parchment_version=2023.07.09
# parchment_version=2023.07.09
refined_storage_version=4392788
jei_version=13.1.0.2
rei_version=11.0.597
ctm_version=1.19.2-1.1.7+11
kubejs_version=1902.6.0-build.142
rhino_version=1902.2.2-build.268
supported_minecraft_versions=1.20.1
supported_minecraft_versions=23w31a
fabric_loader_version=0.14.21
fabric_loader_version=0.14.22
fabric_api_version=0.86.0+1.20.1
continuity_version=3.0.0-beta.2+1.19.3