Compare commits
316 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a771a3e21 | |||
| 0aa109a341 | |||
| 6d44255175 | |||
| f8bb35cb2b | |||
| 52f1aed124 | |||
| 6ae1ba1e17 | |||
| 9105f30fec | |||
| 839c849a9d | |||
| 275f507096 | |||
| 01c5a4072a | |||
| 1697707114 | |||
| 34b0b7dc31 | |||
| 691e1022e3 | |||
| 18fd157474 | |||
| 4948158fa8 | |||
| e3b972c928 | |||
| ad056cb64e | |||
| 3e22ddead5 | |||
| 5c7e27c52d | |||
| 3a5c6f12c0 | |||
| 627eee7a6d | |||
| 7c4c99089b | |||
| 00ec14d319 | |||
| 56188bc7d2 | |||
| 9b2429d388 | |||
| 2aa68ec41d | |||
| 13c9f95750 | |||
| b0549cecff | |||
| 95fb4a0e6a | |||
| 2a3aadc2fa | |||
| 52bddca0df | |||
| 606dede9ef | |||
| e8c9d8391a | |||
| 88ca223bbc | |||
| 4a51bbc796 | |||
| 94ca0e2729 | |||
| 5befdbcddc | |||
| 3e02d7f9dc | |||
| 48b38d9285 | |||
| 8c7c787a8f | |||
| fc0cf56b48 | |||
| 32c63ae15b | |||
| bbf62f7ee3 | |||
| 6211542708 | |||
| a2d5e8cdb3 | |||
| 692b304898 | |||
| 0ca93e311c | |||
| c7aab012ae | |||
| 80ccab21da | |||
| 663ce3cde6 | |||
| 43fee18ae4 | |||
| 014310631e | |||
| 4f7e934c98 | |||
| 563dcd7de6 | |||
| 0a5cc734de | |||
| 0da158fecc | |||
| a7e8bbaf6a | |||
| 80732943c8 | |||
| 994c86d5ba | |||
| 18ccbbbb8e | |||
| 31c3fb9a1e | |||
| 8bdb383b2e | |||
| d13ec687ed | |||
| 43069703cd | |||
| 6d76ace604 | |||
| 9b139575e7 | |||
| efb9129edf | |||
| 6a380f6a7b | |||
| 0798ca01c5 | |||
| 8bfc1430c8 | |||
| bd6621183d | |||
| ccc8076c66 | |||
| 004103551f | |||
| ea47e11ecf | |||
| 8a3837b04b | |||
| edfeaa618b | |||
| 961cdbe868 | |||
| ff6ab67b69 | |||
| c01fb4a716 | |||
| 8bd524791f | |||
| 26059d5656 | |||
| 3f23281e8d | |||
| fb25423deb | |||
| 6928c8dc28 | |||
| 7dfe0e4c50 | |||
| 1429ae5434 | |||
| 3fb4d5a233 | |||
| 872226e5c5 | |||
| fb46820b1f | |||
| a786678bcb | |||
| 0d35a3ea8e | |||
| 6f87e22048 | |||
| 7c07c1e5bd | |||
| 4ddb9659f5 | |||
| e74b8c89ba | |||
| 1b536e4aef | |||
| 335f11acd3 | |||
| b55b560cce | |||
| d87a152052 | |||
| db5a9c7c84 | |||
| 2508efdd91 | |||
| 4852720e14 | |||
| f39d156b11 | |||
| e21eb61335 | |||
| c49f385e3c | |||
| 0584b0e593 | |||
| 220ac89ad8 | |||
| e8e56b66a3 | |||
| 634d8a5b52 | |||
| b621c9fb8d | |||
| 696f84a064 | |||
| 5c13ff8960 | |||
| e102cd78cd | |||
| c5a782acba | |||
| 2008ea2b0c | |||
| 0f349461d9 | |||
| baf464aa02 | |||
| 51d83d803a | |||
| 2b3244159b | |||
| 9255c22d0e | |||
| 4d573c4aea | |||
| a59f359133 | |||
| c83d02c30c | |||
| d01573b03e | |||
| b1fb74539f | |||
| 40962ec9ba | |||
| 0515ac2919 | |||
| 8072695391 | |||
| 2c140bf7d7 | |||
| d3e88b40f4 | |||
| 5e0e15777c | |||
| b57fc5c9aa | |||
| 91ea68075e | |||
| 0840ec8b00 | |||
| d9f37ad7d6 | |||
| 992a7129e5 | |||
| 1d5ea329de | |||
| 00d0a0d2fc | |||
| 95d4314982 | |||
| b588b937ea | |||
| f524ad027e | |||
| b3111b9548 | |||
| 6c38cb3dee | |||
| d75b2dfc1c | |||
| a5b44d65c6 | |||
| 7a1c61405c | |||
| bcb8794d30 | |||
| f9775b115e | |||
| a56a2c2ba3 | |||
| b2efb33a5b | |||
| 5928cfe4b4 | |||
| 234204590f | |||
| e3838c560a | |||
| 6cbc9db1d8 | |||
| 127dcfcb46 | |||
| d1abdd822d | |||
| 85b7ccb38e | |||
| fc157b738e | |||
| 977afffe98 | |||
| 180b22f21a | |||
| d0330ad62f | |||
| 4d22b18f3c | |||
| df797b240e | |||
| a50ef86302 | |||
| 4aede27d75 | |||
| e616c63ebe | |||
| 03ec333a26 | |||
| 27446965db | |||
| c6d7313225 | |||
| 160912a17a | |||
| d408aacbc8 | |||
| 4889287e69 | |||
| 6acdfabb7f | |||
| 3c01d00772 | |||
| 736bb022d2 | |||
| e92130d6cc | |||
| a44dfa92a6 | |||
| 4c8ee862e5 | |||
| 73b89fe573 | |||
| fed2600dbe | |||
| 1d7d94cfec | |||
| 5577261774 | |||
| bf0f3131a0 | |||
| 1b98ea59d7 | |||
| c38efd9d6b | |||
| 4889119061 | |||
| accb2d6af3 | |||
| 24b426a17b | |||
| 8c1bccb430 | |||
| 3cb2a70f4d | |||
| a313cb3db1 | |||
| c29c6d1870 | |||
| b4a64b0c3d | |||
| 1439ca5c08 | |||
| 97ad3bc78f | |||
| b59d8cff8d | |||
| 0e93aa4aea | |||
| 28f8099777 | |||
| c83b0ae533 | |||
| 5ceeebe567 | |||
| e8db9803be | |||
| f009fd41ab | |||
| 9faa3b0a54 | |||
| 0e70478dd3 | |||
| 309b6c6013 | |||
| f20af18b62 | |||
| 7d3329fd98 | |||
| 9a880c3ab1 | |||
| 0b247f04b4 | |||
| 7f1d664731 | |||
| a2288d740b | |||
| 958f0347a3 | |||
| 859bb2e34e | |||
| a2acd08e0d | |||
| b986583fc4 | |||
| c6355f96a6 | |||
| 723d171746 | |||
| 63098d8519 | |||
| 44b743267b | |||
| 720155c408 | |||
| 334b487e23 | |||
| 6e674f3732 | |||
| d130a602d6 | |||
| 8d1ff02937 | |||
| 15b1603e35 | |||
| 4ad0a22db7 | |||
| 35bc1df32c | |||
| bb2a1158c2 | |||
| 76f6f6f746 | |||
| 3b771b5300 | |||
| 9497918e06 | |||
| e52c5d5c67 | |||
| 1ce4750dfc | |||
| 2b371340ff | |||
| e8d906b407 | |||
| 572973c69a | |||
| 9f2d6b9c78 | |||
| 54277040e9 | |||
| bbe333fab7 | |||
| 37fed5a924 | |||
| 5fc29334cd | |||
| 9d32e92e0a | |||
| b08ee76a00 | |||
| 2a4cc6e63d | |||
| 6b2560f98b | |||
| 08111d8874 | |||
| 80f48cd5a4 | |||
| 40cd6c1386 | |||
| e9a13dffb8 | |||
| 22680baad7 | |||
| cca480e5d8 | |||
| 249c3423d9 | |||
| 15cb6468d9 | |||
| f24019d648 | |||
| 733d03c630 | |||
| c3e84648f1 | |||
| 76c33b6b58 | |||
| 26a947ea13 | |||
| 91334c0e5c | |||
| 172b05aeac | |||
| b84e5ca265 | |||
| 20ef5a10fc | |||
| 33640fd35d | |||
| e5f7c5728f | |||
| 5a9bbf9829 | |||
| 23ca022ee9 | |||
| 6c80165523 | |||
| d598061fa7 | |||
| 02498aa189 | |||
| d535f6aa57 | |||
| 933753a38a | |||
| 5483cdbc51 | |||
| 1ea62fd5ec | |||
| aaf0361c50 | |||
| a08feebde0 | |||
| f7131fd2ca | |||
| 2100f4a6fe | |||
| 996f097b9d | |||
| 2e1d737268 | |||
| d374870fb7 | |||
| 5c303df32c | |||
| dfc4b51e89 | |||
| 765202d582 | |||
| 0d2e5adbed | |||
| 68e9d64779 | |||
| b64b44f301 | |||
| 8c07bb37f3 | |||
| c1f6c2dbbd | |||
| 2eb1c16837 | |||
| e5fb8477d3 | |||
| 428cacd262 | |||
| 76926d38db | |||
| 9fec679b03 | |||
| 853a1d1490 | |||
| 01273e31bc | |||
| ebb4808bdc | |||
| fd09adb1a7 | |||
| 82b7b439a4 | |||
| f1b3ae120b | |||
| 70ee20e817 | |||
| f713d65f9c | |||
| c2b98ef694 | |||
| 140c9f6a50 | |||
| c704d61d03 | |||
| aae484fbdf | |||
| a546a97e34 | |||
| 3ca9d98c05 | |||
| 460b73e35c | |||
| 8901a191d9 | |||
| 1bbe35c9f1 | |||
| f92e957826 | |||
| 636e6736a3 | |||
| 8e29f65815 | |||
| a9309078f3 | |||
| 9692e978de | |||
| 914372b858 |
+2
-2
@@ -538,7 +538,7 @@ ij_groovy_wrap_chain_calls_after_dot = false
|
||||
ij_groovy_wrap_long_lines = false
|
||||
|
||||
[{*.har,*.json,*.png.mcmeta,mcmod.info,pack.mcmeta}]
|
||||
indent_size = 4
|
||||
indent_size = 2
|
||||
ij_json_array_wrapping = split_into_lines
|
||||
ij_json_keep_blank_lines_in_code = 0
|
||||
ij_json_keep_indents_on_empty_lines = false
|
||||
@@ -688,7 +688,7 @@ ij_markdown_wrap_text_inside_blockquotes = true
|
||||
ij_toml_keep_indents_on_empty_lines = false
|
||||
|
||||
[{*.yaml,*.yml}]
|
||||
indent_size = 4
|
||||
indent_size = 2
|
||||
ij_yaml_align_values_properties = do_not_align
|
||||
ij_yaml_autoinsert_sequence_marker = true
|
||||
ij_yaml_block_mapping_on_new_line = false
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ variables:
|
||||
.build_java:
|
||||
#image: eclipse-temurin:17
|
||||
cache:
|
||||
key: "gradleCache"
|
||||
key: "gradleCache_$CI_JOB_NAME_SLUG"
|
||||
policy: pull-push
|
||||
paths:
|
||||
- .gradle
|
||||
@@ -68,7 +68,7 @@ build:
|
||||
extends: .build_java
|
||||
|
||||
|
||||
api:
|
||||
.api:
|
||||
stage: api
|
||||
needs: []
|
||||
script:
|
||||
@@ -92,7 +92,7 @@ api:
|
||||
|
||||
|
||||
# generate and publish API javadocs
|
||||
pages:
|
||||
.pages:
|
||||
stage: pages
|
||||
needs: []
|
||||
script:
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
[submodule "coreSubProjects"]
|
||||
path = coreSubProjects
|
||||
url = https://gitlab.com/jeseibel/distant-horizons-core.git
|
||||
url = https://gitlab.com/jeseibel/distant-horizons-core.git
|
||||
+17
-17
@@ -27,8 +27,8 @@ def writeBuildGradlePredefine(List<String> mcVers, int mcIndex)
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("# DON'T TOUCH THIS FILE, This is handled by the build script\n");
|
||||
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < mcVers.size(); i++)
|
||||
{
|
||||
String verStr = mcVers[i].replace(".", "_");
|
||||
@@ -104,7 +104,7 @@ subprojects { p ->
|
||||
apply plugin: "com.github.johnrengelman.shadow"
|
||||
if (isMinecraftSubProject)
|
||||
apply plugin: "systems.manifold.manifold-gradle-plugin"
|
||||
|
||||
|
||||
// Apply forge's loom
|
||||
if ((findProject(":forge") && p == project(":forge")) ||
|
||||
(findProject(":neoforge") && p == project(":neoforge"))
|
||||
@@ -118,7 +118,7 @@ subprojects { p ->
|
||||
manifold {
|
||||
manifoldVersion = rootProject.manifold_version
|
||||
}
|
||||
|
||||
|
||||
|
||||
// set up custom configurations (configurations are a way to handle dependencies)
|
||||
configurations {
|
||||
@@ -191,7 +191,7 @@ subprojects { p ->
|
||||
forgeShadowMe("org.joml:joml:${rootProject.joml_version}")
|
||||
else
|
||||
implementation("org.joml:joml:${rootProject.joml_version}")
|
||||
|
||||
|
||||
// JUnit tests
|
||||
implementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
implementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
||||
@@ -201,22 +201,22 @@ subprojects { p ->
|
||||
// Note: MC 1.16 uses 8.2.1, and versions after use 8.5.12
|
||||
// We cannot relocate this library since we call some MC classes that reference it
|
||||
implementation("it.unimi.dsi:fastutil:${rootProject.fastutil_version}")
|
||||
|
||||
|
||||
|
||||
|
||||
// Compression
|
||||
forgeShadowMe("org.lz4:lz4-java:${rootProject.lz4_version}") // LZ4
|
||||
forgeShadowMe("org.tukaani:xz:${rootProject.xz_version}") // LZMA
|
||||
|
||||
// Sqlite Database
|
||||
forgeShadowMe("org.xerial:sqlite-jdbc:${rootProject.sqlite_jdbc_version}")
|
||||
|
||||
|
||||
// NightConfig (includes Toml & Json)
|
||||
forgeShadowMe("com.electronwill.night-config:toml:${rootProject.nightconfig_version}")
|
||||
forgeShadowMe("com.electronwill.night-config:json:${rootProject.nightconfig_version}")
|
||||
|
||||
// SVG (not needed atm)
|
||||
// forgeShadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}")
|
||||
|
||||
|
||||
// Netty
|
||||
implementation("io.netty:netty-buffer:${rootProject.netty_version}")
|
||||
|
||||
@@ -276,7 +276,7 @@ subprojects { p ->
|
||||
if (isMinecraftSubProject && p != project(":common")) {
|
||||
configurations.push(project.configurations.shadowCommon) // Shadow the common subproject
|
||||
relocate "com.seibel.distanthorizons.common", "loaderCommon.${p.name}.com.seibel.distanthorizons.common" // Move the loader files to a different location
|
||||
|
||||
|
||||
if (findProject(":fabricLike") && p != project(":fabricLike")) {
|
||||
configurations.push(project.configurations.shadowFabricLike) // Shadow the fabricLike subproject
|
||||
relocate "com.seibel.distanthorizons.fabriclike", "loaderCommon.${p.name}.com.seibel.distanthorizons.fabriclike" // Move the loader files to a different location
|
||||
@@ -290,11 +290,11 @@ subprojects { p ->
|
||||
|
||||
// Compression (LZ4)
|
||||
relocate "net.jpountz", "${librariesLocation}.jpountz"
|
||||
|
||||
|
||||
// Sqlite Database
|
||||
//At the moment, there is a bug in this library which doesnt allow it to be relocated
|
||||
// relocate "org.sqlite", "${librariesLocation}.sqlite"
|
||||
|
||||
|
||||
// JOML
|
||||
if (project.hasProperty("embed_joml") && embed_joml == "true")
|
||||
relocate "org.joml", "${librariesLocation}.joml"
|
||||
@@ -304,7 +304,7 @@ subprojects { p ->
|
||||
|
||||
// SVG (not needed atm)
|
||||
// relocate "com.kitfox.svg", "${librariesLocation}.kitfox.svg"
|
||||
|
||||
|
||||
// Netty
|
||||
// Don't relocate, it causes problems with using MC's FriendlyByteBufs
|
||||
// relocate "io.netty", "${librariesLocation}.netty"
|
||||
@@ -329,7 +329,7 @@ subprojects { p ->
|
||||
"META-INF/neoforge.mods.toml",
|
||||
|
||||
// The mixins for each of the loaders
|
||||
"DistantHorizons."+ p.name +".fabricLike.mixins.json"
|
||||
"DistantHorizons." + p.name + ".fabricLike.mixins.json"
|
||||
]
|
||||
def intoTargets = ["$buildDir/resources/main/"] // Location of the built resources folder
|
||||
|
||||
@@ -388,14 +388,14 @@ subprojects { p ->
|
||||
fabric_incompatibility_list : fabric_incompatibility_list,
|
||||
fabric_recommend_list : fabric_recommend_list,
|
||||
]
|
||||
|
||||
|
||||
// replace any properties in the sub-projects with the values defined here
|
||||
inputs.properties replaceProperties
|
||||
replaceProperties.put "project", project
|
||||
filesMatching(resourceTargets) {
|
||||
expand replaceProperties
|
||||
}
|
||||
|
||||
|
||||
intoTargets.each { target ->
|
||||
if (file(target).exists()) {
|
||||
copy {
|
||||
@@ -639,4 +639,4 @@ task cleanMergedJars() {
|
||||
}
|
||||
}
|
||||
// add cleanMergedJars to the end of the "clean" task
|
||||
tasks["clean"].finalizedBy(cleanMergedJars)
|
||||
tasks["clean"].finalizedBy(cleanMergedJars)
|
||||
+3
-4
@@ -5,7 +5,6 @@
|
||||
|
||||
echo ==================== Note: All build jars will be in the folder called 'buildAllJars' ====================
|
||||
mkdir buildAllJars
|
||||
del buildAllJars/*
|
||||
|
||||
@rem Loop trough everything in the version properties folder
|
||||
for %%f in (versionProperties\*) do (
|
||||
@@ -14,11 +13,11 @@ for %%f in (versionProperties\*) do (
|
||||
|
||||
@rem Clean out the folders, build it, and merge it
|
||||
echo ==================== Cleaning workspace to build !version! ====================
|
||||
call .\gradlew.bat clean -PmcVer="!version!"
|
||||
call .\gradlew.bat clean -PmcVer="!version!" --no-daemon
|
||||
echo ==================== Building !version! ====================
|
||||
call .\gradlew.bat build -PmcVer="!version!"
|
||||
call .\gradlew.bat build -PmcVer="!version!" --no-daemon
|
||||
echo ==================== Merging !version! ====================
|
||||
call .\gradlew.bat mergeJars -PmcVer="!version!"
|
||||
call .\gradlew.bat mergeJars -PmcVer="!version!" --no-daemon
|
||||
echo ==================== Moving jar ====================
|
||||
move Merged\*.jar buildAllJars\
|
||||
)
|
||||
|
||||
+8
-10
@@ -1,11 +1,10 @@
|
||||
// TODO can this be removed?
|
||||
//buildscript {
|
||||
// configurations.configureEach {
|
||||
// resolutionStrategy {
|
||||
// force 'org.spongepowered:vanillagradle:0.2.1-20240507.024226-82'
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
buildscript {
|
||||
configurations.configureEach {
|
||||
resolutionStrategy {
|
||||
force 'org.spongepowered:vanillagradle:0.2.1-20240507.024226-82'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// temporary fix for broken spongepowered version
|
||||
buildscript {
|
||||
@@ -43,5 +42,4 @@ publishing {
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+23
-24
@@ -8,7 +8,7 @@ import com.mojang.brigadier.context.CommandContext;
|
||||
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent;
|
||||
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeDhInitEvent;
|
||||
import com.seibel.distanthorizons.common.wrappers.DependencySetup;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftServerWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftDedicatedServerWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
|
||||
import com.seibel.distanthorizons.core.api.internal.SharedApi;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
@@ -20,9 +20,11 @@ import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.ModJarInfo;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.network.messages.MessageRegistry;
|
||||
import com.seibel.distanthorizons.core.network.messages.base.CodecCrashMessage;
|
||||
import com.seibel.distanthorizons.core.util.objects.Pair;
|
||||
import com.seibel.distanthorizons.core.world.DhServerWorld;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker;
|
||||
import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector;
|
||||
@@ -42,7 +44,7 @@ import java.util.function.Supplier;
|
||||
|
||||
import static com.mojang.brigadier.arguments.DoubleArgumentType.doubleArg;
|
||||
import static com.mojang.brigadier.arguments.IntegerArgumentType.integer;
|
||||
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE;
|
||||
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_ENABLE_CODEC_CRASH_MESSAGE;
|
||||
import static net.minecraft.commands.Commands.argument;
|
||||
import static net.minecraft.commands.Commands.literal;
|
||||
|
||||
@@ -93,7 +95,7 @@ public abstract class AbstractModInitializer
|
||||
ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeDhInitEvent.class, null);
|
||||
|
||||
this.startup();
|
||||
this.logBuildInfo();
|
||||
this.printModInfo();
|
||||
|
||||
this.createClientProxy().registerEvents();
|
||||
this.createServerProxy(false).registerEvents();
|
||||
@@ -117,7 +119,7 @@ public abstract class AbstractModInitializer
|
||||
ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeDhInitEvent.class, null);
|
||||
|
||||
this.startup();
|
||||
this.logBuildInfo();
|
||||
this.printModInfo();
|
||||
|
||||
// This prevents returning uninitialized Config values,
|
||||
// resulting from a circular reference mid-initialization in a static class
|
||||
@@ -135,7 +137,7 @@ public abstract class AbstractModInitializer
|
||||
|
||||
this.subscribeServerStartingEvent(server ->
|
||||
{
|
||||
MinecraftServerWrapper.INSTANCE.dedicatedServer = (DedicatedServer)server;
|
||||
MinecraftDedicatedServerWrapper.INSTANCE.dedicatedServer = (DedicatedServer)server;
|
||||
|
||||
this.initConfig();
|
||||
this.postInit();
|
||||
@@ -158,17 +160,14 @@ public abstract class AbstractModInitializer
|
||||
this.createInitialBindings();
|
||||
}
|
||||
|
||||
private void logBuildInfo()
|
||||
private void printModInfo()
|
||||
{
|
||||
LOGGER.info(ModInfo.READABLE_NAME + ", Version: " + ModInfo.VERSION);
|
||||
|
||||
// if the build is stable the branch/commit/etc shouldn't be needed
|
||||
if (ModInfo.IS_DEV_BUILD)
|
||||
{
|
||||
LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch);
|
||||
LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit);
|
||||
LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source);
|
||||
}
|
||||
// Useful for dev builds
|
||||
LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch);
|
||||
LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit);
|
||||
LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source);
|
||||
}
|
||||
|
||||
protected <T extends IModAccessor> void tryCreateModCompatAccessor(String modId, Class<? super T> accessorClass, Supplier<T> accessorConstructor)
|
||||
@@ -216,10 +215,10 @@ public abstract class AbstractModInitializer
|
||||
Function<
|
||||
Function<CommandContext<CommandSourceStack>, Object>,
|
||||
Command<CommandSourceStack>
|
||||
> makeConfigUpdater = (getter) -> (commandContext) -> {
|
||||
Object value = getter.apply(commandContext);
|
||||
> makeConfigUpdater = getter -> c -> {
|
||||
Object value = getter.apply(c);
|
||||
|
||||
commandContext.getSource().sendSuccess(
|
||||
c.getSource().sendSuccess(
|
||||
#if MC_VER >= MC_1_20_1
|
||||
() -> Component.literal("Changed the value of "+configEntry.getServersideShortName()+" to "+value),
|
||||
#elif MC_VER >= MC_1_19_2
|
||||
@@ -233,13 +232,13 @@ public abstract class AbstractModInitializer
|
||||
};
|
||||
|
||||
LiteralArgumentBuilder<CommandSourceStack> subcommand = literal(configEntry.getServersideShortName())
|
||||
.executes((commandContext) -> {
|
||||
.executes(c -> {
|
||||
#if MC_VER >= MC_1_20_1
|
||||
commandContext.getSource().sendSuccess(() -> Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
c.getSource().sendSuccess(() -> Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
#elif MC_VER >= MC_1_19_2
|
||||
commandContext.getSource().sendSuccess(Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
c.getSource().sendSuccess(Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
#else // < 1.19.2
|
||||
commandContext.getSource().sendSuccess(new TranslatableComponent("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
c.getSource().sendSuccess(new TranslatableComponent("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
|
||||
#endif
|
||||
return 1;
|
||||
});
|
||||
@@ -293,7 +292,7 @@ public abstract class AbstractModInitializer
|
||||
|
||||
this.commandDispatcher.register(builder);
|
||||
|
||||
if (DEBUG_CODEC_CRASH_MESSAGE)
|
||||
if (DEBUG_ENABLE_CODEC_CRASH_MESSAGE)
|
||||
{
|
||||
LiteralArgumentBuilder<CommandSourceStack> dhcrash = literal("dhcrash")
|
||||
.requires(source -> source.hasPermission(4))
|
||||
@@ -306,7 +305,7 @@ public abstract class AbstractModInitializer
|
||||
#else
|
||||
.getConnectedPlayer(ServerPlayerWrapper.getWrapper(Objects.requireNonNull(c.getSource().getPlayerOrException())))
|
||||
#endif
|
||||
.networkSession.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.ENCODE));
|
||||
.session.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.ENCODE));
|
||||
return 1;
|
||||
}))
|
||||
.then(literal("decode")
|
||||
@@ -318,7 +317,7 @@ public abstract class AbstractModInitializer
|
||||
#else
|
||||
.getConnectedPlayer(ServerPlayerWrapper.getWrapper(Objects.requireNonNull(c.getSource().getPlayerOrException())))
|
||||
#endif
|
||||
.networkSession.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.DECODE));
|
||||
.session.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.DECODE));
|
||||
return 1;
|
||||
}));
|
||||
this.commandDispatcher.register(dhcrash);
|
||||
@@ -336,4 +335,4 @@ public abstract class AbstractModInitializer
|
||||
void registerEvents();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+17
-16
@@ -2,10 +2,10 @@ package com.seibel.distanthorizons.common;
|
||||
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.logging.ConfigBasedLogger;
|
||||
import com.seibel.distanthorizons.core.network.event.internal.IncompatibleMessageInternalEvent;
|
||||
import com.seibel.distanthorizons.core.network.event.internal.ProtocolErrorInternalEvent;
|
||||
import com.seibel.distanthorizons.core.network.event.internal.IncompatibleMessageEvent;
|
||||
import com.seibel.distanthorizons.core.network.event.internal.ProtocolErrorEvent;
|
||||
import com.seibel.distanthorizons.core.network.messages.MessageRegistry;
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.base.CloseReasonMessage;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
|
||||
@@ -33,18 +33,19 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
|
||||
|
||||
|
||||
@Override
|
||||
public final void sendToClient(IServerPlayerWrapper serverPlayer, AbstractNetworkMessage message)
|
||||
public final void sendPluginPacketServer(IServerPlayerWrapper serverPlayer, NetworkMessage message)
|
||||
{
|
||||
this.sendToClient((ServerPlayer) serverPlayer.getWrappedMcObject(), message);
|
||||
this.sendPluginPacketServer((ServerPlayer) serverPlayer.getWrappedMcObject(), message);
|
||||
}
|
||||
public abstract void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message);
|
||||
|
||||
@Override
|
||||
public abstract void sendToServer(AbstractNetworkMessage message);
|
||||
public abstract void sendPluginPacketClient(NetworkMessage message);
|
||||
public abstract void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message);
|
||||
|
||||
public static AbstractNetworkMessage decodeMessage(FriendlyByteBuf in)
|
||||
@Nullable
|
||||
public static NetworkMessage decodeMessage(FriendlyByteBuf in)
|
||||
{
|
||||
AbstractNetworkMessage message = null;
|
||||
NetworkMessage message = null;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -53,7 +54,7 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
|
||||
int protocolVersion = in.readShort();
|
||||
if (protocolVersion != ModInfo.PROTOCOL_VERSION)
|
||||
{
|
||||
return new IncompatibleMessageInternalEvent(protocolVersion);
|
||||
return new IncompatibleMessageEvent(protocolVersion);
|
||||
}
|
||||
|
||||
message = MessageRegistry.INSTANCE.createMessage(in.readUnsignedShort());
|
||||
@@ -71,10 +72,10 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
|
||||
in.resetReaderIndex();
|
||||
|
||||
LOGGER.error("Failed to decode message", e);
|
||||
LOGGER.error("Buffer: ["+in+"]");
|
||||
LOGGER.error("Buffer contents: ["+ByteBufUtil.hexDump(in)+"]");
|
||||
LOGGER.error("Buffer: {}", in);
|
||||
LOGGER.error("Buffer contents: [{}]", ByteBufUtil.hexDump(in));
|
||||
|
||||
return new ProtocolErrorInternalEvent(e, message, true);
|
||||
return new ProtocolErrorEvent(e, message, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -83,7 +84,7 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
|
||||
}
|
||||
}
|
||||
|
||||
public static void encodeMessage(FriendlyByteBuf out, AbstractNetworkMessage message)
|
||||
public static void encodeMessage(FriendlyByteBuf out, NetworkMessage message)
|
||||
{
|
||||
// This is intentionally unhandled, because errors related to this are unlikely to appear in wild
|
||||
Objects.requireNonNull(message);
|
||||
@@ -98,9 +99,9 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.error("Failed to encode message", e);
|
||||
LOGGER.error("Message: ["+message+"]");
|
||||
LOGGER.error("Message: {}", message);
|
||||
|
||||
message.getSession().tryHandleMessage(new ProtocolErrorInternalEvent(e, message, false));
|
||||
message.getSession().tryHandleMessage(new ProtocolErrorEvent(e, message, false));
|
||||
|
||||
// Encode close reason message instead
|
||||
out.resetWriterIndex();
|
||||
|
||||
@@ -2,20 +2,25 @@ package com.seibel.distanthorizons.common;
|
||||
|
||||
#if MC_VER >= MC_1_20_6
|
||||
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public record CommonPacketPayload(@Nullable AbstractNetworkMessage message) implements CustomPacketPayload
|
||||
public record CommonPacketPayload(
|
||||
@Nullable NetworkMessage message
|
||||
) implements CustomPacketPayload
|
||||
{
|
||||
public static final Type<CommonPacketPayload> TYPE = new Type<>(AbstractPluginPacketSender.WRAPPER_PACKET_RESOURCE);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() { return TYPE; }
|
||||
public Type<? extends CustomPacketPayload> type()
|
||||
{
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
|
||||
public static class Codec implements StreamCodec<FriendlyByteBuf, CommonPacketPayload>
|
||||
@@ -23,11 +28,15 @@ public record CommonPacketPayload(@Nullable AbstractNetworkMessage message) impl
|
||||
@NotNull
|
||||
@Override
|
||||
public CommonPacketPayload decode(@NotNull FriendlyByteBuf in)
|
||||
{ return new CommonPacketPayload(AbstractPluginPacketSender.decodeMessage(in)); }
|
||||
{
|
||||
return new CommonPacketPayload(AbstractPluginPacketSender.decodeMessage(in));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encode(@NotNull FriendlyByteBuf out, CommonPacketPayload payload)
|
||||
{ AbstractPluginPacketSender.encodeMessage(out, payload.message()); }
|
||||
{
|
||||
AbstractPluginPacketSender.encodeMessage(out, payload.message());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.common.wrappers;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.ClassicConfigGUI;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.LangWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.level.KeyedClientLevelManager;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftServerWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftDedicatedServerWrapper;
|
||||
import com.seibel.distanthorizons.core.level.IKeyedClientLevelManager;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.config.IConfigGui;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.config.ILangWrapper;
|
||||
@@ -60,7 +60,7 @@ public class DependencySetup
|
||||
//@Environment(EnvType.SERVER)
|
||||
public static void createServerBindings()
|
||||
{
|
||||
SingletonInjector.INSTANCE.bind(IMinecraftSharedWrapper.class, MinecraftServerWrapper.INSTANCE);
|
||||
SingletonInjector.INSTANCE.bind(IMinecraftSharedWrapper.class, MinecraftDedicatedServerWrapper.INSTANCE);
|
||||
}
|
||||
|
||||
//@Environment(EnvType.CLIENT)
|
||||
|
||||
+2
-23
@@ -133,26 +133,6 @@ public class BlockStateWrapper implements IBlockStateWrapper
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be faster than {@link BlockStateWrapper#fromBlockState(BlockState, ILevelWrapper)}
|
||||
* in cases where the same block state is expected to be referenced multiple times.
|
||||
*/
|
||||
public static BlockStateWrapper fromBlockState(BlockState blockState, ILevelWrapper levelWrapper, IBlockStateWrapper guess)
|
||||
{
|
||||
BlockState guessBlockState = (guess == null || guess.isAir()) ? null : (BlockState) guess.getWrappedMcObject();
|
||||
BlockState inputBlockState = (blockState == null || blockState.isAir()) ? null : blockState;
|
||||
|
||||
if (guess instanceof BlockStateWrapper guessWrapper
|
||||
&& guessBlockState == inputBlockState)
|
||||
{
|
||||
return guessWrapper;
|
||||
}
|
||||
else
|
||||
{
|
||||
return fromBlockState(blockState, levelWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
private BlockStateWrapper(BlockState blockState, ILevelWrapper levelWrapper)
|
||||
{
|
||||
this.blockState = blockState;
|
||||
@@ -561,8 +541,7 @@ public class BlockStateWrapper implements IBlockStateWrapper
|
||||
{
|
||||
|
||||
#if MC_VER > MC_1_17_1
|
||||
LodUtil.assertTrue(levelWrapper != null && levelWrapper.getWrappedMcObject() != null);
|
||||
Level level = (Level)levelWrapper.getWrappedMcObject();
|
||||
Level level = (Level)Objects.requireNonNull(levelWrapper.getWrappedMcObject());
|
||||
#endif
|
||||
|
||||
Block block;
|
||||
@@ -777,4 +756,4 @@ public class BlockStateWrapper implements IBlockStateWrapper
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+159
-28
@@ -21,7 +21,6 @@ package com.seibel.distanthorizons.common.wrappers.chunk;
|
||||
|
||||
import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.MutableBlockPosWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.DhLitWorldGenRegion;
|
||||
import com.seibel.distanthorizons.core.api.internal.SharedApi;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
@@ -32,7 +31,6 @@ import com.seibel.distanthorizons.core.world.EWorldEnvironment;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.ChunkLightStorage;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IMutableBlockPosWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
@@ -89,7 +87,6 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
|
||||
/** can be used for interactions with the underlying chunk where creating new BlockPos objects could cause issues for the garbage collector. */
|
||||
private static final ThreadLocal<BlockPos.MutableBlockPos> MUTABLE_BLOCK_POS_REF = ThreadLocal.withInitial(() -> new BlockPos.MutableBlockPos());
|
||||
private static final ThreadLocal<MutableBlockPosWrapper> MUTABLE_BLOCK_POS_WRAPPER_REF = ThreadLocal.withInitial(() -> new MutableBlockPosWrapper());
|
||||
|
||||
|
||||
private final ChunkAccess chunk;
|
||||
@@ -97,8 +94,7 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
private final LevelReader lightSource;
|
||||
private final ILevelWrapper wrappedLevel;
|
||||
|
||||
private boolean isDhBlockLightCorrect = false;
|
||||
private boolean isDhSkyLightCorrect = false;
|
||||
private boolean isDhLightCorrect = false;
|
||||
/** only used when connected to a dedicated server */
|
||||
private boolean isMcClientLightingCorrect = false;
|
||||
|
||||
@@ -107,9 +103,26 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
|
||||
private ArrayList<DhBlockPos> blockLightPosList = null;
|
||||
|
||||
private boolean useDhLighting;
|
||||
|
||||
private int minNonEmptyHeight = Integer.MIN_VALUE;
|
||||
private int maxNonEmptyHeight = Integer.MAX_VALUE;
|
||||
|
||||
private int blockBiomeHashCode = 0;
|
||||
|
||||
/**
|
||||
* Due to vanilla `isClientLightReady()` not being designed for use by a non-render thread, it may return 'true'
|
||||
* before the light engine has ticked, (right after all light changes is marked by the engine to be processed).
|
||||
* To fix this, on client-only mode, we mixin-redirect the `isClientLightReady()` so that after the call, it will
|
||||
* trigger a synchronous update of this flag here on all chunks that are wrapped. <br><br>
|
||||
*
|
||||
* Note: Using a static weak hash map to store the chunks that need to be updated, as instance of chunk wrapper
|
||||
* can be duplicated, with same chunk instance. And the data stored here are all temporary, and thus will not be
|
||||
* visible when a chunk is re-wrapped later. <br>
|
||||
* (Also, thread safety done via a reader writer lock)
|
||||
*/
|
||||
private static final ConcurrentLinkedQueue<ChunkWrapper> chunksNeedingClientLightUpdating = new ConcurrentLinkedQueue<>();
|
||||
|
||||
|
||||
|
||||
//=============//
|
||||
@@ -123,6 +136,15 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
this.wrappedLevel = wrappedLevel;
|
||||
this.chunkPos = new DhChunkPos(chunk.getPos().x, chunk.getPos().z);
|
||||
|
||||
// TODO is this the best way to differentiate between when we are generating chunks and when MC gave us a chunk?
|
||||
boolean isDhGeneratedChunk = (this.lightSource.getClass() == DhLitWorldGenRegion.class);
|
||||
// MC loaded chunks should get their lighting from MC, DH generated chunks should get their lighting from DH
|
||||
this.useDhLighting = isDhGeneratedChunk;
|
||||
|
||||
// FIXME +1 is to handle the fact that LodDataBuilder adds +1 to all block lighting calculations, also done in the relative position validator
|
||||
|
||||
if (SharedApi.getEnvironment() != EWorldEnvironment.Server_Only)
|
||||
chunksNeedingClientLightUpdating.add(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -279,22 +301,6 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(blockPos), this.wrappedLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockStateWrapper getBlockState(int relX, int relY, int relZ, IMutableBlockPosWrapper mcBlockPos, IBlockStateWrapper guess)
|
||||
{
|
||||
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, relY, relZ);
|
||||
|
||||
BlockPos.MutableBlockPos pos = (BlockPos.MutableBlockPos)mcBlockPos.getWrappedMcObject();
|
||||
pos.setX(relX);
|
||||
pos.setY(relY);
|
||||
pos.setZ(relZ);
|
||||
|
||||
return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(pos), this.wrappedLevel, guess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMutableBlockPosWrapper getMutableBlockPosWrapper() { return MUTABLE_BLOCK_POS_WRAPPER_REF.get(); }
|
||||
|
||||
@Override
|
||||
public DhChunkPos getChunkPos() { return this.chunkPos; }
|
||||
|
||||
@@ -325,15 +331,45 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
// lighting //
|
||||
//==========//
|
||||
|
||||
@Override
|
||||
public void setIsDhSkyLightCorrect(boolean isDhLightCorrect) { this.isDhSkyLightCorrect = isDhLightCorrect; }
|
||||
@Override
|
||||
public void setIsDhBlockLightCorrect(boolean isDhLightCorrect) { this.isDhBlockLightCorrect = isDhLightCorrect; }
|
||||
@Override
|
||||
public void setIsDhLightCorrect(boolean isDhLightCorrect) { this.isDhLightCorrect = isDhLightCorrect; }
|
||||
|
||||
@Override
|
||||
public boolean isDhBlockLightingCorrect() { return this.isDhBlockLightCorrect; }
|
||||
public void setUseDhLighting(boolean useDhLighting) { this.useDhLighting = useDhLighting; }
|
||||
|
||||
@Override
|
||||
public boolean isDhSkyLightCorrect() { return this.isDhSkyLightCorrect; }
|
||||
public boolean isLightCorrect()
|
||||
{
|
||||
if (this.useDhLighting)
|
||||
{
|
||||
return this.isDhLightCorrect;
|
||||
}
|
||||
|
||||
|
||||
#if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
|
||||
return false; // MC's lighting engine doesn't work consistently enough to trust for 1.16 or 1.17
|
||||
#else
|
||||
if (this.chunk instanceof LevelChunk)
|
||||
{
|
||||
LevelChunk levelChunk = (LevelChunk) this.chunk;
|
||||
if (levelChunk.getLevel().isClientSide())
|
||||
{
|
||||
// connected to a server
|
||||
return this.isMcClientLightingCorrect;
|
||||
}
|
||||
else
|
||||
{
|
||||
// in a single player world
|
||||
return this.chunk.isLightCorrect() && levelChunk.loaded;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// called when in a single player world and the chunk is a proto chunk (in world gen, and not active)
|
||||
return this.chunk.isLightCorrect();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -388,6 +424,44 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
public void setSkyLightStorage(ChunkLightStorage lightStorage) { this.skyLightStorage = lightStorage; }
|
||||
|
||||
|
||||
@Override
|
||||
public int getBlockLight(int relX, int y, int relZ)
|
||||
{
|
||||
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, y, relZ);
|
||||
|
||||
// use the full lighting engine when the chunks are within render distance or the config requests it
|
||||
if (this.useDhLighting)
|
||||
{
|
||||
// DH lighting method
|
||||
return this.getBlockLightStorage().get(relX, y, relZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// note: this returns 0 if the chunk is unload
|
||||
|
||||
// MC lighting method
|
||||
return this.lightSource.getBrightness(LightLayer.BLOCK, new BlockPos(relX + this.getMinBlockX(), y, relZ + this.getMinBlockZ()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSkyLight(int relX, int y, int relZ)
|
||||
{
|
||||
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, y, relZ);
|
||||
|
||||
// use the full lighting engine when the chunks are within render distance or the config requests it
|
||||
if (this.useDhLighting)
|
||||
{
|
||||
// DH lighting method
|
||||
return this.getSkyLightStorage().get(relX, y, relZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// MC lighting method
|
||||
return this.lightSource.getBrightness(LightLayer.SKY, new BlockPos(relX + this.getMinBlockX(), y, relZ + this.getMinBlockZ()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FIXME synchronized is necessary for a rare issue where this method is called from two separate threads at the same time
|
||||
* before the list has finished populating.
|
||||
@@ -423,6 +497,63 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
return this.blockLightPosList;
|
||||
}
|
||||
|
||||
public static void syncedUpdateClientLightStatus()
|
||||
{
|
||||
#if MC_VER < MC_1_18_2
|
||||
// TODO: Check what to do in 1.18.1 and older
|
||||
|
||||
// since we don't currently handle this list,
|
||||
// clear it to prevent memory leaks
|
||||
chunksNeedingClientLightUpdating.clear();
|
||||
|
||||
#else
|
||||
|
||||
// update the chunks client lighting
|
||||
ChunkWrapper chunkWrapper = chunksNeedingClientLightUpdating.poll();
|
||||
while (chunkWrapper != null)
|
||||
{
|
||||
chunkWrapper.updateIsClientLightingCorrect();
|
||||
chunkWrapper = chunksNeedingClientLightUpdating.poll();
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
/** Should be called after client light updates are triggered. */
|
||||
private void updateIsClientLightingCorrect()
|
||||
{
|
||||
if (this.chunk instanceof LevelChunk && ((LevelChunk) this.chunk).getLevel() instanceof ClientLevel)
|
||||
{
|
||||
LevelChunk levelChunk = (LevelChunk) this.chunk;
|
||||
ClientChunkCache clientChunkCache = ((ClientLevel) levelChunk.getLevel()).getChunkSource();
|
||||
this.isMcClientLightingCorrect = clientChunkCache.getChunkForLighting(this.chunk.getPos().x, this.chunk.getPos().z) != null &&
|
||||
#if MC_VER <= MC_1_17_1
|
||||
levelChunk.isLightCorrect();
|
||||
#elif MC_VER < MC_1_20_1
|
||||
levelChunk.isClientLightReady();
|
||||
#else
|
||||
checkLightSectionsOnChunk(levelChunk, levelChunk.getLevel().getLightEngine());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if MC_VER >= MC_1_20_1
|
||||
private static boolean checkLightSectionsOnChunk(LevelChunk chunk, LevelLightEngine engine)
|
||||
{
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
int minY = chunk.getMinSection();
|
||||
int maxY = chunk.getMaxSection();
|
||||
for (int y = minY; y < maxY; ++y)
|
||||
{
|
||||
LevelChunkSection section = sections[chunk.getSectionIndexFromSectionY(y)];
|
||||
if (section.hasOnlyAir()) continue;
|
||||
if (!engine.lightOnInSection(SectionPos.of(chunk.getPos(), y)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//===============//
|
||||
@@ -478,4 +609,4 @@ public class ChunkWrapper implements IChunkWrapper
|
||||
// return this.blockBiomeHashCode;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
+22
-3
@@ -13,6 +13,7 @@ public class KeyedClientLevelManager implements IKeyedClientLevelManager
|
||||
/** This is set and managed by the ClientApi for servers with support for DH. */
|
||||
@Nullable
|
||||
private IServerKeyedClientLevel serverKeyedLevel = null;
|
||||
private boolean enabled = false;
|
||||
|
||||
|
||||
|
||||
@@ -28,21 +29,39 @@ public class KeyedClientLevelManager implements IKeyedClientLevelManager
|
||||
// level override logic //
|
||||
//======================//
|
||||
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public IServerKeyedClientLevel getServerKeyedLevel() { return this.serverKeyedLevel; }
|
||||
public IServerKeyedClientLevel getServerKeyedLevel()
|
||||
{
|
||||
return this.serverKeyedLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IServerKeyedClientLevel setServerKeyedLevel(IClientLevelWrapper clientLevel, String levelKey)
|
||||
{
|
||||
IServerKeyedClientLevel keyedLevel = new ServerKeyedClientLevel((ClientLevel) clientLevel.getWrappedMcObject(), levelKey);
|
||||
this.serverKeyedLevel = keyedLevel;
|
||||
this.enabled = true;
|
||||
return keyedLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearKeyedLevel() { this.serverKeyedLevel = null; }
|
||||
public void clearServerKeyedLevel()
|
||||
{
|
||||
this.serverKeyedLevel = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLevelSet() { return this.serverKeyedLevel != null; }
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable()
|
||||
{
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -18,7 +18,11 @@ public class ServerKeyedClientLevel extends ClientLevelWrapper implements IServe
|
||||
@Override
|
||||
public String getServerLevelKey() { return this.serverLevelKey; }
|
||||
|
||||
|
||||
@Override
|
||||
public String getDimensionName() { return this.getServerLevelKey(); }
|
||||
public String getDimensionName()
|
||||
{
|
||||
return this.getServerLevelKey();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+11
-4
@@ -54,6 +54,7 @@ import net.minecraft.network.chat.TextComponent;
|
||||
#endif
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -221,11 +222,14 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IClientLevelWrapper getWrappedClientLevel() { return this.getWrappedClientLevel(false); }
|
||||
public IClientLevelWrapper getWrappedClientLevel()
|
||||
{
|
||||
return this.getWrappedClientLevel(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public IClientLevelWrapper getWrappedClientLevel(boolean bypassLevelKeyManager)
|
||||
public IClientLevelWrapper getWrappedClientLevel(boolean bypassMultiverse)
|
||||
{
|
||||
ClientLevel level = MINECRAFT.level;
|
||||
if (level == null)
|
||||
@@ -233,7 +237,7 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
|
||||
return null;
|
||||
}
|
||||
|
||||
return ClientLevelWrapper.getWrapper(level, bypassLevelKeyManager);
|
||||
return ClientLevelWrapper.getWrapper(level, bypassMultiverse);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -316,6 +320,9 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
|
||||
public void executeOnRenderThread(Runnable runnable) { MINECRAFT.execute(runnable); }
|
||||
|
||||
@Override
|
||||
public boolean isWorldNew() { throw new UnsupportedOperationException("Not Implemented"); }
|
||||
public boolean isWorldInitialized()
|
||||
{
|
||||
throw new NotImplementedException("TODO");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+9
-22
@@ -6,34 +6,19 @@ import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import java.io.File;
|
||||
|
||||
//@Environment(EnvType.SERVER)
|
||||
public class MinecraftServerWrapper implements IMinecraftSharedWrapper
|
||||
public class MinecraftDedicatedServerWrapper implements IMinecraftSharedWrapper
|
||||
{
|
||||
public static final MinecraftServerWrapper INSTANCE = new MinecraftServerWrapper();
|
||||
|
||||
public static final MinecraftDedicatedServerWrapper INSTANCE = new MinecraftDedicatedServerWrapper();
|
||||
private MinecraftDedicatedServerWrapper() { }
|
||||
public DedicatedServer dedicatedServer = null;
|
||||
|
||||
|
||||
//=============//
|
||||
// constructor //
|
||||
//=============//
|
||||
|
||||
private MinecraftServerWrapper() { }
|
||||
|
||||
|
||||
|
||||
//=========//
|
||||
// methods //
|
||||
//=========//
|
||||
|
||||
@Override
|
||||
public boolean isDedicatedServer() { return true; }
|
||||
|
||||
@Override
|
||||
public File getInstallationDirectory()
|
||||
{
|
||||
if (this.dedicatedServer == null)
|
||||
{
|
||||
throw new IllegalStateException("Trying to get Installation Direction before Dedicated server completed initialization!");
|
||||
throw new IllegalStateException("Trying to get Installation Direction before Dedicated server complete initialization!");
|
||||
}
|
||||
|
||||
#if MC_VER < MC_1_21_1
|
||||
@@ -44,7 +29,9 @@ public class MinecraftServerWrapper implements IMinecraftSharedWrapper
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorldNew()
|
||||
{ return this.dedicatedServer.getWorldData().overworldData().isInitialized(); }
|
||||
public boolean isWorldInitialized()
|
||||
{
|
||||
return this.dedicatedServer.getWorldData().overworldData().isInitialized();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-4
@@ -8,8 +8,4 @@ public interface IMixinServerPlayer
|
||||
@Nullable
|
||||
ServerLevel distantHorizons$getDimensionChangeDestination();
|
||||
|
||||
#if MC_VER == MC_1_16_5
|
||||
void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.seibel.distanthorizons.common.wrappers.misc;
|
||||
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IMutableBlockPosWrapper;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
public class MutableBlockPosWrapper implements IMutableBlockPosWrapper
|
||||
{
|
||||
public final BlockPos.MutableBlockPos pos;
|
||||
|
||||
|
||||
|
||||
//=============//
|
||||
// constructor //
|
||||
//=============//
|
||||
|
||||
public MutableBlockPosWrapper()
|
||||
{
|
||||
this.pos = new BlockPos.MutableBlockPos();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===========//
|
||||
// overrides //
|
||||
//===========//
|
||||
|
||||
@Override
|
||||
public Object getWrappedMcObject() { return this.pos; }
|
||||
|
||||
}
|
||||
+48
-43
@@ -15,7 +15,7 @@ import java.net.SocketAddress;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* This wrapper transparently ensures that the underlying {@link ServerPlayer} is always valid,
|
||||
* This wrapper transparently ensures that underlying {@link ServerPlayer} is always valid,
|
||||
* unless the player has disconnected.
|
||||
*/
|
||||
public class ServerPlayerWrapper implements IServerPlayerWrapper
|
||||
@@ -23,39 +23,38 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper
|
||||
private static final ConcurrentMap<ServerGamePacketListenerImpl, ServerPlayerWrapper> serverPlayerWrapperMap = new MapMaker().weakKeys().weakValues().makeMap();
|
||||
|
||||
private final ServerGamePacketListenerImpl connection;
|
||||
private ServerPlayer serverPlayer()
|
||||
{
|
||||
return this.connection.player;
|
||||
}
|
||||
|
||||
public static ServerPlayerWrapper getWrapper(ServerPlayer serverPlayer)
|
||||
{
|
||||
return serverPlayerWrapperMap.computeIfAbsent(serverPlayer.connection, ignored -> new ServerPlayerWrapper(serverPlayer.connection));
|
||||
}
|
||||
|
||||
private ServerPlayerWrapper(ServerGamePacketListenerImpl connection)
|
||||
{
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
//=============//
|
||||
// constructor //
|
||||
//=============//
|
||||
|
||||
public static ServerPlayerWrapper getWrapper(ServerPlayer serverPlayer)
|
||||
{ return serverPlayerWrapperMap.computeIfAbsent(serverPlayer.connection, ignored -> new ServerPlayerWrapper(serverPlayer.connection)); }
|
||||
|
||||
private ServerPlayerWrapper(ServerGamePacketListenerImpl connection) { this.connection = connection; }
|
||||
|
||||
|
||||
|
||||
//=========//
|
||||
// getters //
|
||||
//=========//
|
||||
|
||||
private ServerPlayer getServerPlayer() { return this.connection.player; }
|
||||
|
||||
@Override
|
||||
public String getName() { return this.getServerPlayer().getName().getString(); }
|
||||
public String getName()
|
||||
{
|
||||
return this.serverPlayer().getName().getString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IServerLevelWrapper getLevel()
|
||||
{
|
||||
ServerLevel level = ((IMixinServerPlayer) this.getServerPlayer()).distantHorizons$getDimensionChangeDestination();
|
||||
ServerLevel level = ((IMixinServerPlayer) this.serverPlayer()).distantHorizons$getDimensionChangeDestination();
|
||||
if (level == null)
|
||||
{
|
||||
#if MC_VER < MC_1_20_1
|
||||
level = this.getServerPlayer().getLevel();
|
||||
level = this.serverPlayer().getLevel();
|
||||
#else
|
||||
level = this.getServerPlayer().serverLevel();
|
||||
level = this.serverPlayer().serverLevel();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,51 +64,57 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper
|
||||
@Override
|
||||
public Vec3d getPosition()
|
||||
{
|
||||
Vec3 position = this.getServerPlayer().position();
|
||||
Vec3 position = this.serverPlayer().position();
|
||||
return new Vec3d(position.x, position.y, position.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getViewDistance() { return this.getServerPlayer().server.getPlayerList().getViewDistance(); }
|
||||
public int getViewDistance()
|
||||
{
|
||||
return this.serverPlayer().server.getPlayerList().getViewDistance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketAddress getRemoteAddress()
|
||||
{
|
||||
#if MC_VER >= MC_1_19_4
|
||||
return this.getServerPlayer().connection.getRemoteAddress();
|
||||
return this.serverPlayer().connection.getRemoteAddress();
|
||||
#else // < 1.19.4
|
||||
return this.getServerPlayer().connection.connection.getRemoteAddress();
|
||||
return this.serverPlayer().connection.connection.getRemoteAddress();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//================//
|
||||
// base overrides //
|
||||
//================//
|
||||
|
||||
@Override
|
||||
public Object getWrappedMcObject() { return this.getServerPlayer(); }
|
||||
|
||||
@Override
|
||||
public String toString() { return "Wrapped{" + this.getServerPlayer() + "}"; }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
public Object getWrappedMcObject()
|
||||
{
|
||||
if (this == obj)
|
||||
return this.serverPlayer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Wrapped{" + this.serverPlayer() + "}";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ServerPlayerWrapper))
|
||||
if (!(o instanceof ServerPlayerWrapper))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ServerPlayerWrapper that = (ServerPlayerWrapper) obj;
|
||||
ServerPlayerWrapper that = (ServerPlayerWrapper) o;
|
||||
return Objects.equal(this.connection, that.connection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() { return Objects.hashCode(this.connection); }
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hashCode(this.connection);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+9
-3
@@ -70,7 +70,10 @@ public class ClientLevelWrapper implements IClientLevelWrapper
|
||||
// wrapper logic //
|
||||
//===============//
|
||||
|
||||
public static IClientLevelWrapper getWrapper(@NotNull ClientLevel level) { return getWrapper(level, false); }
|
||||
public static IClientLevelWrapper getWrapper(@NotNull ClientLevel level)
|
||||
{
|
||||
return getWrapper(level, false);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IClientLevelWrapper getWrapper(@Nullable ClientLevel level, boolean bypassLevelKeyManager)
|
||||
@@ -186,7 +189,10 @@ public class ClientLevelWrapper implements IClientLevelWrapper
|
||||
|
||||
|
||||
@Override
|
||||
public String getDimensionName() { return this.level.dimension().location().toString(); }
|
||||
public String getDimensionName()
|
||||
{
|
||||
return this.level.dimension().location().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EDhApiLevelType getLevelType() { return EDhApiLevelType.CLIENT_LEVEL; }
|
||||
@@ -299,4 +305,4 @@ public class ClientLevelWrapper implements IClientLevelWrapper
|
||||
return "Wrapped{" + this.level.toString() + "@" + this.getDimensionName() + "}";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+10
-4
@@ -65,11 +65,11 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
|
||||
|
||||
private String getDimensionName()
|
||||
{
|
||||
#if MC_VER <= MC_1_16_5
|
||||
#if MC_VER >= MC_1_17_1
|
||||
return this.dimensionType.effectsLocation().getPath();
|
||||
#else // < 1.17.1
|
||||
// effectsLocation() is marked as client only, so using the backing field directly
|
||||
return dimensionType.effectsLocation.getPath();
|
||||
#else
|
||||
return this.dimensionType.effectsLocation().getPath();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -91,6 +91,12 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
|
||||
return this.dimensionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTeleportationScale(IDimensionTypeWrapper to)
|
||||
{
|
||||
return DimensionType.getTeleportationScale(this.dimensionType, (DimensionType) to.getWrappedMcObject());
|
||||
}
|
||||
|
||||
// there's definitely a better way of doing this, but it should work well enough for now
|
||||
@Override
|
||||
public boolean isTheEnd() { return this.getDimensionName().equalsIgnoreCase("the_end"); }
|
||||
@@ -110,4 +116,4 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+29
-10
@@ -81,27 +81,48 @@ public class ServerLevelWrapper implements IServerLevelWrapper
|
||||
//=========//
|
||||
|
||||
@Override
|
||||
public File getSaveFolder() { return this.level.getChunkSource().getDataStorage().dataFolder; }
|
||||
public File getSaveFolder()
|
||||
{
|
||||
return this.level.getChunkSource().getDataStorage().dataFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionTypeWrapper getDimensionType() { return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType()); }
|
||||
public DimensionTypeWrapper getDimensionType()
|
||||
{
|
||||
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDimensionName() { return this.level.dimension().location().toString(); }
|
||||
public String getDimensionName()
|
||||
{
|
||||
return this.level.dimension().location().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EDhApiLevelType getLevelType() { return EDhApiLevelType.SERVER_LEVEL; }
|
||||
|
||||
public ServerLevel getLevel() { return this.level; }
|
||||
public ServerLevel getLevel()
|
||||
{
|
||||
return this.level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCeiling() { return this.level.dimensionType().hasCeiling(); }
|
||||
public boolean hasCeiling()
|
||||
{
|
||||
return this.level.dimensionType().hasCeiling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSkyLight() { return this.level.dimensionType().hasSkyLight(); }
|
||||
public boolean hasSkyLight()
|
||||
{
|
||||
return this.level.dimensionType().hasSkyLight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() { return this.level.getHeight(); }
|
||||
public int getMaxHeight()
|
||||
{
|
||||
return this.level.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinHeight()
|
||||
@@ -120,13 +141,11 @@ public class ServerLevelWrapper implements IServerLevelWrapper
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ChunkAccess chunk = this.level.getChunk(pos.getX(), pos.getZ(), ChunkStatus.FULL, false);
|
||||
if (chunk == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ChunkWrapper(chunk, this.level, this);
|
||||
}
|
||||
|
||||
@@ -180,4 +199,4 @@ public class ServerLevelWrapper implements IServerLevelWrapper
|
||||
@Override
|
||||
public String toString() { return "Wrapped{" + this.level.toString() + "@" + this.getDimensionName() + "}"; }
|
||||
|
||||
}
|
||||
}
|
||||
+23
-24
@@ -134,7 +134,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
{
|
||||
for (int i = 0; i < 11; i++)
|
||||
{
|
||||
this.times.add(new Rolling(SIZE));
|
||||
times.add(new Rolling(SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,25 +144,19 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
{
|
||||
String name = e.name;
|
||||
int index = Arrays.asList(TIME_NAMES).indexOf(name);
|
||||
if (index == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
this.times.get(index).add(e.timeNs);
|
||||
if (index == -1) continue;
|
||||
times.get(index).add(e.timeNs);
|
||||
}
|
||||
this.times.get(0).add(event.getTotalTimeNs());
|
||||
times.get(0).add(event.getTotalTimeNs());
|
||||
}
|
||||
|
||||
@Override public String toString()
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < this.times.size(); i++)
|
||||
for (int i = 0; i < times.size(); i++)
|
||||
{
|
||||
if (this.times.get(i).getAverage() == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sb.append(TIME_NAMES[i]).append(": ").append(this.times.get(i).getAverage()).append("\n");
|
||||
if (times.get(i).getAverage() == 0) continue;
|
||||
sb.append(TIME_NAMES[i]).append(": ").append(times.get(i).getAverage()).append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -192,13 +186,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
|
||||
public RegionFileStorageExternalCache getOrCreateRegionFileCache(RegionFileStorage storage)
|
||||
{
|
||||
RegionFileStorageExternalCache cache = this.regionFileStorageCacheRef.get();
|
||||
RegionFileStorageExternalCache cache = regionFileStorageCacheRef.get();
|
||||
if (cache == null)
|
||||
{
|
||||
cache = new RegionFileStorageExternalCache(storage);
|
||||
if (!this.regionFileStorageCacheRef.compareAndSet(null, cache))
|
||||
if (!regionFileStorageCacheRef.compareAndSet(null, cache))
|
||||
{
|
||||
cache = this.regionFileStorageCacheRef.get();
|
||||
cache = regionFileStorageCacheRef.get();
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
@@ -310,17 +304,17 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
|
||||
public <T> T joinSync(CompletableFuture<T> future)
|
||||
{
|
||||
if (!this.unsafeThreadingRecorded && !future.isDone())
|
||||
if (!unsafeThreadingRecorded && !future.isDone())
|
||||
{
|
||||
EVENT_LOGGER.error("Unsafe MultiThreading in Chunk Generator: ", new RuntimeException("Concurrent future"));
|
||||
EVENT_LOGGER.error("To increase stability, it is recommended to set world generation threads count to 1.");
|
||||
this.unsafeThreadingRecorded = true;
|
||||
unsafeThreadingRecorded = true;
|
||||
}
|
||||
|
||||
return future.join();
|
||||
}
|
||||
|
||||
@Override public void updateAllFutures()
|
||||
public void updateAllFutures()
|
||||
{
|
||||
if (this.unknownExceptionCount > 0)
|
||||
{
|
||||
@@ -494,8 +488,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
{
|
||||
chunkWrapper.setBlockLightStorage(chunkBlockLightingByDhPos.get(chunkWrapper.getChunkPos()));
|
||||
chunkWrapper.setSkyLightStorage(chunkSkyLightingByDhPos.get(chunkWrapper.getChunkPos()));
|
||||
chunkWrapper.setIsDhBlockLightCorrect(true);
|
||||
chunkWrapper.setIsDhSkyLightCorrect(true);
|
||||
chunkWrapper.setUseDhLighting(true);
|
||||
chunkWrapper.setIsDhLightCorrect(true);
|
||||
}
|
||||
|
||||
chunkWrappersByDhPos.put(chunkPos, chunkWrapper);
|
||||
@@ -537,6 +531,11 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!wrappedChunk.isLightCorrect())
|
||||
{
|
||||
throw new RuntimeException("The generated chunk somehow has isLightCorrect() returning false");
|
||||
}
|
||||
|
||||
boolean isFull = ChunkWrapper.getStatus(target) == ChunkStatus.FULL || target instanceof LevelChunk;
|
||||
#if MC_VER >= MC_1_18_2
|
||||
boolean isPartial = target.isOldNoiseGeneration();
|
||||
@@ -824,9 +823,9 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
Heightmap.primeHeightmaps(((ChunkWrapper)centerChunk).getChunk(), ChunkStatus.FEATURES.heightmapsAfter());
|
||||
|
||||
// pre-generated chunks should have lighting but new ones won't
|
||||
if (!centerChunk.isDhBlockLightingCorrect())
|
||||
if (!centerChunk.isLightCorrect())
|
||||
{
|
||||
DhLightingEngine.INSTANCE.bakeChunkBlockLighting(centerChunk, iChunkWrapperList, maxSkyLight);
|
||||
DhLightingEngine.INSTANCE.lightChunk(centerChunk, iChunkWrapperList, maxSkyLight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 5b746a9534...7cd1a37914
+6
-3
@@ -5,14 +5,17 @@ plugins {
|
||||
loom {
|
||||
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")
|
||||
|
||||
// Custom logging
|
||||
log4jConfigs.from(file("log4j-dev.xml"))
|
||||
|
||||
// "runs" isn't required, but when we do need it then it can be useful
|
||||
runs {
|
||||
client {
|
||||
client()
|
||||
setConfigName("Fabric Client")
|
||||
ideConfigGenerated(true) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
|
||||
ideConfigGenerated(true)
|
||||
runDir("../run/client")
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced")
|
||||
programArgs("--username", "Dev")
|
||||
}
|
||||
server {
|
||||
@@ -157,4 +160,4 @@ sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration name="Dev" monitorInterval="10">
|
||||
<Loggers>
|
||||
<Logger name="com.seibel.distanthorizons.core.network" level="trace" additivity="false">
|
||||
<AppenderRef ref="DebugFile" level="${sys:fabric.log.debug.level:-debug}" />
|
||||
<AppenderRef ref="SysOut" />
|
||||
<AppenderRef ref="LatestFile" level="${sys:fabric.log.level:-info}" />
|
||||
<AppenderRef ref="ServerGuiConsole" />
|
||||
</Logger>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -52,7 +52,7 @@ import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import com.seibel.distanthorizons.common.CommonPacketPayload;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
#else
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
#endif
|
||||
|
||||
#if MC_VER < MC_1_19_4
|
||||
@@ -268,7 +268,7 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
||||
{
|
||||
// Forge packet ID
|
||||
buffer.readByte();
|
||||
AbstractNetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
|
||||
NetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
|
||||
if (message != null)
|
||||
{
|
||||
ClientApi.INSTANCE.pluginMessageReceived(message);
|
||||
@@ -313,4 +313,4 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
||||
this.previouslyPressKeyCodes = currentKeyDown;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -119,12 +119,9 @@ public class FabricMain extends AbstractModInitializer implements ClientModIniti
|
||||
@Override
|
||||
protected void subscribeRegisterCommandsEvent(Consumer<CommandDispatcher<CommandSourceStack>> eventHandler)
|
||||
{
|
||||
CommandRegistrationCallback.EVENT.register(
|
||||
(dispatcher, registryAccess #if MC_VER >= MC_1_19_2 , environment #endif ) ->
|
||||
{
|
||||
eventHandler.accept(dispatcher);
|
||||
}
|
||||
);
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess #if MC_VER >= MC_1_19_2 , environment #endif ) -> {
|
||||
eventHandler.accept(dispatcher);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,4 +157,4 @@ public class FabricMain extends AbstractModInitializer implements ClientModIniti
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package com.seibel.distanthorizons.fabric;
|
||||
|
||||
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.network.FriendlyByteBuf;
|
||||
public class FabricPluginPacketSender extends AbstractPluginPacketSender
|
||||
{
|
||||
@Override
|
||||
public void sendToServer(AbstractNetworkMessage message)
|
||||
public void sendPluginPacketClient(NetworkMessage message)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_6
|
||||
ClientPlayNetworking.send(new CommonPacketPayload(message));
|
||||
@@ -30,7 +30,7 @@ public class FabricPluginPacketSender extends AbstractPluginPacketSender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
|
||||
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_6
|
||||
ServerPlayNetworking.send(serverPlayer, new CommonPacketPayload(message));
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import com.seibel.distanthorizons.common.CommonPacketPayload;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
#else
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
|
||||
#endif
|
||||
|
||||
@@ -50,26 +50,21 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
|
||||
private static final ServerApi SERVER_API = ServerApi.INSTANCE;
|
||||
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
|
||||
|
||||
private final boolean isDedicatedServer;
|
||||
private final boolean isDedicated;
|
||||
public static Supplier<Boolean> isGenerationThreadChecker = null;
|
||||
|
||||
|
||||
|
||||
//=============//
|
||||
// constructor //
|
||||
//=============//
|
||||
|
||||
public FabricServerProxy(boolean isDedicatedServer)
|
||||
public FabricServerProxy(boolean isDedicated)
|
||||
{
|
||||
this.isDedicatedServer = isDedicatedServer;
|
||||
this.isDedicated = isDedicated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO rename
|
||||
private boolean isValidTime()
|
||||
{
|
||||
if (this.isDedicatedServer)
|
||||
if (this.isDedicated)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -108,7 +103,7 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
|
||||
{
|
||||
if (this.isValidTime())
|
||||
{
|
||||
ServerApi.INSTANCE.serverLoadEvent(this.isDedicatedServer);
|
||||
ServerApi.INSTANCE.serverLoadEvent(this.isDedicated);
|
||||
}
|
||||
});
|
||||
// ServerWorldUnloadEvent
|
||||
@@ -164,19 +159,19 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
|
||||
ServerApi.INSTANCE.serverPlayerDisconnectEvent(this.getServerPlayerWrapper(handler.player));
|
||||
}
|
||||
});
|
||||
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.register((player, originLevel, destinationLevel) ->
|
||||
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.register((player, origin, dest) ->
|
||||
{
|
||||
if (this.isValidTime())
|
||||
{
|
||||
ServerApi.INSTANCE.serverPlayerLevelChangeEvent(
|
||||
this.getServerPlayerWrapper(player),
|
||||
this.getServerLevelWrapper(originLevel),
|
||||
this.getServerLevelWrapper(destinationLevel)
|
||||
this.getServerLevelWrapper(origin),
|
||||
this.getServerLevelWrapper(dest)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (this.isDedicatedServer)
|
||||
if (this.isDedicated)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_6
|
||||
PayloadTypeRegistry.playC2S().register(CommonPacketPayload.TYPE, new CommonPacketPayload.Codec());
|
||||
@@ -194,7 +189,7 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
|
||||
{
|
||||
// Forge packet ID
|
||||
buffer.readByte();
|
||||
AbstractNetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
|
||||
NetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
|
||||
if (message != null)
|
||||
{
|
||||
ServerApi.INSTANCE.pluginMessageReceived(ServerPlayerWrapper.getWrapper(serverPlayer), message);
|
||||
@@ -204,4 +199,4 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -65,4 +65,4 @@ public class MixinClientLevel
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -44,4 +44,4 @@ public class MixinClientPacketListener
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -131,4 +131,22 @@ public class MixinLevelRenderer
|
||||
}
|
||||
}
|
||||
|
||||
#if MC_VER < MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif MC_VER < MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif MC_VER < MC_1_20_6
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -130,16 +130,14 @@ public abstract class MixinMinecraft
|
||||
{
|
||||
ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(this.lastLevel));
|
||||
}
|
||||
|
||||
if (level != null)
|
||||
{
|
||||
ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(level, true));
|
||||
}
|
||||
|
||||
this.lastLevel = level;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "close()V")
|
||||
public void close(CallbackInfo ci) { SelfUpdater.onClose(); }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#if MC_VER == MC_1_16_5
|
||||
package com.seibel.distanthorizons.fabric.mixins.server;
|
||||
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.IMixinServerPlayer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public class MixinEntity
|
||||
{
|
||||
@Inject(at = @At("TAIL"), method = "setLevel")
|
||||
public void setLevel(Level level, CallbackInfo ci)
|
||||
{
|
||||
if (this instanceof IMixinServerPlayer)
|
||||
{
|
||||
((IMixinServerPlayer) this).distantHorizons$setDimensionChangeDestination((ServerLevel) level);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
package com.seibel.distanthorizons.fabric.mixins.server;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public class MixinEntity
|
||||
{
|
||||
}
|
||||
#endif
|
||||
+13
-12
@@ -46,31 +46,32 @@ public class MixinServerPlayer implements IMixinServerPlayer
|
||||
@Override
|
||||
@Nullable
|
||||
public ServerLevel distantHorizons$getDimensionChangeDestination()
|
||||
{ return this.dimensionChangeDestination; }
|
||||
|
||||
#if MC_VER == MC_1_16_5
|
||||
@Override
|
||||
public void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination)
|
||||
{ this.dimensionChangeDestination = dimensionChangeDestination; }
|
||||
#endif
|
||||
{
|
||||
return this.dimensionChangeDestination;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "changeDimension")
|
||||
#if MC_VER >= MC_1_21_1
|
||||
public void changeDimension(DimensionTransition dimensionTransition, CallbackInfoReturnable<Entity> cir)
|
||||
{ this.dimensionChangeDestination = dimensionTransition.newLevel(); }
|
||||
{
|
||||
this.dimensionChangeDestination = dimensionTransition.newLevel();
|
||||
}
|
||||
#else
|
||||
public void changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> cir)
|
||||
{ this.dimensionChangeDestination = destination; }
|
||||
{
|
||||
this.dimensionChangeDestination = destination;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MC_VER >= MC_1_20_1
|
||||
@Inject(at = @At("RETURN"), method = "setServerLevel")
|
||||
public void setServerLevel(ServerLevel level, CallbackInfo ci)
|
||||
{ this.dimensionChangeDestination = null; }
|
||||
#elif MC_VER >= MC_1_17_1
|
||||
#else
|
||||
@Inject(at = @At("RETURN"), method = "setLevel")
|
||||
public void setLevel(ServerLevel level, CallbackInfo ci)
|
||||
{ this.dimensionChangeDestination = null; }
|
||||
#endif
|
||||
{
|
||||
this.dimensionChangeDestination = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,8 +6,7 @@
|
||||
"server.MixinChunkGenerator",
|
||||
"server.MixinChunkMap",
|
||||
"server.MixinUtilBackgroundThread",
|
||||
"server.MixinServerPlayer",
|
||||
"server.MixinEntity"
|
||||
"server.MixinServerPlayer"
|
||||
],
|
||||
"client": [
|
||||
"client.MixinClientLevel",
|
||||
@@ -26,4 +25,4 @@
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"plugin": "com.seibel.distanthorizons.fabric.mixins.FabricMixinPlugin"
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -37,9 +37,9 @@ loom {
|
||||
client {
|
||||
client()
|
||||
setConfigName("Forge Client")
|
||||
ideConfigGenerated(false) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
|
||||
ideConfigGenerated(false)
|
||||
runDir("../run/client")
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced")
|
||||
programArgs("--username", "Dev")
|
||||
}
|
||||
server {
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
#endif
|
||||
{
|
||||
LOGGER.info("level load");
|
||||
|
||||
|
||||
#if MC_VER < MC_1_19_2
|
||||
LevelAccessor level = event.getWorld();
|
||||
#else
|
||||
@@ -145,7 +145,7 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
#endif
|
||||
{
|
||||
LOGGER.info("level unload");
|
||||
|
||||
|
||||
#if MC_VER < MC_1_19_2
|
||||
LevelAccessor level = event.getWorld();
|
||||
#else
|
||||
@@ -297,5 +297,4 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -153,4 +153,4 @@ public class ForgeMain extends AbstractModInitializer
|
||||
@Override
|
||||
protected void runDelayedSetup() { SingletonInjector.INSTANCE.runDelayedSetup(); }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.seibel.distanthorizons.forge;
|
||||
|
||||
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
@@ -45,11 +45,11 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
|
||||
);
|
||||
#endif
|
||||
|
||||
public static void setPacketHandler(Consumer<AbstractNetworkMessage> consumer)
|
||||
public static void setPacketHandler(Consumer<NetworkMessage> consumer)
|
||||
{
|
||||
setPacketHandler((player, message) -> consumer.accept(message));
|
||||
}
|
||||
public static void setPacketHandler(BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> consumer)
|
||||
public static void setPacketHandler(BiConsumer<IServerPlayerWrapper, NetworkMessage> consumer)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_2
|
||||
PLUGIN_CHANNEL.messageBuilder(MessageWrapper.class, 0)
|
||||
@@ -95,7 +95,7 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendToServer(AbstractNetworkMessage message)
|
||||
public void sendPluginPacketClient(NetworkMessage message)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_2
|
||||
PLUGIN_CHANNEL.send(new MessageWrapper(message), PacketDistributor.SERVER.noArg());
|
||||
@@ -105,7 +105,7 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
|
||||
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
|
||||
{
|
||||
#if MC_VER >= MC_1_20_2
|
||||
PLUGIN_CHANNEL.send(new MessageWrapper(message), PacketDistributor.PLAYER.with(serverPlayer));
|
||||
@@ -118,9 +118,12 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
|
||||
@SuppressWarnings({"ClassCanBeRecord", "RedundantSuppression"})
|
||||
public static class MessageWrapper
|
||||
{
|
||||
public final AbstractNetworkMessage message;
|
||||
public final NetworkMessage message;
|
||||
|
||||
public MessageWrapper(AbstractNetworkMessage message) { this.message = message; }
|
||||
public MessageWrapper(NetworkMessage message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -154,10 +154,14 @@ public class ForgeServerProxy implements AbstractModInitializer.IEventProxy
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event)
|
||||
{ this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event)); }
|
||||
{
|
||||
this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event));
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void playerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent event)
|
||||
{ this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event)); }
|
||||
{
|
||||
this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event));
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void playerChangedDimensionEvent(PlayerEvent.PlayerChangedDimensionEvent event)
|
||||
{
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ public class MixinClientPacketListener
|
||||
ClientApi.INSTANCE.onClientOnlyDisconnected();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+14
@@ -158,4 +158,18 @@ public class MixinLevelRenderer
|
||||
}
|
||||
}
|
||||
|
||||
#if MC_VER < MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif MC_VER < MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-1
@@ -2,6 +2,8 @@ package com.seibel.distanthorizons.forge.mixins.client;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
|
||||
import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.core.api.internal.ClientApi;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
|
||||
@@ -11,7 +13,9 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -104,4 +108,4 @@ public class MixinMinecraft
|
||||
SelfUpdater.onClose();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#if MC_VER == MC_1_16_5
|
||||
|
||||
package com.seibel.distanthorizons.forge.mixins.server;
|
||||
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.IMixinServerPlayer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public class MixinEntity
|
||||
{
|
||||
@Inject(at = @At("TAIL"), method = "setLevel")
|
||||
public void setLevel(Level level, CallbackInfo ci)
|
||||
{
|
||||
if (this instanceof IMixinServerPlayer)
|
||||
{
|
||||
((IMixinServerPlayer) this).distantHorizons$setDimensionChangeDestination((ServerLevel) level);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
package com.seibel.distanthorizons.forge.mixins.server;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public class MixinEntity
|
||||
{
|
||||
}
|
||||
#endif
|
||||
+10
-11
@@ -43,26 +43,25 @@ public class MixinServerPlayer implements IMixinServerPlayer
|
||||
@Override
|
||||
@Nullable
|
||||
public ServerLevel distantHorizons$getDimensionChangeDestination()
|
||||
{ return this.distantHorizons$dimensionChangeDestination; }
|
||||
|
||||
#if MC_VER == MC_1_16_5
|
||||
@Override
|
||||
public void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination)
|
||||
{ this.distantHorizons$dimensionChangeDestination = dimensionChangeDestination; }
|
||||
#endif
|
||||
{
|
||||
return this.distantHorizons$dimensionChangeDestination;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "changeDimension", remap = false)
|
||||
public void changeDimension(ServerLevel destination, ITeleporter teleporter, CallbackInfoReturnable<Entity> cir)
|
||||
{ this.distantHorizons$dimensionChangeDestination = destination; }
|
||||
{
|
||||
this.distantHorizons$dimensionChangeDestination = destination;
|
||||
}
|
||||
|
||||
#if MC_VER >= MC_1_20_1
|
||||
@Inject(at = @At("RETURN"), method = "setServerLevel")
|
||||
public void setServerLevel(ServerLevel level, CallbackInfo ci)
|
||||
{ this.distantHorizons$dimensionChangeDestination = null; }
|
||||
#elif MC_VER >= MC_1_17_1
|
||||
#else
|
||||
@Inject(at = @At("RETURN"), method = "setLevel")
|
||||
public void setLevel(ServerLevel level, CallbackInfo ci)
|
||||
{ this.distantHorizons$dimensionChangeDestination = null; }
|
||||
#endif
|
||||
{
|
||||
this.distantHorizons$dimensionChangeDestination = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,8 +7,7 @@
|
||||
"server.MixinChunkGenerator",
|
||||
"server.MixinTFChunkGenerator",
|
||||
"server.MixinChunkMap",
|
||||
"server.MixinServerPlayer",
|
||||
"server.MixinEntity"
|
||||
"server.MixinServerPlayer"
|
||||
],
|
||||
"client": [
|
||||
"client.MixinClientPacketListener",
|
||||
|
||||
+3
-3
@@ -5,8 +5,8 @@ org.gradle.caching=true
|
||||
|
||||
# Mod Info
|
||||
mod_name=DistantHorizons
|
||||
mod_version=2.3.0-a-dev
|
||||
api_version=4.0.0
|
||||
mod_version=2.2.2-a-dev
|
||||
api_version=3.0.0
|
||||
maven_group=com.seibel.distanthorizons
|
||||
mod_readable_name=Distant Horizons
|
||||
mod_description=This mod generates and renders simplified terrain beyond the normal view distance at a low performance cost. Allowing you to see much farther without turning your game into a slideshow.
|
||||
@@ -51,4 +51,4 @@ versionStr=
|
||||
mcVer=1.21.1
|
||||
|
||||
# Defines the maximum amount of memory Minecraft is allowed when run in a development environment
|
||||
#minecraftMemoryJavaArg="-Xmx4G"
|
||||
#minecraftMemoryJavaArg="-Xmx4G"
|
||||
@@ -29,9 +29,9 @@ loom {
|
||||
client {
|
||||
client()
|
||||
setConfigName("NeoForge Client")
|
||||
ideConfigGenerated(false) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
|
||||
ideConfigGenerated(false)
|
||||
runDir("../run/client")
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
|
||||
vmArgs("-Dio.netty.leakDetection.level=advanced")
|
||||
programArgs("--username", "Dev")
|
||||
}
|
||||
server {
|
||||
@@ -99,4 +99,4 @@ sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,10 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
|
||||
|
||||
@Override
|
||||
public void registerEvents() { NeoForge.EVENT_BUS.register(this); }
|
||||
public void registerEvents()
|
||||
{
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -281,4 +284,4 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
private static LevelAccessor GetEventLevel(LevelEvent e) { return e.getLevel(); }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,13 @@ public class NeoforgeMain extends AbstractModInitializer
|
||||
// networking //
|
||||
//============//
|
||||
public void registerNetworkingClient(RegisterPayloadHandlersEvent event)
|
||||
{ NeoforgePluginPacketSender.setPacketHandler(event, ClientApi.INSTANCE::pluginMessageReceived); }
|
||||
{
|
||||
NeoforgePluginPacketSender.setPacketHandler(event, ClientApi.INSTANCE::pluginMessageReceived);
|
||||
}
|
||||
public void registerNetworkingServer(RegisterPayloadHandlersEvent event)
|
||||
{ NeoforgePluginPacketSender.setPacketHandler(event, ServerApi.INSTANCE::pluginMessageReceived); }
|
||||
{
|
||||
NeoforgePluginPacketSender.setPacketHandler(event, ServerApi.INSTANCE::pluginMessageReceived);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -149,4 +153,4 @@ public class NeoforgeMain extends AbstractModInitializer
|
||||
@Override
|
||||
protected void runDelayedSetup() { SingletonInjector.INSTANCE.runDelayedSetup(); }
|
||||
|
||||
}
|
||||
}
|
||||
+15
-9
@@ -3,7 +3,7 @@ package com.seibel.distanthorizons.neoforge;
|
||||
import com.seibel.distanthorizons.common.CommonPacketPayload;
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
|
||||
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
|
||||
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
|
||||
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
@@ -16,11 +16,13 @@ import java.util.function.Consumer;
|
||||
|
||||
public class NeoforgePluginPacketSender extends AbstractPluginPacketSender
|
||||
{
|
||||
private static BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> packetConsumer;
|
||||
private static BiConsumer<IServerPlayerWrapper, NetworkMessage> packetConsumer;
|
||||
|
||||
public static void setPacketHandler(RegisterPayloadHandlersEvent event, Consumer<AbstractNetworkMessage> consumer)
|
||||
{ setPacketHandler(event, (player, buffer) -> consumer.accept(buffer)); }
|
||||
public static void setPacketHandler(RegisterPayloadHandlersEvent event, BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> consumer)
|
||||
public static void setPacketHandler(RegisterPayloadHandlersEvent event, Consumer<NetworkMessage> consumer)
|
||||
{
|
||||
setPacketHandler(event, (player, buffer) -> consumer.accept(buffer));
|
||||
}
|
||||
public static void setPacketHandler(RegisterPayloadHandlersEvent event, BiConsumer<IServerPlayerWrapper, NetworkMessage> consumer)
|
||||
{
|
||||
packetConsumer = consumer;
|
||||
|
||||
@@ -40,11 +42,15 @@ public class NeoforgePluginPacketSender extends AbstractPluginPacketSender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendToServer(AbstractNetworkMessage message)
|
||||
{ PacketDistributor.sendToServer(new CommonPacketPayload(message)); }
|
||||
public void sendPluginPacketClient(NetworkMessage message)
|
||||
{
|
||||
PacketDistributor.sendToServer(new CommonPacketPayload(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
|
||||
{ PacketDistributor.sendToPlayer(serverPlayer, new CommonPacketPayload(message)); }
|
||||
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
|
||||
{
|
||||
PacketDistributor.sendToPlayer(serverPlayer, new CommonPacketPayload(message));
|
||||
}
|
||||
|
||||
}
|
||||
+12
-4
@@ -129,10 +129,15 @@ public class NeoforgeServerProxy implements AbstractModInitializer.IEventProxy
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event) { this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event)); }
|
||||
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event)
|
||||
{
|
||||
this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event));
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void playerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent event)
|
||||
{ this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event)); }
|
||||
{
|
||||
this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event));
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void playerChangedDimensionEvent(PlayerEvent.PlayerChangedDimensionEvent event)
|
||||
{
|
||||
@@ -156,6 +161,9 @@ public class NeoforgeServerProxy implements AbstractModInitializer.IEventProxy
|
||||
return getServerLevelWrapper(event.getEntity().getServer().getLevel(resourceKey));
|
||||
}
|
||||
|
||||
private static ServerPlayerWrapper getServerPlayerWrapper(PlayerEvent event) { return ServerPlayerWrapper.getWrapper((ServerPlayer) event.getEntity()); }
|
||||
private static ServerPlayerWrapper getServerPlayerWrapper(PlayerEvent event)
|
||||
{
|
||||
return ServerPlayerWrapper.getWrapper((ServerPlayer) event.getEntity());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+17
@@ -142,5 +142,22 @@ public class MixinLevelRenderer
|
||||
}
|
||||
}
|
||||
|
||||
#if MC_VER < MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif MC_VER < MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif MC_VER < MC_1_20_6
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+10
-6
@@ -43,20 +43,24 @@ public class MixinServerPlayer implements IMixinServerPlayer
|
||||
@Nullable
|
||||
private ServerLevel distantHorizons$dimensionChangeDestination;
|
||||
|
||||
|
||||
@Unique
|
||||
@Override
|
||||
@Nullable
|
||||
public ServerLevel distantHorizons$getDimensionChangeDestination()
|
||||
{ return this.distantHorizons$dimensionChangeDestination; }
|
||||
public ServerLevel distantHorizons$getDimensionChangeDestination()
|
||||
{
|
||||
return this.distantHorizons$dimensionChangeDestination;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "changeDimension")
|
||||
#if MC_VER >= MC_1_21_1
|
||||
public void changeDimension(DimensionTransition dimensionTransition, CallbackInfoReturnable<Entity> cir)
|
||||
{ this.distantHorizons$dimensionChangeDestination = dimensionTransition.newLevel(); }
|
||||
{
|
||||
this.distantHorizons$dimensionChangeDestination = dimensionTransition.newLevel();
|
||||
}
|
||||
#else
|
||||
public void changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> cir)
|
||||
{ this.distantHorizons$dimensionChangeDestination = destination; }
|
||||
{
|
||||
this.distantHorizons$dimensionChangeDestination = destination;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MC_VER >= MC_1_20_1
|
||||
|
||||
Regular → Executable
@@ -24,7 +24,7 @@ fabric_api_version=0.42.0+1.16
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
|
||||
fabric_incompatibility_list={ "iris": "*" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -24,7 +24,7 @@ fabric_api_version=0.46.1+1.17
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
|
||||
fabric_incompatibility_list={ "iris": "*" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -25,7 +25,7 @@ fabric_api_version=0.76.0+1.18.2
|
||||
immersive_portals_version=v1.4.11-1.18
|
||||
canvas_version=mc118:1.0.2616
|
||||
|
||||
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
|
||||
fabric_incompatibility_list={ "iris": "*" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -24,7 +24,7 @@ fabric_api_version=0.76.1+1.19.2
|
||||
immersive_portals_version=
|
||||
canvas_version=mc119-1.0.2480
|
||||
|
||||
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
|
||||
fabric_incompatibility_list={ "iris": "*" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -23,7 +23,7 @@ fabric_api_version=0.87.1+1.19.4
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
|
||||
fabric_incompatibility_list={ "iris": "*" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -23,7 +23,7 @@ fabric_api_version=0.90.4+1.20.1
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -23,7 +23,7 @@ fabric_api_version=0.90.4+1.20.2
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -24,7 +24,7 @@ fabric_api_version=0.91.2+1.20.4
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
|
||||
@@ -24,7 +24,7 @@ fabric_api_version=0.97.8+1.20.6
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
@@ -53,4 +53,4 @@ neoforge_version=20.6.70-beta
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
enable_terrafirmacraft=0
|
||||
enable_terrafirmacraft=0
|
||||
@@ -24,7 +24,7 @@ fabric_api_version=0.100.1+1.21
|
||||
immersive_portals_version=
|
||||
canvas_version=
|
||||
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
|
||||
fabric_incompatibility_list={ "iris": "<=1.7.4" }
|
||||
fabric_recommend_list={}
|
||||
|
||||
# Fabric mod run
|
||||
@@ -53,4 +53,4 @@ neoforge_version=21.1.6
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
enable_terrafirmacraft=0
|
||||
enable_terrafirmacraft=0
|
||||
Regular → Executable
Reference in New Issue
Block a user