Compare commits
6 Commits
v0.2.0-bet
...
v0.2.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bad5cae4d8 | ||
|
|
e3b1502bb6 | ||
|
|
54fc964987 | ||
|
|
0cbc9aa1a1 | ||
|
|
19e2136ae1 | ||
|
|
126cc03747 |
@@ -12,13 +12,13 @@ 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 |
|
||||
|
||||
@@ -16,6 +16,6 @@ modmenu_version=12.0.0-beta.1
|
||||
fabric_lithium_version=mc1.21.1-0.14.0-beta.1
|
||||
neo_lithium_version=BrMIoIMv
|
||||
# Mod Properties
|
||||
mod_version=0.2.0-beta.2
|
||||
mod_version=0.2.0-beta.3
|
||||
maven_group=ca.spottedleaf.moonrise
|
||||
archives_base_name=moonrise
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user