Compare commits

...

11 Commits

Author SHA1 Message Date
Jason Penilla
4597f04a6d 0.1.0-beta.9 2024-11-17 10:56:53 -07:00
Jason Penilla
20764890a7 Update lithium, NeoForge, loom 2024-11-16 17:37:11 -07:00
Jason Penilla
f719abdb64 Update NeoForge lithium overrides 2024-11-16 17:35:43 -07:00
Jason Penilla
0dce47bba6 Apply FerriteCore config overrides automatically
New versions of FC added this mechanism

closes #66
2024-11-05 16:13:46 -07:00
Jason Penilla
47584ceee1 Use declaration order for state holder property iteration
Mostly an aesthetic change for serialization, should not have any impact on performance or correctness.
2024-10-27 18:32:42 -07:00
Jason Penilla
2fc858a683 Back to 0.1.0-SNAPSHOT 2024-10-26 11:05:51 -07:00
Jason Penilla
68ea18bc51 0.1.0-beta.8 2024-10-26 11:03:18 -07:00
Jason Penilla
9944946b29 Update Fabric API and call ServerChunkEvents.CHUNK_GENERATE 2024-10-26 09:54:34 -07:00
Jason Penilla
ec1120ed10 Back to 0.1.0-SNAPSHOT 2024-10-24 11:48:08 -07:00
Jason Penilla
8040c7a264 0.1.0-beta.7 2024-10-24 11:40:46 -07:00
Jason Penilla
a9e36795e5 fabric: fix crash when fabric-lifecycle-events-v1 not present 2024-10-23 18:32:06 -07:00
8 changed files with 35 additions and 15 deletions

View File

@@ -24,7 +24,7 @@ patches. Listed below are notable patches:
| Mod | Status | | Mod | Status |
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Lithium | <details><summary>✅ compatible</summary>Lithium optimises many of the same parts of the game as Moonrise, for example the chunk system. Moonrise will automatically disable conflicting parts of Lithium. This mechanism needs to be manually validated for each Moonrise and Lithium release.</details> | | Lithium | <details><summary>✅ compatible</summary>Lithium optimises many of the same parts of the game as Moonrise, for example the chunk system. Moonrise will automatically disable conflicting parts of Lithium. This mechanism needs to be manually validated for each Moonrise and Lithium release.</details> |
| FerriteCore | <details><summary>📝 requires config changes</summary>In `config/ferritecore-mixin.toml`:<br/>Set `replaceNeighborLookup` and `replacePropertyMap` to `false`</details> | | FerriteCore | <details><summary>✅ compatible</summary>FerriteCore optimises some of the same parts of the game as Moonrise. Moonrise will automatically disable conflicting parts of FerriteCore. This mechanism needs to be manually validated for each Moonrise and FerriteCore release.</details> |
| C2ME | <details><summary>❌ incompatible</summary>C2ME is based around modifications to the chunk system, which Moonrise replaces wholesale. This makes them fundamentally incompatible.</details> | | C2ME | <details><summary>❌ incompatible</summary>C2ME is based around modifications to the chunk system, which Moonrise replaces wholesale. This makes them fundamentally incompatible.</details> |
## Configuration ## Configuration

View File

@@ -24,7 +24,8 @@ dependencies {
include "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}" include "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
modImplementation "com.terraformersmc:modmenu:11.0.1" modImplementation "com.terraformersmc:modmenu:11.0.1"
modImplementation fabricApiLibs.fabric.api modImplementation fabricApiLibs.command.api.v2
modImplementation fabricApiLibs.lifecycle.events.v1
include fabricApiLibs.command.api.v2 include fabricApiLibs.command.api.v2
include fabricApiLibs.base include fabricApiLibs.base
} }
@@ -59,7 +60,7 @@ publishMods {
incompatible( incompatible(
"not-enough-crashes", "not-enough-crashes",
"starlight", "starlight",
"c2me-fabric" "c2me"
) )
} }
} }

View File

@@ -6,6 +6,7 @@ import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder;
import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory; import net.fabricmc.fabric.api.event.EventFactory;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.GenerationChunkHolder; import net.minecraft.server.level.GenerationChunkHolder;
@@ -18,6 +19,7 @@ import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ImposterProtoChunk;
import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.ProtoChunk; import net.minecraft.world.level.chunk.ProtoChunk;
import net.minecraft.world.level.entity.EntityTypeTest; import net.minecraft.world.level.entity.EntityTypeTest;
@@ -28,6 +30,8 @@ import java.util.function.Predicate;
public final class FabricHooks implements PlatformHooks { public final class FabricHooks implements PlatformHooks {
private static final boolean HAS_FABRIC_LIFECYCLE_EVENTS = FabricLoader.getInstance().isModLoaded("fabric-lifecycle-events-v1");
public interface OnExplosionDetonate { public interface OnExplosionDetonate {
void onExplosion(final Level world, final Explosion explosion, final List<Entity> possiblyAffecting, final double diameter); void onExplosion(final Level world, final Explosion explosion, final List<Entity> possiblyAffecting, final double diameter);
} }
@@ -85,7 +89,12 @@ public final class FabricHooks implements PlatformHooks {
@Override @Override
public void chunkFullStatusComplete(final LevelChunk newChunk, final ProtoChunk original) { public void chunkFullStatusComplete(final LevelChunk newChunk, final ProtoChunk original) {
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad((ServerLevel) newChunk.getLevel(), newChunk); if (HAS_FABRIC_LIFECYCLE_EVENTS) {
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad((ServerLevel) newChunk.getLevel(), newChunk);
if (!(original instanceof ImposterProtoChunk)) {
ServerChunkEvents.CHUNK_GENERATE.invoker().onChunkGenerate((ServerLevel)newChunk.getLevel(), newChunk);
}
}
} }
@Override @Override
@@ -100,7 +109,9 @@ public final class FabricHooks implements PlatformHooks {
@Override @Override
public void chunkUnloadFromWorld(final LevelChunk chunk) { public void chunkUnloadFromWorld(final LevelChunk chunk) {
ServerChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload((ServerLevel) chunk.getLevel(), chunk); if (HAS_FABRIC_LIFECYCLE_EVENTS) {
ServerChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload((ServerLevel) chunk.getLevel(), chunk);
}
} }
@Override @Override

View File

@@ -69,6 +69,10 @@
"mixin.world.explosions.cache_exposure": false, "mixin.world.explosions.cache_exposure": false,
"mixin.world.temperature_cache": false, "mixin.world.temperature_cache": false,
"mixin.world.tick_scheduler": false "mixin.world.tick_scheduler": false
} },
"ferritecore:disabled_options": [
"replaceNeighborLookup",
"replacePropertyMap"
]
} }
} }

View File

@@ -6,14 +6,14 @@ org.gradle.daemon=false
minecraft_version=1.21.1 minecraft_version=1.21.1
supported_minecraft_versions=1.21,1.21.1 supported_minecraft_versions=1.21,1.21.1
loader_version=0.16.5 loader_version=0.16.5
neoforge_version=21.1.62 neoforge_version=21.1.79
snakeyaml_version=2.2 snakeyaml_version=2.2
concurrentutil_version=0.0.2-SNAPSHOT concurrentutil_version=0.0.2-SNAPSHOT
cloth_version=15.0.128 cloth_version=15.0.128
# version ids from modrinth # version ids from modrinth
fabric_lithium_version=mc1.21.1-0.14.0-beta.1 fabric_lithium_version=frXUdgvL
neo_lithium_version=BrMIoIMv neo_lithium_version=KhdehJ6l
# Mod Properties # Mod Properties
mod_version=0.1.0-SNAPSHOT mod_version=0.1.0-beta.9
maven_group=ca.spottedleaf.moonrise maven_group=ca.spottedleaf.moonrise
archives_base_name=moonrise archives_base_name=moonrise

View File

@@ -13,6 +13,10 @@ displayURL = "https://github.com/Tuinity/Moonrise"
authors = "Spottedleaf" authors = "Spottedleaf"
description = "Optimisation mod for the dedicated and integrated server." description = "Optimisation mod for the dedicated and integrated server."
displayTest = "IGNORE_ALL_VERSION" displayTest = "IGNORE_ALL_VERSION"
"ferritecore:disabled_options" = [
"replaceNeighborLookup",
"replacePropertyMap"
]
[[dependencies.moonrise]] [[dependencies.moonrise]]
modId = "neoforge" modId = "neoforge"
@@ -51,7 +55,7 @@ config = "moonrise.mixins.json"
[[mixins]] [[mixins]]
config = "moonrise-neoforge.mixins.json" config = "moonrise-neoforge.mixins.json"
[mods."lithium:options"] ["lithium:options"]
"mixin.ai.poi" = false "mixin.ai.poi" = false
"mixin.alloc.chunk_ticking" = false "mixin.alloc.chunk_ticking" = false
"mixin.alloc.deep_passengers" = false "mixin.alloc.deep_passengers" = false

View File

@@ -24,7 +24,7 @@ pluginManagement {
plugins { plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
id("xyz.jpenilla.quiet-architectury-loom") version "1.7.295" apply false id("xyz.jpenilla.quiet-architectury-loom") version "1.7.300" apply false
id 'com.gradleup.shadow' version '8.3.0' apply false id 'com.gradleup.shadow' version '8.3.0' apply false
} }
@@ -37,7 +37,7 @@ dependencyResolutionManagement {
} }
versionCatalogs { versionCatalogs {
create("fabricApiLibs") { create("fabricApiLibs") {
from("net.fabricmc.fabric-api:fabric-api-catalog:0.103.0+1.21.1") from("net.fabricmc.fabric-api:fabric-api-catalog:0.107.0+1.21.1")
} }
} }
} }

View File

@@ -9,7 +9,7 @@ import it.unimi.dsi.fastutil.objects.AbstractReference2ObjectMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator; import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.ObjectSet; import it.unimi.dsi.fastutil.objects.ObjectSet;
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap; import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@@ -27,7 +27,7 @@ public final class ZeroCollidingReferenceStateTable<O, S> {
public ZeroCollidingReferenceStateTable(final Collection<Property<?>> properties) { public ZeroCollidingReferenceStateTable(final Collection<Property<?>> properties) {
this.propertyToIndexer = new Int2ObjectOpenHashMap<>(properties.size()); this.propertyToIndexer = new Int2ObjectOpenHashMap<>(properties.size());
this.properties = new ReferenceOpenHashSet<>(properties); this.properties = new ReferenceArrayList<>(properties);
final List<Property<?>> sortedProperties = new ArrayList<>(properties); final List<Property<?>> sortedProperties = new ArrayList<>(properties);