Compare commits
2 Commits
v0.4.0-bet
...
resource-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81927092f1 | ||
|
|
0f0da2998a |
@@ -4,6 +4,7 @@ plugins {
|
|||||||
id("java-library")
|
id("java-library")
|
||||||
id("net.neoforged.moddev")
|
id("net.neoforged.moddev")
|
||||||
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
|
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
|
||||||
|
id("xyz.jpenilla.resource-factory") version "1.3.0" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions.create("runConfigCommon", RunConfigCommon.class)
|
extensions.create("runConfigCommon", RunConfigCommon.class)
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
import net.fabricmc.loom.util.gradle.SourceSetHelper
|
import net.fabricmc.loom.util.gradle.SourceSetHelper
|
||||||
|
import xyz.jpenilla.resourcefactory.fabric.Environment
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("quiet-fabric-loom")
|
id("quiet-fabric-loom")
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
id 'xyz.jpenilla.resource-factory-fabric-convention'
|
||||||
|
|
||||||
boolean gui = enable_gui == "true"
|
|
||||||
if (gui) {
|
|
||||||
sourceSets.create("gui")
|
|
||||||
loom.createRemapConfigurations(sourceSets.gui)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -26,16 +22,9 @@ dependencies {
|
|||||||
libs("ca.spottedleaf:yamlconfig:${rootProject.yamlconfig_version}") { setTransitive(false) }
|
libs("ca.spottedleaf:yamlconfig:${rootProject.yamlconfig_version}") { setTransitive(false) }
|
||||||
libs("org.yaml:snakeyaml:${rootProject.snakeyaml_version}")
|
libs("org.yaml:snakeyaml:${rootProject.snakeyaml_version}")
|
||||||
|
|
||||||
if (gui) {
|
modImplementation "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
|
||||||
guiCompileOnly(project(":"))
|
include "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
|
||||||
runtimeOnly(sourceSets.gui.output)
|
modImplementation "com.terraformersmc:modmenu:${rootProject.modmenu_version}"
|
||||||
shadow(sourceSets.gui.output)
|
|
||||||
modGuiImplementation "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
|
|
||||||
modRuntimeOnly "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
|
|
||||||
include "me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_version}"
|
|
||||||
modGuiImplementation "com.terraformersmc:modmenu:${rootProject.modmenu_version}"
|
|
||||||
modRuntimeOnly "com.terraformersmc:modmenu:${rootProject.modmenu_version}"
|
|
||||||
}
|
|
||||||
|
|
||||||
modImplementation platform(fabricApiLibs.bom)
|
modImplementation platform(fabricApiLibs.bom)
|
||||||
modImplementation fabricApiLibs.command.api.v2
|
modImplementation fabricApiLibs.command.api.v2
|
||||||
@@ -44,27 +33,6 @@ dependencies {
|
|||||||
include fabricApiLibs.base
|
include fabricApiLibs.base
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gui) {
|
|
||||||
afterEvaluate {
|
|
||||||
configurations.guiCompileOnly {
|
|
||||||
extendsFrom configurations.getByName("minecraftNamedCompile")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.processResources {
|
|
||||||
def properties = [
|
|
||||||
"version": project.version,
|
|
||||||
"minecraft_version": minecraft_version,
|
|
||||||
"loader_version": loader_version,
|
|
||||||
"mod_version": mod_version
|
|
||||||
]
|
|
||||||
inputs.properties(properties)
|
|
||||||
filesMatching("fabric.mod.json") {
|
|
||||||
expand properties
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.shadowJar {
|
tasks.shadowJar {
|
||||||
archiveClassifier = "dev-all"
|
archiveClassifier = "dev-all"
|
||||||
destinationDirectory = layout.buildDirectory.dir("libs")
|
destinationDirectory = layout.buildDirectory.dir("libs")
|
||||||
@@ -74,6 +42,72 @@ tasks.shadowJar {
|
|||||||
relocate 'org.yaml.snakeyaml', 'ca.spottedleaf.moonrise.libs.org.yaml.snakeyaml'
|
relocate 'org.yaml.snakeyaml', 'ca.spottedleaf.moonrise.libs.org.yaml.snakeyaml'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fabricModJson {
|
||||||
|
id = "moonrise"
|
||||||
|
name = "Moonrise"
|
||||||
|
description = "Optimisation mod for the dedicated and integrated server."
|
||||||
|
author("Spottedleaf")
|
||||||
|
contact {
|
||||||
|
issues = "https://github.com/Tuinity/Moonrise/issues"
|
||||||
|
sources = "https://github.com/Tuinity/Moonrise"
|
||||||
|
extra.put("discord", "https://discord.gg/tuinity")
|
||||||
|
homepage = "https://www.curseforge.com/minecraft/mc-mods/moonrise"
|
||||||
|
}
|
||||||
|
breaks("notenoughcrashes")
|
||||||
|
breaks("starlight")
|
||||||
|
breaks("c2me")
|
||||||
|
license("GPL-3.0-only")
|
||||||
|
icon("assets/moonrise/icon.png")
|
||||||
|
environment = Environment.ANY
|
||||||
|
clientEntrypoint("ca.spottedleaf.moonrise.fabric.MoonriseFabricClient")
|
||||||
|
entrypoint("modmenu", "ca.spottedleaf.moonrise.fabric.MoonriseModMenuHook")
|
||||||
|
mixin("moonrise.mixins.json")
|
||||||
|
mixin("moonrise-fabric.mixins.json")
|
||||||
|
accessWidener = "moonrise.accesswidener"
|
||||||
|
depends("fabricloader", ">=${loader_version}")
|
||||||
|
depends("minecraft", ">1.21.4 <1.21.6")
|
||||||
|
depends("fabric-command-api-v2", "*")
|
||||||
|
custom.put(
|
||||||
|
"ferritecore:disabled_options",
|
||||||
|
simpleCustomValueList(String, ["replaceNeighborLookup", "replacePropertyMap"])
|
||||||
|
)
|
||||||
|
custom.put(
|
||||||
|
"lithium:options",
|
||||||
|
simpleCustomValueMap(
|
||||||
|
String,
|
||||||
|
Boolean,
|
||||||
|
[
|
||||||
|
"mixin.ai.poi": false,
|
||||||
|
"mixin.alloc.deep_passengers": false,
|
||||||
|
"mixin.alloc.entity_tracker": false,
|
||||||
|
"mixin.block.flatten_states": false,
|
||||||
|
"mixin.chunk.entity_class_groups": false,
|
||||||
|
"mixin.chunk.no_validation": false,
|
||||||
|
"mixin.collections.chunk_tickets": false,
|
||||||
|
"mixin.collections.entity_ticking": false,
|
||||||
|
"mixin.entity.collisions.intersection": false,
|
||||||
|
"mixin.entity.collisions.movement": false,
|
||||||
|
"mixin.entity.collisions.unpushable_cramming": false,
|
||||||
|
"mixin.entity.replace_entitytype_predicates": false,
|
||||||
|
"mixin.math.fast_blockpos": false,
|
||||||
|
"mixin.math.fast_util": false,
|
||||||
|
"mixin.minimal_nonvanilla.collisions.empty_space": false,
|
||||||
|
"mixin.minimal_nonvanilla.world.expiring_chunk_tickets": false,
|
||||||
|
"mixin.shapes.blockstate_cache": false,
|
||||||
|
"mixin.shapes.optimized_matching": false,
|
||||||
|
"mixin.shapes.specialized_shapes": false,
|
||||||
|
"mixin.util.block_tracking": false,
|
||||||
|
"mixin.util.entity_movement_tracking": false,
|
||||||
|
"mixin.world.block_entity_ticking": false,
|
||||||
|
"mixin.world.chunk_access": false,
|
||||||
|
"mixin.world.explosions.block_raycast": false,
|
||||||
|
"mixin.world.temperature_cache": false,
|
||||||
|
"mixin.world.tick_scheduler": false,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
publishMods {
|
publishMods {
|
||||||
file = remapJar.archiveFile
|
file = remapJar.archiveFile
|
||||||
modLoaders = ["fabric"]
|
modLoaders = ["fabric"]
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ca.spottedleaf.moonrise.common.util.ConfigHolder;
|
|||||||
import ca.spottedleaf.moonrise.patches.chunk_system.ticket.ChunkSystemTicketType;
|
import ca.spottedleaf.moonrise.patches.chunk_system.ticket.ChunkSystemTicketType;
|
||||||
import com.mojang.datafixers.DSL;
|
import com.mojang.datafixers.DSL;
|
||||||
import com.mojang.datafixers.DataFixer;
|
import com.mojang.datafixers.DataFixer;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import com.mojang.serialization.Dynamic;
|
import com.mojang.serialization.Dynamic;
|
||||||
import it.unimi.dsi.fastutil.longs.LongArrays;
|
import it.unimi.dsi.fastutil.longs.LongArrays;
|
||||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
|
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents;
|
||||||
@@ -19,7 +18,6 @@ import net.minecraft.server.level.GenerationChunkHolder;
|
|||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.level.TicketType;
|
import net.minecraft.server.level.TicketType;
|
||||||
import net.minecraft.util.ProblemReporter;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.boss.EnderDragonPart;
|
import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
@@ -33,9 +31,7 @@ import net.minecraft.world.level.chunk.ProtoChunk;
|
|||||||
import net.minecraft.world.level.chunk.status.ChunkStatusTasks;
|
import net.minecraft.world.level.chunk.status.ChunkStatusTasks;
|
||||||
import net.minecraft.world.level.chunk.storage.SerializableChunkData;
|
import net.minecraft.world.level.chunk.storage.SerializableChunkData;
|
||||||
import net.minecraft.world.level.entity.EntityTypeTest;
|
import net.minecraft.world.level.entity.EntityTypeTest;
|
||||||
import net.minecraft.world.level.storage.TagValueInput;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@@ -44,8 +40,6 @@ public final class FabricHooks extends BaseChunkSystemHooks implements PlatformH
|
|||||||
|
|
||||||
private static final boolean HAS_FABRIC_LIFECYCLE_EVENTS = FabricLoader.getInstance().isModLoaded("fabric-lifecycle-events-v1");
|
private static final boolean HAS_FABRIC_LIFECYCLE_EVENTS = FabricLoader.getInstance().isModLoaded("fabric-lifecycle-events-v1");
|
||||||
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBrand() {
|
public String getBrand() {
|
||||||
return "Moonrise";
|
return "Moonrise";
|
||||||
@@ -257,9 +251,7 @@ public final class FabricHooks extends BaseChunkSystemHooks implements PlatformH
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postLoadProtoChunk(final ServerLevel world, final ProtoChunk chunk) {
|
public void postLoadProtoChunk(final ServerLevel world, final ProtoChunk chunk) {
|
||||||
try (final ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(chunk.problemPath(), LOGGER)) {
|
ChunkStatusTasks.postLoadProtoChunk(world, chunk.getEntities());
|
||||||
ChunkStatusTasks.postLoadProtoChunk(world, TagValueInput.create(scopedCollector, world.registryAccess(), chunk.getEntities()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
{
|
|
||||||
"schemaVersion": 1,
|
|
||||||
"id": "moonrise",
|
|
||||||
"version": "${version}",
|
|
||||||
"name": "Moonrise",
|
|
||||||
"description": "Optimisation mod for the dedicated and integrated server.",
|
|
||||||
"authors": [
|
|
||||||
"Spottedleaf"
|
|
||||||
],
|
|
||||||
"contact": {
|
|
||||||
"issues": "https://github.com/Tuinity/Moonrise/issues",
|
|
||||||
"sources": "https://github.com/Tuinity/Moonrise",
|
|
||||||
"discord": "https://discord.gg/tuinity",
|
|
||||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/moonrise"
|
|
||||||
},
|
|
||||||
"breaks": {
|
|
||||||
"notenoughcrashes": "*",
|
|
||||||
"starlight": "*",
|
|
||||||
"c2me": "*"
|
|
||||||
},
|
|
||||||
"license": "GPL-3.0-only",
|
|
||||||
"icon": "assets/moonrise/icon.png",
|
|
||||||
"environment": "*",
|
|
||||||
"entrypoints": {
|
|
||||||
"modmenu": [
|
|
||||||
"ca.spottedleaf.moonrise.fabric.MoonriseModMenuHook"
|
|
||||||
],
|
|
||||||
"client": [
|
|
||||||
"ca.spottedleaf.moonrise.fabric.MoonriseFabricClient"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"mixins": [
|
|
||||||
"moonrise.mixins.json",
|
|
||||||
"moonrise-fabric.mixins.json"
|
|
||||||
],
|
|
||||||
"accessWidener": "moonrise.accesswidener",
|
|
||||||
"depends": {
|
|
||||||
"fabricloader": ">=${loader_version}",
|
|
||||||
"minecraft": ">1.21.5 <1.21.7",
|
|
||||||
"fabric-command-api-v2": "*"
|
|
||||||
},
|
|
||||||
"custom": {
|
|
||||||
"lithium:options": {
|
|
||||||
"mixin.ai.poi": false,
|
|
||||||
"mixin.alloc.deep_passengers": false,
|
|
||||||
"mixin.alloc.entity_tracker": false,
|
|
||||||
"mixin.block.flatten_states": false,
|
|
||||||
"mixin.chunk.entity_class_groups": false,
|
|
||||||
"mixin.chunk.no_validation": false,
|
|
||||||
"mixin.collections.chunk_tickets": false,
|
|
||||||
"mixin.collections.entity_ticking": false,
|
|
||||||
"mixin.entity.collisions.intersection": false,
|
|
||||||
"mixin.entity.collisions.movement": false,
|
|
||||||
"mixin.entity.collisions.unpushable_cramming": false,
|
|
||||||
"mixin.entity.replace_entitytype_predicates": false,
|
|
||||||
"mixin.math.fast_blockpos": false,
|
|
||||||
"mixin.math.fast_util": false,
|
|
||||||
"mixin.minimal_nonvanilla.collisions.empty_space": false,
|
|
||||||
"mixin.minimal_nonvanilla.world.expiring_chunk_tickets": false,
|
|
||||||
"mixin.shapes.blockstate_cache": false,
|
|
||||||
"mixin.shapes.optimized_matching": false,
|
|
||||||
"mixin.shapes.specialized_shapes": false,
|
|
||||||
"mixin.util.block_tracking": false,
|
|
||||||
"mixin.util.entity_movement_tracking": false,
|
|
||||||
"mixin.world.block_entity_ticking": false,
|
|
||||||
"mixin.world.chunk_access": false,
|
|
||||||
"mixin.world.explosions.block_raycast": false,
|
|
||||||
"mixin.world.temperature_cache": false,
|
|
||||||
"mixin.world.tick_scheduler": false
|
|
||||||
},
|
|
||||||
"ferritecore:disabled_options": [
|
|
||||||
"replaceNeighborLookup",
|
|
||||||
"replacePropertyMap"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,25 +4,23 @@ org.gradle.parallel=true
|
|||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop/
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.21.6
|
minecraft_version=1.21.5
|
||||||
loader_version=0.16.14
|
loader_version=0.16.14
|
||||||
supported_minecraft_versions=1.21.6
|
supported_minecraft_versions=1.21.5
|
||||||
neoforge_version=21.6.5-beta
|
neoforge_version=21.5.65-beta
|
||||||
neoform_version=1.21.6-20250617.151856
|
neoform_version=1.21.5-20250325.162830
|
||||||
fabric_api_version=0.127.0+1.21.6
|
fabric_api_version=0.123.0+1.21.5
|
||||||
snakeyaml_version=2.3
|
snakeyaml_version=2.3
|
||||||
concurrentutil_version=0.0.3
|
concurrentutil_version=0.0.3
|
||||||
yamlconfig_version=1.0.2
|
yamlconfig_version=1.0.2
|
||||||
cloth_version=19.0.146
|
cloth_version=18.0.145
|
||||||
modmenu_version=15.0.0-beta.2
|
modmenu_version=14.0.0-rc.2
|
||||||
# set to false when modmenu/cloth is not updated for the current minecraft version
|
|
||||||
enable_gui=true
|
|
||||||
junit_version=5.11.3
|
junit_version=5.11.3
|
||||||
# version ids from modrinth
|
# version ids from modrinth
|
||||||
fabric_lithium_version=nhc57Td2
|
fabric_lithium_version=nhc57Td2
|
||||||
neo_lithium_version=P5VT33Jo
|
neo_lithium_version=P5VT33Jo
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=0.4.0-beta.1
|
mod_version=0.3.0-SNAPSHOT
|
||||||
maven_group=ca.spottedleaf.moonrise
|
maven_group=ca.spottedleaf.moonrise
|
||||||
archives_base_name=moonrise
|
archives_base_name=moonrise
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
6
gradlew
vendored
6
gradlew
vendored
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH="\\\"\\\""
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -205,7 +205,7 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
4
gradlew.bat
vendored
4
gradlew.bat
vendored
@@ -70,11 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import net.neoforged.moddevgradle.internal.RunGameTask
|
|||||||
plugins {
|
plugins {
|
||||||
id("net.neoforged.moddev")
|
id("net.neoforged.moddev")
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
|
id 'xyz.jpenilla.resource-factory-neoforge-convention'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -57,18 +58,6 @@ dependencies {
|
|||||||
jarJar "me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_version}"
|
jarJar "me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.processResources {
|
|
||||||
def properties = [
|
|
||||||
"version": project.version,
|
|
||||||
"minecraft_version": minecraft_version,
|
|
||||||
"mod_version": mod_version
|
|
||||||
]
|
|
||||||
inputs.properties(properties)
|
|
||||||
filesMatching("META-INF/neoforge.mods.toml") {
|
|
||||||
expand properties
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
archiveClassifier = "dev"
|
archiveClassifier = "dev"
|
||||||
}
|
}
|
||||||
@@ -94,6 +83,75 @@ tasks.assemble {
|
|||||||
dependsOn tasks.productionJar
|
dependsOn tasks.productionJar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
neoForgeModsToml {
|
||||||
|
license = "GPLv3"
|
||||||
|
issueTrackerUrl = "https://github.com/Tuinity/Moonrise"
|
||||||
|
showAsResourcePack = false
|
||||||
|
|
||||||
|
mods.register("moonrise") {
|
||||||
|
setConventionsFromProjectMeta(project)
|
||||||
|
displayName = "Moonrise"
|
||||||
|
displayUrl = "https://github.com/Tuinity/Moonrise"
|
||||||
|
authors = "Spottedleaf"
|
||||||
|
description = "Optimisation mod for the dedicated and integrated server."
|
||||||
|
logoFile = "assets/moonrise/icon.png"
|
||||||
|
custom.put(
|
||||||
|
"ferritecore:disabled_options",
|
||||||
|
simpleCustomValueList(String, ["replaceNeighborLookup", "replacePropertyMap"])
|
||||||
|
)
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
required("neoforge", "[21.5,)")
|
||||||
|
required("minecraft", "1.21.5")
|
||||||
|
|
||||||
|
incompatible("notenoughcrashes")
|
||||||
|
incompatible("starlight")
|
||||||
|
incompatible("c2me")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mixins(
|
||||||
|
"moonrise.mixins.json",
|
||||||
|
"moonrise-neoforge.mixins.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
custom.put(
|
||||||
|
"lithium:options",
|
||||||
|
simpleCustomValueMap(
|
||||||
|
String,
|
||||||
|
Boolean,
|
||||||
|
[
|
||||||
|
"mixin.ai.poi": false,
|
||||||
|
"mixin.alloc.deep_passengers": false,
|
||||||
|
"mixin.alloc.entity_tracker": false,
|
||||||
|
"mixin.block.flatten_states": false,
|
||||||
|
"mixin.chunk.entity_class_groups": false,
|
||||||
|
"mixin.chunk.no_validation": false,
|
||||||
|
"mixin.collections.chunk_tickets": false,
|
||||||
|
"mixin.collections.entity_ticking": false,
|
||||||
|
"mixin.entity.collisions.intersection": false,
|
||||||
|
"mixin.entity.collisions.movement": false,
|
||||||
|
"mixin.entity.collisions.unpushable_cramming": false,
|
||||||
|
"mixin.entity.replace_entitytype_predicates": false,
|
||||||
|
"mixin.math.fast_blockpos": false,
|
||||||
|
"mixin.math.fast_util": false,
|
||||||
|
"mixin.minimal_nonvanilla.collisions.empty_space": false,
|
||||||
|
"mixin.minimal_nonvanilla.world.expiring_chunk_tickets": false,
|
||||||
|
"mixin.shapes.blockstate_cache": false,
|
||||||
|
"mixin.shapes.optimized_matching": false,
|
||||||
|
"mixin.shapes.specialized_shapes": false,
|
||||||
|
"mixin.util.block_tracking": false,
|
||||||
|
"mixin.util.entity_movement_tracking": false,
|
||||||
|
"mixin.world.block_entity_ticking": false,
|
||||||
|
"mixin.world.chunk_access": false,
|
||||||
|
"mixin.world.explosions.block_raycast": false,
|
||||||
|
"mixin.world.temperature_cache": false,
|
||||||
|
"mixin.world.tick_scheduler": false,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
publishMods {
|
publishMods {
|
||||||
file = productionJar.archiveFile
|
file = productionJar.archiveFile
|
||||||
modLoaders = ["neoforge"]
|
modLoaders = ["neoforge"]
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
|
|||||||
import ca.spottedleaf.moonrise.patches.chunk_system.ticket.ChunkSystemTicketType;
|
import ca.spottedleaf.moonrise.patches.chunk_system.ticket.ChunkSystemTicketType;
|
||||||
import com.mojang.datafixers.DSL;
|
import com.mojang.datafixers.DSL;
|
||||||
import com.mojang.datafixers.DataFixer;
|
import com.mojang.datafixers.DataFixer;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import com.mojang.serialization.Dynamic;
|
import com.mojang.serialization.Dynamic;
|
||||||
import it.unimi.dsi.fastutil.longs.LongArrayList;
|
import it.unimi.dsi.fastutil.longs.LongArrayList;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@@ -18,7 +17,6 @@ import net.minecraft.server.level.GenerationChunkHolder;
|
|||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.level.TicketType;
|
import net.minecraft.server.level.TicketType;
|
||||||
import net.minecraft.util.ProblemReporter;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.ChunkPos;
|
import net.minecraft.world.level.ChunkPos;
|
||||||
@@ -32,7 +30,6 @@ import net.minecraft.world.level.chunk.ProtoChunk;
|
|||||||
import net.minecraft.world.level.chunk.status.ChunkStatusTasks;
|
import net.minecraft.world.level.chunk.status.ChunkStatusTasks;
|
||||||
import net.minecraft.world.level.chunk.storage.SerializableChunkData;
|
import net.minecraft.world.level.chunk.storage.SerializableChunkData;
|
||||||
import net.minecraft.world.level.entity.EntityTypeTest;
|
import net.minecraft.world.level.entity.EntityTypeTest;
|
||||||
import net.minecraft.world.level.storage.TagValueInput;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.neoforged.neoforge.common.CommonHooks;
|
import net.neoforged.neoforge.common.CommonHooks;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
@@ -41,15 +38,12 @@ import net.neoforged.neoforge.event.EventHooks;
|
|||||||
import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent;
|
import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent;
|
||||||
import net.neoforged.neoforge.event.level.ChunkDataEvent;
|
import net.neoforged.neoforge.event.level.ChunkDataEvent;
|
||||||
import net.neoforged.neoforge.event.level.ChunkEvent;
|
import net.neoforged.neoforge.event.level.ChunkEvent;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
public final class NeoForgeHooks extends BaseChunkSystemHooks implements PlatformHooks {
|
public final class NeoForgeHooks extends BaseChunkSystemHooks implements PlatformHooks {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBrand() {
|
public String getBrand() {
|
||||||
return "Moonrise";
|
return "Moonrise";
|
||||||
@@ -263,9 +257,7 @@ public final class NeoForgeHooks extends BaseChunkSystemHooks implements Platfor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postLoadProtoChunk(final ServerLevel world, final ProtoChunk chunk) {
|
public void postLoadProtoChunk(final ServerLevel world, final ProtoChunk chunk) {
|
||||||
try (final ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(chunk.problemPath(), LOGGER)) {
|
ChunkStatusTasks.postLoadProtoChunk(world, chunk.getEntities());
|
||||||
ChunkStatusTasks.postLoadProtoChunk(world, TagValueInput.create(scopedCollector, world.registryAccess(), chunk.getEntities()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
modLoader = "javafml"
|
|
||||||
loaderVersion = "[1,)"
|
|
||||||
license = "GPLv3"
|
|
||||||
issueTrackerURL = "https://github.com/Tuinity/Moonrise"
|
|
||||||
showAsResourcePack = false
|
|
||||||
logoFile = "assets/moonrise/icon.png"
|
|
||||||
|
|
||||||
[[mods]]
|
|
||||||
modId = "moonrise"
|
|
||||||
version = "${version}"
|
|
||||||
displayName = "Moonrise"
|
|
||||||
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"
|
|
||||||
type = "required"
|
|
||||||
versionRange = "[21.0,)"
|
|
||||||
ordering = "NONE"
|
|
||||||
side = "BOTH"
|
|
||||||
|
|
||||||
[[dependencies.moonrise]]
|
|
||||||
modId = "minecraft"
|
|
||||||
type = "required"
|
|
||||||
versionRange = "(1.21.5,1.21.7)"
|
|
||||||
ordering = "NONE"
|
|
||||||
side = "BOTH"
|
|
||||||
|
|
||||||
[[dependencies.moonrise]]
|
|
||||||
modId = "notenoughcrashes"
|
|
||||||
type = "incompatible"
|
|
||||||
|
|
||||||
[[dependencies.moonrise]]
|
|
||||||
modId = "starlight"
|
|
||||||
type = "incompatible"
|
|
||||||
|
|
||||||
[[dependencies.moonrise]]
|
|
||||||
# unofficial lithium port
|
|
||||||
modId = "canary"
|
|
||||||
type = "incompatible"
|
|
||||||
|
|
||||||
[[dependencies.moonrise]]
|
|
||||||
modId = "c2me"
|
|
||||||
type = "incompatible"
|
|
||||||
|
|
||||||
[[mixins]]
|
|
||||||
config = "moonrise.mixins.json"
|
|
||||||
|
|
||||||
[[mixins]]
|
|
||||||
config = "moonrise-neoforge.mixins.json"
|
|
||||||
|
|
||||||
["lithium:options"]
|
|
||||||
"mixin.ai.poi" = false
|
|
||||||
"mixin.alloc.deep_passengers" = false
|
|
||||||
"mixin.alloc.entity_tracker" = false
|
|
||||||
"mixin.block.flatten_states" = false
|
|
||||||
"mixin.chunk.entity_class_groups" = false
|
|
||||||
"mixin.chunk.no_validation" = false
|
|
||||||
"mixin.collections.chunk_tickets" = false
|
|
||||||
"mixin.collections.entity_ticking" = false
|
|
||||||
"mixin.entity.collisions.intersection" = false
|
|
||||||
"mixin.entity.collisions.movement" = false
|
|
||||||
"mixin.entity.collisions.unpushable_cramming" = false
|
|
||||||
"mixin.entity.replace_entitytype_predicates" = false
|
|
||||||
"mixin.math.fast_blockpos" = false
|
|
||||||
"mixin.math.fast_util" = false
|
|
||||||
"mixin.minimal_nonvanilla.collisions.empty_space" = false
|
|
||||||
"mixin.minimal_nonvanilla.world.expiring_chunk_tickets" = false
|
|
||||||
"mixin.shapes.blockstate_cache" = false
|
|
||||||
"mixin.shapes.optimized_matching" = false
|
|
||||||
"mixin.shapes.specialized_shapes" = false
|
|
||||||
"mixin.util.block_tracking" = false
|
|
||||||
"mixin.util.entity_movement_tracking" = false
|
|
||||||
"mixin.world.block_entity_ticking" = false
|
|
||||||
"mixin.world.chunk_access" = false
|
|
||||||
"mixin.world.explosions.block_raycast" = false
|
|
||||||
"mixin.world.temperature_cache" = false
|
|
||||||
"mixin.world.tick_scheduler" = false
|
|
||||||
@@ -22,7 +22,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
||||||
id("quiet-fabric-loom") version "1.10.317" apply false
|
id("quiet-fabric-loom") version "1.10.317" apply false
|
||||||
id("net.neoforged.moddev") version "2.0.80" apply false
|
id("net.neoforged.moddev") version "2.0.80" apply false
|
||||||
id 'com.gradleup.shadow' version '8.3.6' apply false
|
id 'com.gradleup.shadow' version '8.3.6' apply false
|
||||||
|
|||||||
@@ -607,22 +607,6 @@ abstract class ServerLevelMixin extends Level implements ChunkSystemServerLevel,
|
|||||||
this.moonrise$getEntityLookup().addWorldGenChunkEntities(stream.toList(), null); // TODO
|
this.moonrise$getEntityLookup().addWorldGenChunkEntities(stream.toList(), null); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @reason Not needed in new chunk system, also avoid accessing old entity manager
|
|
||||||
* @author Spottedleaf
|
|
||||||
*/
|
|
||||||
@Redirect(
|
|
||||||
method = {
|
|
||||||
"method_72080",
|
|
||||||
"lambda$waitForChunkAndEntities$21"
|
|
||||||
},
|
|
||||||
at = @At(
|
|
||||||
value = "INVOKE",
|
|
||||||
target = "Lnet/minecraft/world/level/entity/PersistentEntitySectionManager;processPendingLoads()V"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
private void redirectWaitForChunks(final PersistentEntitySectionManager<Entity> instance) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @reason Level close now handles this
|
* @reason Level close now handles this
|
||||||
* @author Spottedleaf
|
* @author Spottedleaf
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
|
|
||||||
@Mixin(ServerPlayer.class)
|
@Mixin(ServerPlayer.class)
|
||||||
abstract class ServerPlayerMixin extends Player implements ChunkSystemServerPlayer {
|
abstract class ServerPlayerMixin extends Player implements ChunkSystemServerPlayer {
|
||||||
public ServerPlayerMixin(final Level p_250508_, final GameProfile p_252153_) {
|
public ServerPlayerMixin(Level level, BlockPos blockPos, float f, GameProfile gameProfile) {
|
||||||
super(p_250508_, p_252153_);
|
super(level, blockPos, f, gameProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.BiPredicate;
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
@Mixin(TicketStorage.class)
|
@Mixin(TicketStorage.class)
|
||||||
@@ -194,8 +193,8 @@ abstract class TicketStorageMixin extends SavedData implements ChunkSystemTicket
|
|||||||
* @author Spottedleaf
|
* @author Spottedleaf
|
||||||
*/
|
*/
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public void purgeStaleTickets(final ChunkMap chunkMap) {
|
public void purgeStaleTickets() {
|
||||||
((ChunkSystemServerLevel)chunkMap.level).moonrise$getChunkTaskScheduler().chunkHolderManager.tick();
|
((ChunkSystemServerLevel)this.chunkMap.level).moonrise$getChunkTaskScheduler().chunkHolderManager.tick();
|
||||||
this.setDirty();
|
this.setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,11 +208,11 @@ abstract class TicketStorageMixin extends SavedData implements ChunkSystemTicket
|
|||||||
method = "deactivateTicketsOnClosing",
|
method = "deactivateTicketsOnClosing",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/world/level/TicketStorage;removeTicketIf(Ljava/util/function/BiPredicate;Lit/unimi/dsi/fastutil/longs/Long2ObjectOpenHashMap;)V"
|
target = "Lnet/minecraft/world/level/TicketStorage;removeTicketIf(Ljava/util/function/Predicate;Lit/unimi/dsi/fastutil/longs/Long2ObjectOpenHashMap;)V"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private void avoidRemovingTicketsOnShutdown(final TicketStorage instance,
|
private void avoidRemovingTicketsOnShutdown(final TicketStorage instance,
|
||||||
final BiPredicate<Long, Ticket> predicate,
|
final Predicate<Ticket> predicate,
|
||||||
final Long2ObjectOpenHashMap<List<Ticket>> tickets) {}
|
final Long2ObjectOpenHashMap<List<Ticket>> tickets) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -221,7 +220,7 @@ abstract class TicketStorageMixin extends SavedData implements ChunkSystemTicket
|
|||||||
* @author Spottedleaf
|
* @author Spottedleaf
|
||||||
*/
|
*/
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public void removeTicketIf(final BiPredicate<Long, Ticket> predicate, final Long2ObjectOpenHashMap<List<Ticket>> into) {
|
public void removeTicketIf(final Predicate<Ticket> predicate, final Long2ObjectOpenHashMap<List<Ticket>> into) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package ca.spottedleaf.moonrise.mixin.chunk_system;
|
|
||||||
|
|
||||||
import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
|
|
||||||
import ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer;
|
|
||||||
import ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader;
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
|
||||||
import net.minecraft.world.level.ChunkPos;
|
|
||||||
import net.minecraft.world.waypoints.Waypoint;
|
|
||||||
import net.minecraft.world.waypoints.WaypointTransmitter;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
|
||||||
|
|
||||||
@Mixin(WaypointTransmitter.class)
|
|
||||||
interface WaypointTransmitterMixin extends Waypoint {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @reason Redirect to the new player chunk loader, as the Vanilla chunk tracker is set to empty on Moonrise
|
|
||||||
* @author Spottedleaf
|
|
||||||
*/
|
|
||||||
@Overwrite
|
|
||||||
public static boolean isChunkVisible(final ChunkPos pos, final ServerPlayer player) {
|
|
||||||
final RegionizedPlayerChunkLoader.PlayerChunkLoaderData playerChunkLoader = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
|
||||||
return playerChunkLoader != null && playerChunkLoader.getSentChunksRaw().contains(CoordinateUtils.getChunkKey(pos));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -59,7 +59,7 @@ interface EntityGetterMixin {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((entity == null && otherEntity.canBeCollidedWith(entity)) || (entity != null && entity.canCollideWith(otherEntity))) {
|
if ((entity == null && otherEntity.canBeCollidedWith()) || (entity != null && entity.canCollideWith(otherEntity))) {
|
||||||
ret.add(Shapes.create(otherEntity.getBoundingBox()));
|
ret.add(Shapes.create(otherEntity.getBoundingBox()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public final class ChunkSystemConverters {
|
|||||||
private static final int DEFAULT_ENTITY_CHUNK_DATA_VERSION = -1;
|
private static final int DEFAULT_ENTITY_CHUNK_DATA_VERSION = -1;
|
||||||
|
|
||||||
private static int getCurrentVersion() {
|
private static int getCurrentVersion() {
|
||||||
return SharedConstants.getCurrentVersion().dataVersion().version();
|
return SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getDataVersion(final CompoundTag data, final int dfl) {
|
private static int getDataVersion(final CompoundTag data, final int dfl) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package ca.spottedleaf.moonrise.patches.chunk_system.entity;
|
|||||||
import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData;
|
import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData;
|
||||||
import net.minecraft.server.level.FullChunkStatus;
|
import net.minecraft.server.level.FullChunkStatus;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.animal.HappyGhast;
|
|
||||||
import net.minecraft.world.entity.monster.Shulker;
|
import net.minecraft.world.entity.monster.Shulker;
|
||||||
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
||||||
import net.minecraft.world.entity.vehicle.Boat;
|
import net.minecraft.world.entity.vehicle.Boat;
|
||||||
@@ -14,7 +13,7 @@ public interface ChunkSystemEntity {
|
|||||||
|
|
||||||
// for mods to override
|
// for mods to override
|
||||||
public default boolean moonrise$isHardCollidingUncached() {
|
public default boolean moonrise$isHardCollidingUncached() {
|
||||||
return this instanceof Boat || this instanceof AbstractMinecart || this instanceof Shulker || this instanceof HappyGhast || ((Entity)this).canBeCollidedWith(null);
|
return this instanceof Boat || this instanceof AbstractMinecart || this instanceof Shulker || ((Entity)this).canBeCollidedWith();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FullChunkStatus moonrise$getChunkStatus();
|
public FullChunkStatus moonrise$getChunkStatus();
|
||||||
|
|||||||
@@ -1143,7 +1143,7 @@ public final class MoonriseRegionFileIO {
|
|||||||
LOGGER.error("Failed to decompress chunk data for task: " + this.toString(), thr);
|
LOGGER.error("Failed to decompress chunk data for task: " + this.toString(), thr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (throwable == null && compoundTag == null) {
|
if (compoundTag == null) {
|
||||||
// need to re-try from the start
|
// need to re-try from the start
|
||||||
this.scheduleReadIO();
|
this.scheduleReadIO();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import ca.spottedleaf.moonrise.common.list.EntityList;
|
|||||||
import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData;
|
import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData;
|
||||||
import ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity;
|
import ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
|
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
@@ -15,7 +14,6 @@ import net.minecraft.nbt.Tag;
|
|||||||
import net.minecraft.server.level.FullChunkStatus;
|
import net.minecraft.server.level.FullChunkStatus;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.util.ProblemReporter;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.EntitySpawnReason;
|
import net.minecraft.world.entity.EntitySpawnReason;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
@@ -23,14 +21,9 @@ import net.minecraft.world.entity.boss.EnderDragonPart;
|
|||||||
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
||||||
import net.minecraft.world.level.ChunkPos;
|
import net.minecraft.world.level.ChunkPos;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
|
||||||
import net.minecraft.world.level.chunk.storage.EntityStorage;
|
import net.minecraft.world.level.chunk.storage.EntityStorage;
|
||||||
import net.minecraft.world.level.entity.Visibility;
|
import net.minecraft.world.level.entity.Visibility;
|
||||||
import net.minecraft.world.level.storage.TagValueInput;
|
|
||||||
import net.minecraft.world.level.storage.TagValueOutput;
|
|
||||||
import net.minecraft.world.level.storage.ValueInput;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -39,8 +32,6 @@ import java.util.function.Predicate;
|
|||||||
|
|
||||||
public final class ChunkEntitySlices {
|
public final class ChunkEntitySlices {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
|
||||||
|
|
||||||
public final int minSection;
|
public final int minSection;
|
||||||
public final int maxSection;
|
public final int maxSection;
|
||||||
public final int chunkX;
|
public final int chunkX;
|
||||||
@@ -83,12 +74,9 @@ public final class ChunkEntitySlices {
|
|||||||
this.chunkData = chunkData;
|
this.chunkData = chunkData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Entity> readEntities(final ServerLevel world, final ChunkPos pos, final CompoundTag compoundTag) {
|
public static List<Entity> readEntities(final ServerLevel world, final CompoundTag compoundTag) {
|
||||||
try (final ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(ChunkAccess.problemPath(pos), LOGGER)) {
|
// TODO check this and below on update for format changes
|
||||||
ValueInput valueinput = TagValueInput.create(scopedCollector, world.registryAccess(), compoundTag);
|
return EntityType.loadEntitiesRecursive(compoundTag.getListOrEmpty("Entities"), world, EntitySpawnReason.LOAD).collect(ImmutableList.toImmutableList());
|
||||||
// TODO check this and below on update for format changes
|
|
||||||
return EntityType.loadEntitiesRecursive(valueinput.childrenListOrEmpty("Entities"), world, EntitySpawnReason.LOAD).collect(ImmutableList.toImmutableList());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
@@ -116,22 +104,12 @@ public final class ChunkEntitySlices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ListTag entitiesTag = new ListTag();
|
final ListTag entitiesTag = new ListTag();
|
||||||
try (final ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(ChunkAccess.problemPath(chunkPos), LOGGER)) {
|
for (final Entity entity : PlatformHooks.get().modifySavedEntities(world, chunkPos.x, chunkPos.z, entities)) {
|
||||||
for (final Entity entity : PlatformHooks.get().modifySavedEntities(world, chunkPos.x, chunkPos.z, entities)) {
|
CompoundTag compoundTag = new CompoundTag();
|
||||||
final TagValueOutput savedEntity = TagValueOutput.createWithContext(
|
if (entity.save(compoundTag)) {
|
||||||
scopedCollector.forChild(entity.problemPath()), entity.registryAccess()
|
entitiesTag.add(compoundTag);
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (entity.save(savedEntity)) {
|
|
||||||
entitiesTag.add(savedEntity.buildResult());
|
|
||||||
}
|
|
||||||
} catch (final Exception ex) {
|
|
||||||
LOGGER.error("Entity type " + entity.getType() + " failed to serialize", ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final CompoundTag ret = NbtUtils.addCurrentDataVersion(new CompoundTag());
|
final CompoundTag ret = NbtUtils.addCurrentDataVersion(new CompoundTag());
|
||||||
ret.put("Entities", entitiesTag);
|
ret.put("Entities", entitiesTag);
|
||||||
ret.store("Position", ChunkPos.CODEC, chunkPos);
|
ret.store("Position", ChunkPos.CODEC, chunkPos);
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public final class PoiChunk {
|
|||||||
final CompoundTag sections = new CompoundTag();
|
final CompoundTag sections = new CompoundTag();
|
||||||
ret.put("Sections", sections);
|
ret.put("Sections", sections);
|
||||||
|
|
||||||
ret.putInt("DataVersion", SharedConstants.getCurrentVersion().dataVersion().version());
|
ret.putInt("DataVersion", SharedConstants.getCurrentVersion().getDataVersion().getVersion());
|
||||||
|
|
||||||
final ServerLevel world = this.world;
|
final ServerLevel world = this.world;
|
||||||
final int chunkX = this.chunkX;
|
final int chunkX = this.chunkX;
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public final class RegionizedPlayerChunkLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getAPITickViewDistance(final ServerPlayer player) {
|
public static int getAPITickViewDistance(final ServerPlayer player) {
|
||||||
final ServerLevel level = player.level();
|
final ServerLevel level = player.serverLevel();
|
||||||
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPITickDistance();
|
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPITickDistance();
|
||||||
@@ -156,7 +156,7 @@ public final class RegionizedPlayerChunkLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getAPIViewDistance(final ServerPlayer player) {
|
public static int getAPIViewDistance(final ServerPlayer player) {
|
||||||
final ServerLevel level = player.level();
|
final ServerLevel level = player.serverLevel();
|
||||||
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPIViewDistance();
|
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPIViewDistance();
|
||||||
@@ -166,7 +166,7 @@ public final class RegionizedPlayerChunkLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getAPISendViewDistance(final ServerPlayer player) {
|
public static int getAPISendViewDistance(final ServerPlayer player) {
|
||||||
final ServerLevel level = player.level();
|
final ServerLevel level = player.serverLevel();
|
||||||
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
final PlayerChunkLoaderData data = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPISendViewDistance();
|
return ((ChunkSystemServerLevel)level).moonrise$getPlayerChunkLoader().getAPISendViewDistance();
|
||||||
|
|||||||
@@ -117,11 +117,9 @@ public final class NewChunkHolder {
|
|||||||
|
|
||||||
if (!transientChunk) {
|
if (!transientChunk) {
|
||||||
if (entityChunk != null) {
|
if (entityChunk != null) {
|
||||||
final ChunkPos pos = new ChunkPos(this.chunkX, this.chunkZ);
|
final List<Entity> entities = ChunkEntitySlices.readEntities(this.world, entityChunk);
|
||||||
|
|
||||||
final List<Entity> entities = ChunkEntitySlices.readEntities(this.world, pos, entityChunk);
|
((ChunkSystemServerLevel)this.world).moonrise$getEntityLookup().addEntityChunkEntities(entities, new ChunkPos(this.chunkX, this.chunkZ));
|
||||||
|
|
||||||
((ChunkSystemServerLevel)this.world).moonrise$getEntityLookup().addEntityChunkEntities(entities, pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2091,7 +2091,7 @@ public final class CollisionUtil {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((entity == null && otherEntity.canBeCollidedWith(entity)) || (entity != null && entity.canCollideWith(otherEntity))) {
|
if ((entity == null && otherEntity.canBeCollidedWith()) || (entity != null && entity.canCollideWith(otherEntity))) {
|
||||||
if (checkOnly) {
|
if (checkOnly) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ accessible method net/minecraft/server/network/PlayerChunkSender sendChunk (Lnet
|
|||||||
|
|
||||||
|
|
||||||
# ChunkStatusTasks
|
# ChunkStatusTasks
|
||||||
accessible method net/minecraft/world/level/chunk/status/ChunkStatusTasks postLoadProtoChunk (Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/storage/ValueInput$ValueInputList;)V
|
accessible method net/minecraft/world/level/chunk/status/ChunkStatusTasks postLoadProtoChunk (Lnet/minecraft/server/level/ServerLevel;Ljava/util/List;)V
|
||||||
accessible method net/minecraft/world/level/chunk/status/ChunkStatusTasks light (Lnet/minecraft/world/level/chunk/status/WorldGenContext;Lnet/minecraft/world/level/chunk/status/ChunkStep;Lnet/minecraft/util/StaticCache2D;Lnet/minecraft/world/level/chunk/ChunkAccess;)Ljava/util/concurrent/CompletableFuture;
|
accessible method net/minecraft/world/level/chunk/status/ChunkStatusTasks light (Lnet/minecraft/world/level/chunk/status/WorldGenContext;Lnet/minecraft/world/level/chunk/status/ChunkStep;Lnet/minecraft/util/StaticCache2D;Lnet/minecraft/world/level/chunk/ChunkAccess;)Ljava/util/concurrent/CompletableFuture;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@
|
|||||||
"chunk_system.TicketMixin",
|
"chunk_system.TicketMixin",
|
||||||
"chunk_system.TicketStorageMixin",
|
"chunk_system.TicketStorageMixin",
|
||||||
"chunk_system.TicketTypeMixin",
|
"chunk_system.TicketTypeMixin",
|
||||||
"chunk_system.WaypointTransmitterMixin",
|
|
||||||
"chunk_tick_iteration.ChunkMapMixin",
|
"chunk_tick_iteration.ChunkMapMixin",
|
||||||
"chunk_tick_iteration.DistanceManagerMixin",
|
"chunk_tick_iteration.DistanceManagerMixin",
|
||||||
"chunk_tick_iteration.ServerChunkCacheMixin",
|
"chunk_tick_iteration.ServerChunkCacheMixin",
|
||||||
@@ -145,5 +144,5 @@
|
|||||||
},
|
},
|
||||||
"overwrites": {
|
"overwrites": {
|
||||||
"conformVisibility": true
|
"conformVisibility": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user