Compare commits
17 Commits
v0.2.0-bet
...
v0.2.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7510eda16 | ||
|
|
d9442c1492 | ||
|
|
93eb2786f2 | ||
|
|
1bef6823c5 | ||
|
|
01152eec95 | ||
|
|
1e39f5370a | ||
|
|
ea50ba38ea | ||
|
|
c00b9fcd7b | ||
|
|
bad5cae4d8 | ||
|
|
e3b1502bb6 | ||
|
|
54fc964987 | ||
|
|
0cbc9aa1a1 | ||
|
|
19e2136ae1 | ||
|
|
126cc03747 | ||
|
|
ceb4936d9d | ||
|
|
3cb888e894 | ||
|
|
7bedc1a7de |
@@ -12,19 +12,19 @@ Fabric/NeoForge mod for optimising performance of the integrated (singleplayer/L
|
||||
Moonrise aims to optimise the game *without changing Vanilla behavior*. If you find that there are changes to Vanilla behavior,
|
||||
please open an issue.
|
||||
|
||||
Moonrise ports several important [Paper](https://github.com/PaperMC/Paper/)
|
||||
Moonrise is an official port of several important [Paper](https://github.com/PaperMC/Paper/)
|
||||
patches. Listed below are notable patches:
|
||||
- [Starlight](https://github.com/PaperMC/Starlight/)
|
||||
- Chunk system rewrite
|
||||
- Collision optimisations
|
||||
- Entity tracker optimisations
|
||||
- Random ticking optimisations
|
||||
- [Starlight](https://github.com/PaperMC/Starlight/)
|
||||
|
||||
## Known Compatibility Issues
|
||||
| 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> |
|
||||
| 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> |
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -60,7 +60,7 @@ publishMods {
|
||||
incompatible(
|
||||
"not-enough-crashes",
|
||||
"starlight",
|
||||
"c2me-fabric"
|
||||
"c2me"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
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.ProtoChunk;
|
||||
import net.minecraft.world.level.chunk.status.ChunkStatusTasks;
|
||||
@@ -69,6 +70,9 @@ public final class FabricHooks implements PlatformHooks {
|
||||
public void chunkFullStatusComplete(final LevelChunk newChunk, final ProtoChunk original) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
"custom": {
|
||||
"lithium:options": {
|
||||
"mixin.ai.poi": false,
|
||||
"mixin.alloc.chunk_ticking": false,
|
||||
"mixin.alloc.deep_passengers": false,
|
||||
"mixin.alloc.entity_tracker": false,
|
||||
"mixin.block.flatten_states": false,
|
||||
@@ -66,9 +65,12 @@
|
||||
"mixin.world.block_entity_ticking": false,
|
||||
"mixin.world.chunk_access": false,
|
||||
"mixin.world.explosions.block_raycast": false,
|
||||
"mixin.world.explosions.cache_exposure": false,
|
||||
"mixin.world.temperature_cache": false,
|
||||
"mixin.world.tick_scheduler": false
|
||||
}
|
||||
},
|
||||
"ferritecore:disabled_options": [
|
||||
"replaceNeighborLookup",
|
||||
"replacePropertyMap"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ org.gradle.daemon=false
|
||||
minecraft_version=1.21.3
|
||||
loader_version=0.16.7
|
||||
supported_minecraft_versions=1.21.3
|
||||
neoforge_version=21.3.0-beta
|
||||
fabric_api_version=0.106.1+1.21.3
|
||||
neoforge_version=21.3.31-beta
|
||||
fabric_api_version=0.107.0+1.21.3
|
||||
snakeyaml_version=2.2
|
||||
concurrentutil_version=0.0.2-SNAPSHOT
|
||||
cloth_version=16.0.141
|
||||
modmenu_version=12.0.0-beta.1
|
||||
# version ids from modrinth
|
||||
fabric_lithium_version=mc1.21.1-0.14.0-beta.1
|
||||
neo_lithium_version=BrMIoIMv
|
||||
fabric_lithium_version=QhCwdt4l
|
||||
neo_lithium_version=wDD955sb
|
||||
# Mod Properties
|
||||
mod_version=0.2.0-beta.1
|
||||
mod_version=0.2.0-beta.4
|
||||
maven_group=ca.spottedleaf.moonrise
|
||||
archives_base_name=moonrise
|
||||
|
||||
@@ -13,6 +13,10 @@ displayURL = "https://github.com/Tuinity/Moonrise"
|
||||
authors = "Spottedleaf"
|
||||
description = "Optimisation mod for the dedicated and integrated server."
|
||||
displayTest = "IGNORE_ALL_VERSION"
|
||||
"ferritecore:disabled_options" = [
|
||||
"replaceNeighborLookup",
|
||||
"replacePropertyMap"
|
||||
]
|
||||
|
||||
[[dependencies.moonrise]]
|
||||
modId = "neoforge"
|
||||
@@ -51,9 +55,8 @@ config = "moonrise.mixins.json"
|
||||
[[mixins]]
|
||||
config = "moonrise-neoforge.mixins.json"
|
||||
|
||||
[mods."lithium:options"]
|
||||
["lithium:options"]
|
||||
"mixin.ai.poi" = false
|
||||
"mixin.alloc.chunk_ticking" = false
|
||||
"mixin.alloc.deep_passengers" = false
|
||||
"mixin.alloc.entity_tracker" = false
|
||||
"mixin.block.flatten_states" = false
|
||||
@@ -77,6 +80,5 @@ config = "moonrise-neoforge.mixins.json"
|
||||
"mixin.world.block_entity_ticking" = false
|
||||
"mixin.world.chunk_access" = false
|
||||
"mixin.world.explosions.block_raycast" = false
|
||||
"mixin.world.explosions.cache_exposure" = false
|
||||
"mixin.world.temperature_cache" = false
|
||||
"mixin.world.tick_scheduler" = false
|
||||
|
||||
@@ -24,7 +24,7 @@ pluginManagement {
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
id("xyz.jpenilla.quiet-architectury-loom") version "1.7.297" apply false
|
||||
id("xyz.jpenilla.quiet-architectury-loom") version "1.7.300" apply false
|
||||
id 'com.gradleup.shadow' version '8.3.0' apply false
|
||||
}
|
||||
|
||||
|
||||
@@ -439,7 +439,10 @@ abstract class ServerExplosionMixin {
|
||||
* @author Spottedleaf
|
||||
*/
|
||||
@Redirect(
|
||||
method = "hurtEntities",
|
||||
method = {
|
||||
"hurtEntities()V",
|
||||
"hurtEntities(Ljava/util/List;)V" // Neo moves logic into this new method
|
||||
},
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/ServerExplosion;getSeenPercent(Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/entity/Entity;)F"
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.world.level.chunk.status.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
|
||||
import net.minecraft.world.level.chunk.storage.SerializableChunkData;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -46,6 +47,10 @@ abstract class SerializableChunkDataMixin {
|
||||
@Final
|
||||
private List<SerializableChunkData.SectionData> sectionData;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private static Logger LOGGER;
|
||||
|
||||
/**
|
||||
* @reason Replace light correctness check with our own
|
||||
* Our light check is versioned in case we change the light format OR fix a bug
|
||||
@@ -116,33 +121,45 @@ abstract class SerializableChunkDataMixin {
|
||||
final SWMRNibbleArray[] blockNibbles = StarLightEngine.getFilledEmptyLight(world);
|
||||
final SWMRNibbleArray[] skyNibbles = StarLightEngine.getFilledEmptyLight(world);
|
||||
|
||||
for (final SerializableChunkData.SectionData sectionData : this.sectionData) {
|
||||
final int y = sectionData.y();
|
||||
final DataLayer blockLight = sectionData.blockLight();
|
||||
final DataLayer skyLight = sectionData.skyLight();
|
||||
|
||||
final int blockState = ((StarlightSectionData)(Object)sectionData).starlight$getBlockLightState();
|
||||
final int skyState = ((StarlightSectionData)(Object)sectionData).starlight$getSkyLightState();
|
||||
|
||||
if (blockState >= 0) {
|
||||
if (blockLight != null) {
|
||||
blockNibbles[y - minSection] = new SWMRNibbleArray(MixinWorkarounds.clone(blockLight.getData()), blockState); // clone for data safety
|
||||
} else {
|
||||
blockNibbles[y - minSection] = new SWMRNibbleArray(null, blockState);
|
||||
}
|
||||
}
|
||||
|
||||
if (skyState >= 0 && hasSkyLight) {
|
||||
if (skyLight != null) {
|
||||
skyNibbles[y - minSection] = new SWMRNibbleArray(MixinWorkarounds.clone(skyLight.getData()), skyState); // clone for data safety
|
||||
} else {
|
||||
skyNibbles[y - minSection] = new SWMRNibbleArray(null, skyState);
|
||||
}
|
||||
}
|
||||
if (!this.lightCorrect) {
|
||||
((StarlightChunk)ret).starlight$setBlockNibbles(blockNibbles);
|
||||
((StarlightChunk)ret).starlight$setSkyNibbles(skyNibbles);
|
||||
return;
|
||||
}
|
||||
|
||||
((StarlightChunk)ret).starlight$setBlockNibbles(blockNibbles);
|
||||
((StarlightChunk)ret).starlight$setSkyNibbles(skyNibbles);
|
||||
try {
|
||||
for (final SerializableChunkData.SectionData sectionData : this.sectionData) {
|
||||
final int y = sectionData.y();
|
||||
final DataLayer blockLight = sectionData.blockLight();
|
||||
final DataLayer skyLight = sectionData.skyLight();
|
||||
|
||||
final int blockState = ((StarlightSectionData)(Object)sectionData).starlight$getBlockLightState();
|
||||
final int skyState = ((StarlightSectionData)(Object)sectionData).starlight$getSkyLightState();
|
||||
|
||||
if (blockState >= 0) {
|
||||
if (blockLight != null) {
|
||||
blockNibbles[y - minSection] = new SWMRNibbleArray(MixinWorkarounds.clone(blockLight.getData()), blockState); // clone for data safety
|
||||
} else {
|
||||
blockNibbles[y - minSection] = new SWMRNibbleArray(null, blockState);
|
||||
}
|
||||
}
|
||||
|
||||
if (skyState >= 0 && hasSkyLight) {
|
||||
if (skyLight != null) {
|
||||
skyNibbles[y - minSection] = new SWMRNibbleArray(MixinWorkarounds.clone(skyLight.getData()), skyState); // clone for data safety
|
||||
} else {
|
||||
skyNibbles[y - minSection] = new SWMRNibbleArray(null, skyState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
((StarlightChunk)ret).starlight$setBlockNibbles(blockNibbles);
|
||||
((StarlightChunk)ret).starlight$setSkyNibbles(skyNibbles);
|
||||
} catch (final Throwable thr) {
|
||||
ret.setLightCorrect(false);
|
||||
|
||||
LOGGER.error("Failed to parse light data for chunk " + ret.getPos() + " in world '" + WorldUtil.getWorldName(world) + "'", thr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ import it.unimi.dsi.fastutil.objects.AbstractReference2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectIterator;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectSet;
|
||||
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.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -27,7 +27,7 @@ public final class ZeroCollidingReferenceStateTable<O, S> {
|
||||
|
||||
public ZeroCollidingReferenceStateTable(final Collection<Property<?>> properties) {
|
||||
this.propertyToIndexer = new Int2ObjectOpenHashMap<>(properties.size());
|
||||
this.properties = new ReferenceOpenHashSet<>(properties);
|
||||
this.properties = new ReferenceArrayList<>(properties);
|
||||
|
||||
final List<Property<?>> sortedProperties = new ArrayList<>(properties);
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.CollisionGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
@@ -1943,6 +1945,7 @@ public final class CollisionUtil {
|
||||
|
||||
final BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();
|
||||
final CollisionContext collisionShape = new LazyEntityCollisionContext(entity);
|
||||
final boolean useEntityCollisionShape = LazyEntityCollisionContext.useEntityCollisionShape(world, entity);
|
||||
|
||||
// special cases:
|
||||
if (minBlockY > maxBlockY) {
|
||||
@@ -2028,7 +2031,10 @@ public final class CollisionUtil {
|
||||
VoxelShape blockCollision = ((CollisionBlockState)blockData).moonrise$getConstantContextCollisionShape();
|
||||
|
||||
if (edgeCount == 0 || ((edgeCount != 1 || blockData.hasLargeCollisionShape()) && (edgeCount != 2 || blockData.getBlock() == Blocks.MOVING_PISTON))) {
|
||||
if (blockCollision == null) {
|
||||
if (useEntityCollisionShape) {
|
||||
mutablePos.set(blockX, blockY, blockZ);
|
||||
blockCollision = collisionShape.getCollisionShape(blockData, world, mutablePos);
|
||||
} else if (blockCollision == null) {
|
||||
mutablePos.set(blockX, blockY, blockZ);
|
||||
blockCollision = blockData.getCollisionShape(world, mutablePos, collisionShape);
|
||||
}
|
||||
@@ -2150,6 +2156,10 @@ public final class CollisionUtil {
|
||||
super(false, 0.0, null, null, entity);
|
||||
}
|
||||
|
||||
public static boolean useEntityCollisionShape(final Level world, final Entity entity) {
|
||||
return entity instanceof AbstractMinecart && AbstractMinecart.useExperimentalMovement(world);
|
||||
}
|
||||
|
||||
public boolean isDelegated() {
|
||||
final boolean delegated = this.delegated;
|
||||
this.delegated = false;
|
||||
@@ -2181,6 +2191,11 @@ public final class CollisionUtil {
|
||||
public boolean canStandOnFluid(final FluidState state, final FluidState fluidState) {
|
||||
return this.getDelegate().canStandOnFluid(state, fluidState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(final BlockState blockState, final CollisionGetter collisionGetter, final BlockPos blockPos) {
|
||||
return this.getDelegate().getCollisionShape(blockState, collisionGetter, blockPos);
|
||||
}
|
||||
}
|
||||
|
||||
private CollisionUtil() {
|
||||
|
||||
Reference in New Issue
Block a user