Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 268993e38c | |||
| 752eeeb7af | |||
| 7f57a7c794 | |||
| 5fb1915c69 | |||
| a7e2ead7fa | |||
| 21a510c023 | |||
| b3ee205f49 | |||
| e242893a92 | |||
| 48c5d32093 | |||
| a3d167a958 | |||
| 923fe0576f | |||
| 9bb1a04402 | |||
| e355fcd660 | |||
| 6c62155d36 | |||
| 2d2ea5b44f | |||
| 05dbe0f07e | |||
| e27676d06b | |||
| 89e32cd17a | |||
| 8f48d15b1f | |||
| 4af31ac5b9 | |||
| 993a9a6864 | |||
| 9c90db3718 | |||
| 4d37429c49 | |||
| e03536f315 | |||
| 6057141094 | |||
| 55f7e2cd30 |
+79
-1
@@ -3,6 +3,9 @@ image: gradle:eclipse-temurin
|
||||
|
||||
# all stages need to be defined here
|
||||
stages:
|
||||
- build_19_4
|
||||
- build_19_3
|
||||
- build_19_2
|
||||
- build_19_1
|
||||
- build_19
|
||||
- build_18_2
|
||||
@@ -162,7 +165,82 @@ build_19_1:
|
||||
- ./gradlew mergeJars -PmcVer="1.19.1" --gradle-user-home cache/;
|
||||
image: eclipse-temurin:17
|
||||
artifacts:
|
||||
name: "Merged_NightlyBuild_1_19-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
name: "Merged_NightlyBuild_1_19_1-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
paths:
|
||||
- Merged
|
||||
expire_in: 1 day
|
||||
when: always
|
||||
cache:
|
||||
key: "gradleCache"
|
||||
policy: pull-push
|
||||
paths:
|
||||
- .gradle
|
||||
- cache/
|
||||
allow_failure: true
|
||||
|
||||
# 1.19.2 build
|
||||
build_19_2:
|
||||
stage: build_19_2
|
||||
script:
|
||||
- echo "Building 1.19.2..."
|
||||
- ./gradlew deleteMerged -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew clean -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew core:build -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew build -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
- ./gradlew mergeJars -PmcVer="1.19.2" --gradle-user-home cache/;
|
||||
image: eclipse-temurin:17
|
||||
artifacts:
|
||||
name: "Merged_NightlyBuild_1_19_2-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
paths:
|
||||
- Merged
|
||||
expire_in: 1 day
|
||||
when: always
|
||||
cache:
|
||||
key: "gradleCache"
|
||||
policy: pull-push
|
||||
paths:
|
||||
- .gradle
|
||||
- cache/
|
||||
allow_failure: true
|
||||
|
||||
# 1.19.3 build
|
||||
build_19_3:
|
||||
stage: build_19_3
|
||||
script:
|
||||
- echo "Building 1.19.3..."
|
||||
- ./gradlew deleteMerged -PmcVer="1.19.3" --gradle-user-home cache/;
|
||||
- ./gradlew clean -PmcVer="1.19.3" --gradle-user-home cache/;
|
||||
- ./gradlew core:build -PmcVer="1.19.3" --gradle-user-home cache/;
|
||||
- ./gradlew build -PmcVer="1.19.3" --gradle-user-home cache/;
|
||||
- ./gradlew mergeJars -PmcVer="1.19.3" --gradle-user-home cache/;
|
||||
image: eclipse-temurin:17
|
||||
artifacts:
|
||||
name: "Merged_NightlyBuild_1_19_3-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
paths:
|
||||
- Merged
|
||||
expire_in: 1 day
|
||||
when: always
|
||||
cache:
|
||||
key: "gradleCache"
|
||||
policy: pull-push
|
||||
paths:
|
||||
- .gradle
|
||||
- cache/
|
||||
allow_failure: true
|
||||
|
||||
# 1.19.4 build
|
||||
build_19_4:
|
||||
stage: build_19_4
|
||||
script:
|
||||
- echo "Building 1.19.4..."
|
||||
- ./gradlew deleteMerged -PmcVer="1.19.4" --gradle-user-home cache/;
|
||||
- ./gradlew clean -PmcVer="1.19.4" --gradle-user-home cache/;
|
||||
- ./gradlew core:build -PmcVer="1.19.4" --gradle-user-home cache/;
|
||||
- ./gradlew build -PmcVer="1.19.4" --gradle-user-home cache/;
|
||||
- ./gradlew mergeJars -PmcVer="1.19.4" --gradle-user-home cache/;
|
||||
image: eclipse-temurin:17
|
||||
artifacts:
|
||||
name: "Merged_NightlyBuild_1_19_4-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||
paths:
|
||||
- Merged
|
||||
expire_in: 1 day
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fabric_api_version=0.42.0+1.16
|
||||
starlight_version_fabric=
|
||||
phosphor_version_fabric=
|
||||
lithium_version=mc1.16.5-0.6.6
|
||||
sodium_version=3488820
|
||||
sodium_version=mc1.16.5-0.2.0
|
||||
iris_version=1.16.x-v1.1.4
|
||||
bclib_version=
|
||||
immersive_portals_version =
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fabric_api_version=0.46.1+1.17
|
||||
starlight_version_fabric=3442770
|
||||
phosphor_version_fabric=
|
||||
lithium_version=mc1.17.1-0.7.5
|
||||
sodium_version=3605275
|
||||
sodium_version=mc1.17.1-0.3.4
|
||||
iris_version=1.17.x-v1.1.4
|
||||
bclib_version=
|
||||
immersive_portals_version = 0.14-1.17
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fabric_api_version=0.46.6+1.18
|
||||
starlight_version_fabric=3554912
|
||||
phosphor_version_fabric=3573395
|
||||
lithium_version=mc1.18.1-0.7.7
|
||||
sodium_version=3605309
|
||||
sodium_version=mc1.18.1-0.4.0-alpha6
|
||||
iris_version=1.18.x-v1.1.4
|
||||
bclib_version=1.2.5
|
||||
immersive_portals_version = v1.0.4-1.18
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fabric_api_version=0.48.0+1.18.2
|
||||
starlight_version_fabric=3667443
|
||||
phosphor_version_fabric=3573395
|
||||
lithium_version=mc1.18.2-0.7.9
|
||||
sodium_version=3669187
|
||||
sodium_version=mc1.18.2-0.4.1
|
||||
iris_version=1.18.x-v1.2.2
|
||||
immersive_portals_version = v1.0.4-1.18
|
||||
bclib_version=0
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
java_version = 17
|
||||
minecraft_version=1.19.1
|
||||
parchment_version=2022.03.13
|
||||
compatible_minecraft_versions=["1.19.1"]
|
||||
compatible_minecraft_versions=["1.19", "1.19.1"]
|
||||
|
||||
# Fabric loader
|
||||
fabric_loader_version=0.14.8
|
||||
@@ -13,7 +13,7 @@ fabric_api_version=0.58.5+1.19.1
|
||||
starlight_version_fabric=0
|
||||
phosphor_version_fabric=0
|
||||
lithium_version=0
|
||||
sodium_version=3820973
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
iris_version=1.19.x-v1.2.6
|
||||
immersive_portals_version = 0
|
||||
bclib_version=0
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# 1.18.2 version based stuff
|
||||
|
||||
java_version = 17
|
||||
minecraft_version=1.19.2
|
||||
parchment_version=2022.03.13
|
||||
compatible_minecraft_versions=["1.19.2"]
|
||||
|
||||
# Fabric loader
|
||||
fabric_loader_version=0.14.8
|
||||
fabric_api_version=0.58.5+1.19.1
|
||||
# Fabric mod versions
|
||||
modmenu_version=4.0.0
|
||||
starlight_version_fabric=0
|
||||
phosphor_version_fabric=0
|
||||
lithium_version=0
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
iris_version=1.19.x-v1.2.6
|
||||
immersive_portals_version = 0
|
||||
bclib_version=0
|
||||
|
||||
# Fabric mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight=0
|
||||
enable_phosphor=0
|
||||
enable_sodium=1
|
||||
enable_lithium=0
|
||||
enable_iris=0
|
||||
enable_bclib=0
|
||||
|
||||
# Forge loader
|
||||
forge_version=43.0.0
|
||||
# Forge mod versions
|
||||
starlight_version_forge=0
|
||||
terraforged_version=
|
||||
|
||||
# Forge mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
@@ -0,0 +1,43 @@
|
||||
# 1.18.2 version based stuff
|
||||
|
||||
java_version = 17
|
||||
minecraft_version=1.19.3
|
||||
parchment_version=2022.03.13
|
||||
compatible_minecraft_versions=["1.19.3"]
|
||||
|
||||
# Fabric loader
|
||||
fabric_loader_version=0.14.11
|
||||
fabric_api_version=0.68.1+1.19.3
|
||||
# Fabric mod versions
|
||||
modmenu_version=5.0.2
|
||||
starlight_version_fabric=0
|
||||
phosphor_version_fabric=0
|
||||
lithium_version=0
|
||||
sodium_version=mc1.19.3-0.4.11
|
||||
iris_version=1.19.x-v1.2.6
|
||||
immersive_portals_version = 0
|
||||
bclib_version=0
|
||||
|
||||
# Fabric mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight=0
|
||||
enable_phosphor=0
|
||||
enable_sodium=1
|
||||
enable_lithium=0
|
||||
enable_iris=0
|
||||
enable_bclib=0
|
||||
|
||||
# Forge loader
|
||||
forge_version=44.0.6
|
||||
# Forge mod versions
|
||||
starlight_version_forge=0
|
||||
terraforged_version=
|
||||
|
||||
# Forge mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
@@ -0,0 +1,43 @@
|
||||
# 1.18.2 version based stuff
|
||||
|
||||
java_version = 17
|
||||
minecraft_version=1.19.4
|
||||
parchment_version=2022.03.13
|
||||
compatible_minecraft_versions=["1.19.4"]
|
||||
|
||||
# Fabric loader
|
||||
fabric_loader_version=0.14.17
|
||||
fabric_api_version=0.75.3+1.19.4
|
||||
# Fabric mod versions
|
||||
modmenu_version=6.1.0-rc.1
|
||||
starlight_version_fabric=0
|
||||
phosphor_version_fabric=0
|
||||
lithium_version=0
|
||||
sodium_version=mc1.19.4-0.4.11
|
||||
iris_version=1.19.x-v1.2.6
|
||||
immersive_portals_version = 0
|
||||
bclib_version=0
|
||||
|
||||
# Fabric mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight=0
|
||||
enable_phosphor=0
|
||||
enable_sodium=1
|
||||
enable_lithium=0
|
||||
enable_iris=0
|
||||
enable_bclib=0
|
||||
|
||||
# Forge loader
|
||||
forge_version=45.0.0
|
||||
# Forge mod versions
|
||||
starlight_version_forge=0
|
||||
terraforged_version=
|
||||
|
||||
# Forge mod run
|
||||
# 0 = Don't enable and don't run
|
||||
# 1 = Can be referenced in code but doesn't run
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
enable_terraforged=0
|
||||
+1
-1
@@ -13,7 +13,7 @@ fabric_api_version=0.57.0+1.19
|
||||
starlight_version_fabric=0
|
||||
phosphor_version_fabric=0
|
||||
lithium_version=0
|
||||
sodium_version=3820973
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
iris_version=1.19.x-v1.2.6
|
||||
immersive_portals_version = 0
|
||||
bclib_version=0
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
> A mod that adds a Level of Detail System to Minecraft
|
||||
|
||||
## Please move to main branch, this branch is mainly used for porting to newer versions of Minecraft until main becomes stable
|
||||
|
||||
# What is Distant Horizons?
|
||||
|
||||
This mod adds a Level Of Detail (LOD) system to Minecraft.\
|
||||
@@ -16,8 +18,9 @@ If you want to see a quick demo, check out a video covering the mod here:
|
||||
### Versions
|
||||
|
||||
This branch is for these versions of Minecraft
|
||||
- 1.19.1
|
||||
- 1.19
|
||||
- 1.19.3
|
||||
- 1.19.2
|
||||
- 1.19.1 & 1.19
|
||||
- 1.18.2
|
||||
- 1.18.1 & 1.18
|
||||
- 1.17.1 & 1.17
|
||||
@@ -27,16 +30,29 @@ Architectury version: 3.4-SNAPSHOT\
|
||||
Architectury loom version: 0.12.0-SNAPSHOT\
|
||||
Java Compiler plugin: Manifold Preprocessor
|
||||
|
||||
#### 1.19.1 mods
|
||||
Forge version: 42.0.0\
|
||||
|
||||
#### 1.19.4 mods
|
||||
Forge version: 45.0.0\
|
||||
Fabric version: 0.14.17\
|
||||
Fabric API version: 0.75.3+1.19.4\
|
||||
Modmenu version: 6.1.0-rc.1
|
||||
|
||||
#### 1.19.3 mods
|
||||
Forge version: 44.0.6\
|
||||
Fabric version: 0.14.11\
|
||||
Fabric API version: 0.68.1+1.19.3\
|
||||
Modmenu version: 5.0.2
|
||||
|
||||
#### 1.19.2 mods
|
||||
Forge version: 43.0.0\
|
||||
Fabric version: 0.14.8\
|
||||
Fabric API version: 0.58.5+1.19.1\
|
||||
Modmenu version: 4.0.0
|
||||
|
||||
#### 1.19 mods
|
||||
Forge version: 41.0.94\
|
||||
#### 1.19.1 mods
|
||||
Forge version: 42.0.0\
|
||||
Fabric version: 0.14.8\
|
||||
Fabric API version: 0.57.0+1.19\
|
||||
Fabric API version: 0.58.5+1.19.1\
|
||||
Modmenu version: 4.0.0
|
||||
|
||||
#### 1.18.2 mods
|
||||
@@ -73,12 +89,15 @@ This version has been confirmed to work in IDE and Retail Minecraft with ether t
|
||||
|
||||
#### Nightlly builds
|
||||
This mod has an autobuild system to automatically build the mod on each commit
|
||||
- 1.19.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_19_1
|
||||
- 1.19: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_19
|
||||
- 1.18.2: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_18_2
|
||||
- 1.18.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_18_1
|
||||
- 1.17.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_17_1
|
||||
- 1.16.5: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/1.6.4a_dev/download?job=build_16_5
|
||||
- 1.19.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_19_4
|
||||
- 1.19.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_19_3
|
||||
- 1.19.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_19_2
|
||||
- 1.19.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_19_1
|
||||
- 1.19: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_19
|
||||
- 1.18.2: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_18_2
|
||||
- 1.18.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_18_1
|
||||
- 1.17.1: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_17_1
|
||||
- 1.16.5: https://gitlab.com/jeseibel/minecraft-lod-mod/-/jobs/artifacts/stable/download?job=build_16_5
|
||||
|
||||
See the Fabric Documentation online for more detailed instructions:\
|
||||
https://fabricmc.net/wiki/tutorial:setup
|
||||
@@ -101,7 +120,10 @@ https://fabricmc.net/wiki/tutorial:setup
|
||||
4. Import the project into eclipse
|
||||
|
||||
## Switching Versions
|
||||
This branch support 6 built versions:
|
||||
This branch support 9 built versions:
|
||||
- 1.19.4
|
||||
- 1.19.3
|
||||
- 1.19.2
|
||||
- 1.19.1
|
||||
- 1.19
|
||||
- 1.18.2
|
||||
@@ -125,11 +147,19 @@ If running on IDE, to ensure IDE pickup the changed versions, you will need to r
|
||||
6. The compiled jar file will be in the folder `Merged`
|
||||
|
||||
**If in terminal:**
|
||||
1. `git clone -b 1.6.4a_dev --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
|
||||
1. `git clone -b stable --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
|
||||
2. `cd minecraft-lod-mod`
|
||||
3. `./gradlew assemble`
|
||||
4. `./gradlew mergeJars`
|
||||
5. The compiled jar file will be in the folder `Merged`
|
||||
> ### **WARNING:** Due to a bug at the moment, the merged jar does not contain the core.
|
||||
> To add the core follow the steps below
|
||||
> 1. Go into `core/build/libs` and extract the jar with the smallest name
|
||||
> 2. In that extracted folder, copy the folder called `com`
|
||||
> 3. Go into the `Merged` folder and extract the jar in that
|
||||
> 4. Paste in the folder which you copied from step 2 into the newly extracted jar
|
||||
> 5. Zip all the files that were extracted and make sure the file extension is .jar
|
||||
|
||||
>Note: You can add the arg: `-PmcVer=1.?` to tell gradle to build a selected MC version instead of having to manually modify the `gradle.properties` file.
|
||||
|
||||
|
||||
|
||||
+16
-4
@@ -53,7 +53,7 @@ def writeBuildGradlePredefine(List<String> mcVers, int mcIndex) {
|
||||
|
||||
// Sets up the variables for Manifold in the code
|
||||
def loadProperties() {
|
||||
def defaultMcVersion = "1.19.1"
|
||||
def defaultMcVersion = "1.19.2"
|
||||
def mcVersion = ""
|
||||
def mcVers = mcVersions.split(",")
|
||||
int mcIndex = -1
|
||||
@@ -86,7 +86,11 @@ def loadProperties() {
|
||||
"1.17.1": "1_17",
|
||||
"1.18.1": "1_18",
|
||||
"1.18.2": "1_18",
|
||||
"1.19.1" : "1_19"
|
||||
"1.19" : "1_19",
|
||||
"1.19.1" : "1_19",
|
||||
"1.19.2" : "1_19",
|
||||
"1.19.3" : "1_19_3",
|
||||
"1.19.4" : "1_19_3"
|
||||
]
|
||||
// Use this as sometimes multiple versions use the same access wideners
|
||||
rootProject.ext.set("acsessWidenerVersion", mcVersionToAcsessWidenerVersion.get(mcVersion))
|
||||
@@ -239,10 +243,18 @@ subprojects { p ->
|
||||
// Mojmap mappings
|
||||
officialMojangMappings()
|
||||
// Parchment mappings (it adds parameter mappings & javadoc)
|
||||
if (rootProject.minecraft_version != "1.19" && rootProject.minecraft_version != "1.19.1")
|
||||
if (
|
||||
rootProject.minecraft_version != "1.19"
|
||||
&& rootProject.minecraft_version != "1.19.1"
|
||||
&& rootProject.minecraft_version != "1.19.2"
|
||||
&& rootProject.minecraft_version != "1.19.3"
|
||||
&& rootProject.minecraft_version != "1.19.4"
|
||||
) // We are not gonna use this build script anymore so dont bother fixing this
|
||||
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
|
||||
else
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
// Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt
|
||||
// Check the main branch for the new build system, with the working mappings
|
||||
}
|
||||
|
||||
//Manifold
|
||||
@@ -400,4 +412,4 @@ subprojects { p ->
|
||||
p.runClient.enabled = false
|
||||
p.runServer.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -33,10 +33,18 @@ dependencies {
|
||||
// Mojmap mappings
|
||||
officialMojangMappings()
|
||||
// Parchment mappings (it adds parameter mappings & javadoc)
|
||||
if (rootProject.minecraft_version != "1.19" && rootProject.minecraft_version != "1.19.1")
|
||||
if (
|
||||
rootProject.minecraft_version != "1.19"
|
||||
&& rootProject.minecraft_version != "1.19.1"
|
||||
&& rootProject.minecraft_version != "1.19.2"
|
||||
&& rootProject.minecraft_version != "1.19.3"
|
||||
&& rootProject.minecraft_version != "1.19.4"
|
||||
) // We are not gonna use this build script anymore so dont bother fixing this
|
||||
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
|
||||
else
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19 dosnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
// Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt
|
||||
// Check the main branch for the new build system, with the working mappings
|
||||
}
|
||||
|
||||
//Manifold
|
||||
|
||||
@@ -21,7 +21,11 @@ package com.seibel.lod.common.wrappers;
|
||||
|
||||
import java.nio.FloatBuffer;
|
||||
|
||||
#if PRE_MC_1_19_3
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.lod.common.wrappers.block.BlockPosWrapper;
|
||||
import com.seibel.lod.core.enums.LodDirection;
|
||||
import com.seibel.lod.core.objects.math.Mat4f;
|
||||
@@ -39,13 +43,45 @@ import net.minecraft.core.Direction;
|
||||
*/
|
||||
public class McObjectConverter
|
||||
{
|
||||
private static int bufferIndex(int x, int y) {
|
||||
return y * 4 + x;
|
||||
}
|
||||
/** Taken from Minecraft's com.mojang.math.Matrix4f class from 1.18.2 */
|
||||
public static void storeMatrix(Matrix4f matrix, FloatBuffer buffer) {
|
||||
#if PRE_MC_1_19_3
|
||||
matrix.store(buffer);
|
||||
#else
|
||||
// Mojang starts to use joml's Matrix4f libary in 1.19.3 so we copy their store method and use it here if its newer than 1.19.3
|
||||
buffer.put(bufferIndex(0, 0), matrix.m00());
|
||||
buffer.put(bufferIndex(0, 1), matrix.m01());
|
||||
buffer.put(bufferIndex(0, 2), matrix.m02());
|
||||
buffer.put(bufferIndex(0, 3), matrix.m03());
|
||||
buffer.put(bufferIndex(1, 0), matrix.m10());
|
||||
buffer.put(bufferIndex(1, 1), matrix.m11());
|
||||
buffer.put(bufferIndex(1, 2), matrix.m12());
|
||||
buffer.put(bufferIndex(1, 3), matrix.m13());
|
||||
buffer.put(bufferIndex(2, 0), matrix.m20());
|
||||
buffer.put(bufferIndex(2, 1), matrix.m21());
|
||||
buffer.put(bufferIndex(2, 2), matrix.m22());
|
||||
buffer.put(bufferIndex(2, 3), matrix.m23());
|
||||
buffer.put(bufferIndex(3, 0), matrix.m30());
|
||||
buffer.put(bufferIndex(3, 1), matrix.m31());
|
||||
buffer.put(bufferIndex(3, 2), matrix.m32());
|
||||
buffer.put(bufferIndex(3, 3), matrix.m33());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 4x4 float matrix converter */
|
||||
public static Mat4f Convert(Matrix4f mcMatrix)
|
||||
{
|
||||
FloatBuffer buffer = FloatBuffer.allocate(16);
|
||||
mcMatrix.store(buffer);
|
||||
storeMatrix(mcMatrix, buffer);
|
||||
Mat4f matrix = new Mat4f(buffer);
|
||||
matrix.transpose();
|
||||
#if PRE_MC_1_19_3
|
||||
matrix.transpose(); // In 1.19.3 and later, we no longer need to transpose it
|
||||
#endif
|
||||
return matrix;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,9 +108,21 @@ public class BlockDetailWrapper extends IBlockDetailWrapper
|
||||
|
||||
{
|
||||
// textures normally use u and v instead of x and y
|
||||
for (int u = 0; u < texture.getWidth(); u++)
|
||||
for (int u = 0; u <
|
||||
#if PRE_MC_1_19_3
|
||||
texture.getWidth();
|
||||
#else
|
||||
texture.contents().width();
|
||||
#endif
|
||||
u++)
|
||||
{
|
||||
for (int v = 0; v < texture.getHeight(); v++)
|
||||
for (int v = 0; v <
|
||||
#if PRE_MC_1_19_3
|
||||
texture.getHeight();
|
||||
#else
|
||||
texture.contents().height();
|
||||
#endif
|
||||
v++)
|
||||
{
|
||||
//note: Minecraft color format is: 0xAA BB GG RR
|
||||
//________ DH mod color format is: 0xAA RR GG BB
|
||||
|
||||
+7
-1
@@ -41,12 +41,18 @@ public class TextureAtlasSpriteWrapper {
|
||||
return sprite.mainImage[0].getPixelRGBA(
|
||||
x + sprite.framesX[frameIndex] * sprite.getWidth(),
|
||||
y + sprite.framesY[frameIndex] * sprite.getHeight());
|
||||
#else
|
||||
#elif PRE_MC_1_19_3
|
||||
if (sprite.animatedTexture != null) {
|
||||
x += sprite.animatedTexture.getFrameX(frameIndex) * sprite.width;
|
||||
y += sprite.animatedTexture.getFrameY(frameIndex) * sprite.height;
|
||||
}
|
||||
return sprite.mainImage[0].getPixelRGBA(x, y);
|
||||
#else
|
||||
if (sprite.contents().animatedTexture != null) {
|
||||
x += sprite.contents().animatedTexture.getFrameX(frameIndex) * sprite.contents().width();
|
||||
y += sprite.contents().animatedTexture.getFrameY(frameIndex) * sprite.contents().width();
|
||||
}
|
||||
return sprite.contents().originalImage.getPixelRGBA(x, y);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,11 +569,11 @@ public abstract class ConfigGui
|
||||
if (!reload)
|
||||
loadFromFile();
|
||||
|
||||
addBtn(new Button(this.width / 2 - 154, this.height - 28, 150, 20, CommonComponents.GUI_CANCEL, button -> {
|
||||
addBtn(createButton(this.width / 2 - 154, this.height - 28, 150, 20, CommonComponents.GUI_CANCEL, button -> {
|
||||
loadFromFile();
|
||||
Objects.requireNonNull(minecraft).setScreen(parent);
|
||||
}));
|
||||
Button done = addBtn(new Button(this.width / 2 + 4, this.height - 28, 150, 20, CommonComponents.GUI_DONE, (button) -> {
|
||||
Button done = addBtn(createButton(this.width / 2 + 4, this.height - 28, 150, 20, CommonComponents.GUI_DONE, (button) -> {
|
||||
saveToFile();
|
||||
Objects.requireNonNull(minecraft).setScreen(parent);
|
||||
}));
|
||||
@@ -591,7 +591,7 @@ public abstract class ConfigGui
|
||||
Button resetButton = new Button(this.width - ConfigScreenConfigs.SpaceFromRightScreen - info.width - ConfigScreenConfigs.ButtonWidthSpacing - ConfigScreenConfigs.ResetButtonWidth, 0, ConfigScreenConfigs.ResetButtonWidth, 20, new TextComponent("Reset").withStyle(ChatFormatting.RED), (button -> {
|
||||
#else
|
||||
Component name = (info.name == null ? Component.translatable(translationPrefix + (!info.category.isEmpty() ? info.category + "." : "") + info.field.getName()) : info.name);
|
||||
Button resetButton = new Button(this.width - ConfigScreenConfigs.SpaceFromRightScreen - info.width - ConfigScreenConfigs.ButtonWidthSpacing - ConfigScreenConfigs.ResetButtonWidth, 0, ConfigScreenConfigs.ResetButtonWidth, 20, Component.translatable("Reset").withStyle(ChatFormatting.RED), (button -> {
|
||||
Button resetButton = createButton(this.width - ConfigScreenConfigs.SpaceFromRightScreen - info.width - ConfigScreenConfigs.ButtonWidthSpacing - ConfigScreenConfigs.ResetButtonWidth, 0, ConfigScreenConfigs.ResetButtonWidth, 20, Component.translatable("Reset").withStyle(ChatFormatting.RED), (button -> {
|
||||
#endif
|
||||
info.value = info.defaultValue;
|
||||
info.tempValue = info.defaultValue.toString();
|
||||
@@ -609,7 +609,7 @@ public abstract class ConfigGui
|
||||
#else
|
||||
widget.setValue(value -> Component.translatable(translationPrefix + "enum." + info.field.getType().getSimpleName() + "." + info.value.toString()));
|
||||
#endif
|
||||
this.list.addButton(new Button(this.width - info.width - ConfigScreenConfigs.SpaceFromRightScreen, 0, info.width, 20, widget.getValue().apply(info.value), widget.getKey()), resetButton, null, name);
|
||||
this.list.addButton(createButton(this.width - info.width - ConfigScreenConfigs.SpaceFromRightScreen, 0, info.width, 20, widget.getValue().apply(info.value), widget.getKey()), resetButton, null, name);
|
||||
}
|
||||
else if (info.field.getType() == List.class)
|
||||
{
|
||||
@@ -629,7 +629,7 @@ public abstract class ConfigGui
|
||||
Button cycleButton = new Button(this.width - 185, 0, 20, 20, new TextComponent(String.valueOf(info.index)).withStyle(ChatFormatting.GOLD), (button -> {
|
||||
#else
|
||||
resetButton.setMessage(Component.translatable("R").withStyle(ChatFormatting.RED));
|
||||
Button cycleButton = new Button(this.width - 185, 0, 20, 20, Component.translatable(String.valueOf(info.index)).withStyle(ChatFormatting.GOLD), (button -> {
|
||||
Button cycleButton = createButton(this.width - 185, 0, 20, 20, Component.translatable(String.valueOf(info.index)).withStyle(ChatFormatting.GOLD), (button -> {
|
||||
#endif
|
||||
((List<String>) info.value).remove("");
|
||||
this.reload = true;
|
||||
@@ -651,7 +651,7 @@ public abstract class ConfigGui
|
||||
}
|
||||
else if (info.screenButton)
|
||||
{
|
||||
Button widget = new Button(this.width / 2 - info.width, this.height - 28, info.width * 2, 20, name, (button -> {
|
||||
Button widget = createButton(this.width / 2 - info.width, this.height - 28, info.width * 2, 20, name, (button -> {
|
||||
saveToFile();
|
||||
Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, info.gotoScreen));
|
||||
}));
|
||||
@@ -781,17 +781,29 @@ public abstract class ConfigGui
|
||||
{
|
||||
if (button != null)
|
||||
{
|
||||
#if PRE_MC_1_19_3
|
||||
button.y = y;
|
||||
#else
|
||||
button.setY(y);
|
||||
#endif
|
||||
button.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
if (resetButton != null)
|
||||
{
|
||||
#if PRE_MC_1_19_3
|
||||
resetButton.y = y;
|
||||
#else
|
||||
resetButton.setY(y);
|
||||
#endif
|
||||
resetButton.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
if (indexButton != null)
|
||||
{
|
||||
#if PRE_MC_1_19_3
|
||||
indexButton.y = y;
|
||||
#else
|
||||
indexButton.setY(y);
|
||||
#endif
|
||||
indexButton.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
if (text != null && (!text.getString().contains("spacer") || button != null))
|
||||
@@ -814,4 +826,16 @@ public abstract class ConfigGui
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Button createButton(int x, int y, int width, int height, Component component, Button.OnPress onPress) {
|
||||
#if PRE_MC_1_19_3
|
||||
return new Button(x, y, width, height, component, onPress);
|
||||
#else
|
||||
return Button.builder(component, onPress)
|
||||
.bounds(x, y, width, height)
|
||||
.build();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
+30
-3
@@ -45,10 +45,11 @@ public class TexturedButtonWidget extends ImageButton {
|
||||
super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, text);
|
||||
}
|
||||
|
||||
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation texture, int textureWidth, int textureHeight, OnPress pressAction, OnTooltip tooltipSupplier, Component text) {
|
||||
super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, tooltipSupplier, text);
|
||||
}
|
||||
// public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation texture, int textureWidth, int textureHeight, OnPress pressAction, OnTooltip tooltipSupplier, Component text) {
|
||||
// super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction, tooltipSupplier, text);
|
||||
// }
|
||||
|
||||
#if PRE_MC_1_19_4
|
||||
@Override
|
||||
public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
#if PRE_MC_1_17_1
|
||||
@@ -64,9 +65,35 @@ public class TexturedButtonWidget extends ImageButton {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.enableDepthTest();
|
||||
#if PRE_MC_1_19_3
|
||||
this.blit(matrices, this.x, this.y, 0, 46 + i * 20, this.width / 2, this.height);
|
||||
this.blit(matrices, this.x + this.width / 2, this.y, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
||||
#else
|
||||
this.blit(matrices, this.getX(), this.getY(), 0, 46 + i * 20, this.getWidth() / 2, this.getHeight());
|
||||
this.blit(matrices, this.getX() + this.getWidth() / 2, this.getY(), 200 - this.width / 2, 46 + i * 20, this.getWidth() / 2, this.getHeight());
|
||||
#endif
|
||||
|
||||
super.renderButton(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
#else
|
||||
@Override
|
||||
public void renderWidget(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
RenderSystem.setShaderTexture(0, WIDGETS_LOCATION);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);
|
||||
|
||||
int i = 1;
|
||||
if (!this.active)
|
||||
i = 0;
|
||||
else if (this.isHovered)
|
||||
i = 2;
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.enableDepthTest();
|
||||
this.blit(matrices, this.getX(), this.getY(), 0, 46 + i * 20, this.getWidth() / 2, this.getHeight());
|
||||
this.blit(matrices, this.getX() + this.getWidth() / 2, this.getY(), 200 - this.width / 2, 46 + i * 20, this.getWidth() / 2, this.getHeight());
|
||||
|
||||
super.renderWidget(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
+4
-1
@@ -37,8 +37,11 @@ import com.seibel.lod.core.util.LodUtil;
|
||||
|
||||
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
|
||||
#if PRE_MC_1_19_3
|
||||
import com.mojang.math.Vector3f;
|
||||
#else
|
||||
import org.joml.Vector3f;
|
||||
#endif
|
||||
import com.seibel.lod.core.objects.math.Mat4f;
|
||||
import com.seibel.lod.core.objects.math.Vec3d;
|
||||
import com.seibel.lod.core.objects.math.Vec3f;
|
||||
|
||||
@@ -32,7 +32,16 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
|
||||
#if PRE_MC_1_19_3
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
#else
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
|
||||
import com.seibel.lod.core.api.ApiShared;
|
||||
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
|
||||
#endif
|
||||
|
||||
#if POST_MC_1_19
|
||||
import net.minecraft.data.worldgen.biome.EndBiomes;
|
||||
import net.minecraft.data.worldgen.biome.NetherBiomes;
|
||||
@@ -188,7 +197,14 @@ public class BiomeWrapper implements IBiomeWrapper
|
||||
}
|
||||
|
||||
private static Biome _get(ResourceKey<Biome> r) {
|
||||
#if PRE_MC_1_19_3
|
||||
return BuiltinRegistries.BIOME.getOrThrow(r);
|
||||
#else
|
||||
// The fix below is a hacky and convoluted way of doing the thing above so...
|
||||
// TODO[1.19.3]: Find a less convoluted method to get the Minecraft's registryAccess
|
||||
return (((ServerLevel) ((WorldWrapper) LodUtil.getServerWorldFromDimension(ApiShared.lodWorld.getLodDimension(SingletonHandler.get(IMinecraftClientWrapper.class).getCurrentDimension()).dimension)).getWorld()).getServer().registryAccess()) // This entire mess is just to get Minecraft's registryAccess (FIND A BETTER WAY LATER)
|
||||
.registryOrThrow(Registries.BIOME).getOrThrow(r); // Once youve gotten the registryAccess, the rest is easy
|
||||
#endif
|
||||
}
|
||||
|
||||
//FIXME: THIS IS HELL!
|
||||
|
||||
+19
-4
@@ -59,6 +59,9 @@ import com.seibel.lod.common.wrappers.worldGeneration.step.StepStructureReferenc
|
||||
import com.seibel.lod.common.wrappers.worldGeneration.step.StepStructureStart;
|
||||
import com.seibel.lod.common.wrappers.worldGeneration.step.StepSurface;
|
||||
|
||||
#if POST_MC_1_19_3
|
||||
import net.minecraft.core.registries.Registries;
|
||||
#endif
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
@@ -380,8 +383,14 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
if (chunkData == null)
|
||||
{
|
||||
return new ProtoChunk(chunkPos, UpgradeData.EMPTY
|
||||
#if POST_MC_1_17_1, level #endif
|
||||
#if POST_MC_1_18_1, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null #endif
|
||||
#if POST_MC_1_17_1, level #endif
|
||||
#if POST_MC_1_18_1, level.registryAccess().registryOrThrow(
|
||||
#if PRE_MC_1_19_3
|
||||
Registry.BIOME_REGISTRY
|
||||
#else
|
||||
Registries.BIOME
|
||||
#endif
|
||||
), null #endif
|
||||
);
|
||||
}
|
||||
else
|
||||
@@ -391,8 +400,14 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
} catch (Exception e) {
|
||||
LOAD_LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
|
||||
return new ProtoChunk(chunkPos, UpgradeData.EMPTY
|
||||
#if POST_MC_1_17_1, level #endif
|
||||
#if POST_MC_1_18_1, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null #endif
|
||||
#if POST_MC_1_17_1, level #endif
|
||||
#if POST_MC_1_18_1, level.registryAccess().registryOrThrow(
|
||||
#if PRE_MC_1_19_3
|
||||
Registry.BIOME_REGISTRY
|
||||
#else
|
||||
Registries.BIOME
|
||||
#endif
|
||||
), null #endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-2
@@ -38,8 +38,12 @@ import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||
#if PRE_MC_1_19
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
#else
|
||||
import net.minecraft.world.level.levelgen.RandomState;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
||||
import net.minecraft.world.level.levelgen.RandomState;
|
||||
#if POST_MC_1_19_3
|
||||
import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
#endif
|
||||
#endif
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
|
||||
@@ -52,7 +56,11 @@ public final class GlobalParameters
|
||||
public final StructureTemplateManager structures;
|
||||
public final RandomState randomState;
|
||||
#endif
|
||||
#if PRE_MC_1_19_3
|
||||
public final WorldGenSettings worldGenSettings;
|
||||
#else
|
||||
public final WorldOptions worldOptions;
|
||||
#endif
|
||||
public final ThreadedLevelLightEngine lightEngine;
|
||||
public final LodBuilder lodBuilder;
|
||||
public final LodDimension lodDim;
|
||||
@@ -74,10 +82,16 @@ public final class GlobalParameters
|
||||
lightEngine = (ThreadedLevelLightEngine) level.getLightEngine();
|
||||
MinecraftServer server = level.getServer();
|
||||
WorldData worldData = server.getWorldData();
|
||||
worldGenSettings = worldData.worldGenSettings();
|
||||
registry = server.registryAccess();
|
||||
#if PRE_MC_1_19_3
|
||||
worldGenSettings = worldData.worldGenSettings();
|
||||
biomes = registry.registryOrThrow(Registry.BIOME_REGISTRY);
|
||||
worldSeed = worldGenSettings.seed();
|
||||
#else
|
||||
worldOptions = worldData.worldGenOptions();
|
||||
biomes = registry.registryOrThrow(Registries.BIOME);
|
||||
worldSeed = worldOptions.seed();
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
biomeManager = new BiomeManager(level, BiomeManager.obfuscateSeed(worldSeed));
|
||||
chunkScanner = level.getChunkSource().chunkScanner();
|
||||
|
||||
+5
-2
@@ -71,8 +71,11 @@ public final class ThreadedParameters
|
||||
#endif
|
||||
}
|
||||
|
||||
public void makeStructFeat(WorldGenLevel genLevel, GlobalParameters param)
|
||||
{
|
||||
public void makeStructFeat(WorldGenLevel genLevel, GlobalParameters param) {
|
||||
#if PRE_MC_1_19_3
|
||||
structFeat = new WorldGenStructFeatManager(param.worldGenSettings, genLevel #if POST_MC_1_18_1, structCheck #endif);
|
||||
#else
|
||||
structFeat = new WorldGenStructFeatManager(param.worldOptions, genLevel #if POST_MC_1_18_1, structCheck #endif);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -37,9 +37,14 @@ import java.util.Objects;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.SectionPos;
|
||||
#if POST_MC_1_19_3
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
#endif
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.*;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
@@ -103,7 +108,11 @@ public class ChunkLoader
|
||||
private static LevelChunkSection[] readSections(LevelAccessor level, LevelLightEngine lightEngine, ChunkPos chunkPos, CompoundTag chunkData)
|
||||
{
|
||||
#if POST_MC_1_18_1
|
||||
#if PRE_MC_1_19_3
|
||||
Registry<Biome> biomes = level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
|
||||
#else
|
||||
Registry<Biome> biomes = level.registryAccess().registryOrThrow(Registries.BIOME);
|
||||
#endif
|
||||
#if PRE_MC_1_18_2
|
||||
Codec<PalettedContainer<Biome>> biomeCodec = PalettedContainer.codec(
|
||||
biomes, biomes.byNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, biomes.getOrThrow(Biomes.PLAINS));
|
||||
@@ -265,10 +274,17 @@ public class ChunkLoader
|
||||
: new ProtoTickList<Fluid>(fluid -> (fluid == null || fluid == Fluids.EMPTY), chunkPos,
|
||||
tagLevel.getList("LiquidsToBeTicked", 9)#if POST_MC_1_17_1, level #endif);
|
||||
#else
|
||||
#if PRE_MC_1_19_3
|
||||
LevelChunkTicks<Block> blockTicks = LevelChunkTicks.load(tagLevel.getList(BLOCK_TICKS_TAG_18, 10),
|
||||
string -> Registry.BLOCK.getOptional(ResourceLocation.tryParse(string)), chunkPos);
|
||||
LevelChunkTicks<Fluid> fluidTicks = LevelChunkTicks.load(tagLevel.getList(FLUID_TICKS_TAG_18, 10),
|
||||
string -> Registry.FLUID.getOptional(ResourceLocation.tryParse(string)), chunkPos);
|
||||
#else
|
||||
LevelChunkTicks<Block> blockTicks = LevelChunkTicks.load(tagLevel.getList(BLOCK_TICKS_TAG_18, 10),
|
||||
(string -> BuiltInRegistries.BLOCK.getOptional(ResourceLocation.tryParse(string))), chunkPos);
|
||||
LevelChunkTicks<Fluid> fluidTicks = LevelChunkTicks.load(tagLevel.getList(FLUID_TICKS_TAG_18, 10),
|
||||
string -> BuiltInRegistries.FLUID.getOptional(ResourceLocation.tryParse(string)), chunkPos);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
LevelChunkSection[] levelChunkSections = readSections(level, lightEngine, chunkPos, tagLevel);
|
||||
@@ -278,8 +294,9 @@ public class ChunkLoader
|
||||
LevelChunk chunk = new LevelChunk((Level) level.getLevel(), chunkPos, chunkBiomeContainer, upgradeData, blockTicks,
|
||||
fluidTicks, inhabitedTime, levelChunkSections, null);
|
||||
#else
|
||||
|
||||
LevelChunk chunk = new LevelChunk((Level) level, chunkPos, upgradeData, blockTicks,
|
||||
fluidTicks, inhabitedTime, levelChunkSections, null, blendingData);
|
||||
fluidTicks, inhabitedTime, levelChunkSections, null, blendingData);
|
||||
#endif
|
||||
// Set some states after object creation
|
||||
chunk.setLightCorrect(isLightOn);
|
||||
|
||||
+23
-3
@@ -46,6 +46,9 @@ import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
||||
import net.minecraft.world.level.StructureFeatureManager;
|
||||
#else
|
||||
#if POST_MC_1_19_3
|
||||
import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
#endif
|
||||
import net.minecraft.world.level.levelgen.structure.Structure;
|
||||
import net.minecraft.world.level.StructureManager;
|
||||
#endif
|
||||
@@ -61,23 +64,40 @@ public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||
public class WorldGenStructFeatManager extends StructureManager {
|
||||
#endif
|
||||
final WorldGenLevel genLevel;
|
||||
#if PRE_MC_1_19_3
|
||||
WorldGenSettings worldGenSettings;
|
||||
#else
|
||||
WorldOptions worldOptions;
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
StructureCheck structureCheck;
|
||||
#endif
|
||||
#if PRE_MC_1_19_3
|
||||
public WorldGenStructFeatManager(WorldGenSettings worldGenSettings,
|
||||
WorldGenLevel genLevel #if POST_MC_1_18_1, StructureCheck structureCheck #endif) {
|
||||
|
||||
super(genLevel, worldGenSettings #if POST_MC_1_18_1, structureCheck #endif);
|
||||
this.genLevel = genLevel;
|
||||
super(genLevel,
|
||||
worldGenSettings #if POST_MC_1_19_3 .options() #endif
|
||||
#if POST_MC_1_18_1, structureCheck #endif
|
||||
);
|
||||
this.worldGenSettings = worldGenSettings;
|
||||
#else
|
||||
public WorldGenStructFeatManager(WorldOptions worldOptions,
|
||||
WorldGenLevel genLevel #if POST_MC_1_18_1, StructureCheck structureCheck #endif) {
|
||||
|
||||
super(genLevel, worldOptions, structureCheck);
|
||||
this.worldOptions = worldOptions;
|
||||
#endif
|
||||
this.genLevel = genLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldGenStructFeatManager forWorldGenRegion(WorldGenRegion worldGenRegion) {
|
||||
if (worldGenRegion == genLevel)
|
||||
return this;
|
||||
return new WorldGenStructFeatManager(worldGenSettings, worldGenRegion #if POST_MC_1_18_1, structureCheck #endif);
|
||||
return new WorldGenStructFeatManager(
|
||||
#if PRE_MC_1_19_3 worldGenSettings #else worldOptions #endif
|
||||
, worldGenRegion #if POST_MC_1_18_1, structureCheck #endif);
|
||||
}
|
||||
|
||||
private ChunkAccess _getChunk(int x, int z, ChunkStatus status) {
|
||||
|
||||
+4
-1
@@ -76,9 +76,12 @@ public final class StepBiomes {
|
||||
#elif PRE_MC_1_19
|
||||
chunk = environment.joinSync(environment.params.generator.createBiomes(environment.params.biomes, Runnable::run, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#else
|
||||
#elif PRE_MC_1_19_3
|
||||
chunk = environment.joinSync(environment.params.generator.createBiomes(environment.params.biomes, Runnable::run, environment.params.randomState, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#else
|
||||
chunk = environment.joinSync(environment.params.generator.createBiomes(Runnable::run, environment.params.randomState, Blender.of(worldGenRegion),
|
||||
tParams.structFeat.forWorldGenRegion(worldGenRegion), chunk));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -69,17 +69,23 @@ public final class StepStructureStart {
|
||||
|
||||
#if PRE_MC_1_19
|
||||
if (environment.params.worldGenSettings.generateFeatures()) {
|
||||
#elif POST_MC_1_19
|
||||
#elif PRE_MC_1_19_3
|
||||
if (environment.params.worldGenSettings.generateStructures()) {
|
||||
#else
|
||||
if (environment.params.worldOptions.generateStructures()) {
|
||||
#endif
|
||||
for (ChunkAccess chunk : chunksToDo) {
|
||||
// System.out.println("StepStructureStart: "+chunk.getPos());
|
||||
#if PRE_MC_1_19
|
||||
environment.params.generator.createStructures(environment.params.registry, tParams.structFeat, chunk, environment.params.structures,
|
||||
environment.params.worldSeed);
|
||||
#elif POST_MC_1_19
|
||||
#elif PRE_MC_1_19_3
|
||||
environment.params.generator.createStructures(environment.params.registry, environment.params.randomState, tParams.structFeat, chunk, environment.params.structures,
|
||||
environment.params.worldSeed);
|
||||
#else
|
||||
environment.params.generator.createStructures(environment.params.registry,
|
||||
environment.params.level.getChunkSource().getGeneratorState(),
|
||||
tParams.structFeat, chunk, environment.params.structures);
|
||||
#endif
|
||||
#if POST_MC_1_18_1
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
accessWidener v1 named
|
||||
|
||||
|
||||
# used when determining where to save files to
|
||||
accessible field net/minecraft/world/level/storage/DimensionDataStorage dataFolder Ljava/io/File;
|
||||
|
||||
# used when rendering
|
||||
accessible field com/mojang/blaze3d/vertex/VertexBuffer indexCount I
|
||||
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)D
|
||||
|
||||
# used for grabbing vanilla rendered chunks
|
||||
accessible field net/minecraft/client/renderer/LevelRenderer renderChunkStorage Ljava/util/concurrent/atomic/AtomicReference;
|
||||
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkStorage
|
||||
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
|
||||
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
|
||||
|
||||
# lighting
|
||||
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
|
||||
accessible field net/minecraft/client/renderer/LightTexture lightTexture Lnet/minecraft/client/renderer/texture/DynamicTexture;
|
||||
accessible field net/minecraft/world/level/lighting/LevelLightEngine blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
||||
accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
|
||||
|
||||
# world generation
|
||||
accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V
|
||||
accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings;
|
||||
# accessible field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder;
|
||||
accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
|
||||
accessible method net/minecraft/server/level/ChunkMap readChunk (Lnet/minecraft/world/level/ChunkPos;)Ljava/util/concurrent/CompletableFuture;
|
||||
|
||||
|
||||
# lod generation from save file
|
||||
accessible field net/minecraft/server/level/ChunkMap mainThreadExecutor Lnet/minecraft/util/thread/BlockableEventLoop;
|
||||
|
||||
|
||||
# grabbing textures
|
||||
accessible class net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture
|
||||
accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameX (I)I
|
||||
accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameY (I)I
|
||||
accessible field net/minecraft/client/renderer/texture/SpriteContents animatedTexture Lnet/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture;
|
||||
accessible field net/minecraft/client/renderer/texture/SpriteContents originalImage Lcom/mojang/blaze3d/platform/NativeImage;
|
||||
|
||||
# hacky stuff
|
||||
accessible field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
|
||||
mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
|
||||
+1
-1
Submodule core updated: f00a1db9c2...131ba164cf
+11
-3
@@ -107,10 +107,18 @@ dependencies {
|
||||
// Mojmap mappings
|
||||
officialMojangMappings()
|
||||
// Parchment mappings (it adds parameter mappings & javadoc)
|
||||
if (rootProject.minecraft_version != "1.19" && rootProject.minecraft_version != "1.19.1")
|
||||
if (
|
||||
rootProject.minecraft_version != "1.19"
|
||||
&& rootProject.minecraft_version != "1.19.1"
|
||||
&& rootProject.minecraft_version != "1.19.2"
|
||||
&& rootProject.minecraft_version != "1.19.3"
|
||||
&& rootProject.minecraft_version != "1.19.4"
|
||||
) // We are not gonna use this build script anymore so dont bother fixing this
|
||||
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
|
||||
else
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19 dosnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
// Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt
|
||||
// Check the main branch for the new build system, with the working mappings
|
||||
}
|
||||
|
||||
//Manifold
|
||||
@@ -145,7 +153,7 @@ dependencies {
|
||||
addMod("curse.maven:phosphor-372124:${rootProject.phosphor_version_fabric}", rootProject.enable_phosphor)
|
||||
|
||||
// Sodium
|
||||
addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium)
|
||||
addMod("maven.modrinth:sodium:${rootProject.sodium_version}", rootProject.enable_sodium)
|
||||
implementation "org.joml:joml:1.10.2"
|
||||
modImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", rootProject.fabric_api_version))
|
||||
modImplementation(fabricApi.module("fabric-rendering-fluids-v1", rootProject.fabric_api_version))
|
||||
|
||||
@@ -121,6 +121,7 @@ public class ClientProxy
|
||||
public void worldLoadEvent(Level level)
|
||||
{
|
||||
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
|
||||
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
|
||||
if (level != null) {
|
||||
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(level));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -69,7 +69,7 @@ public class MixinOptionsScreen extends Screen {
|
||||
// For now it goes to the client option by default
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
||||
// Add a title to the screen
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
||||
#else
|
||||
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
package com.seibel.lod.fabric.mixins;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_3
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.lod.common.Config;
|
||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||
import com.seibel.lod.core.api.ClientApi;
|
||||
@@ -89,7 +93,7 @@ public class MixinWorldRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#else
|
||||
#elif PRE_MC_1_19_3
|
||||
@Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true)
|
||||
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
|
||||
// get the partial ticks since renderChunkLayer doesn't
|
||||
@@ -114,5 +118,30 @@ public class MixinWorldRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#else
|
||||
@Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true)
|
||||
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
|
||||
// get the partial ticks since renderChunkLayer doesn't
|
||||
// have access to them
|
||||
previousPartialTicks = tickDelta;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"),
|
||||
method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V",
|
||||
cancellable = true)
|
||||
private void renderChunkLayer(RenderType renderType, PoseStack modelViewMatrixStack, double cameraXBlockPos, double cameraYBlockPos, double cameraZBlockPos, Matrix4f projectionMatrix, CallbackInfo callback)
|
||||
{
|
||||
// only render before solid blocks
|
||||
if (renderType.equals(RenderType.solid()))
|
||||
{
|
||||
Mat4f mcModelViewMatrix = McObjectConverter.Convert(modelViewMatrixStack.last().pose());
|
||||
Mat4f mcProjectionMatrix = McObjectConverter.Convert(projectionMatrix);
|
||||
|
||||
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
||||
}
|
||||
if (Config.Client.Advanced.lodOnlyMode) {
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
+10
-2
@@ -61,10 +61,18 @@ dependencies {
|
||||
// Mojmap mappings
|
||||
officialMojangMappings()
|
||||
// Parchment mappings (it adds parameter mappings & javadoc)
|
||||
if (rootProject.minecraft_version != "1.19" && rootProject.minecraft_version != "1.19.1")
|
||||
if (
|
||||
rootProject.minecraft_version != "1.19"
|
||||
&& rootProject.minecraft_version != "1.19.1"
|
||||
&& rootProject.minecraft_version != "1.19.2"
|
||||
&& rootProject.minecraft_version != "1.19.3"
|
||||
&& rootProject.minecraft_version != "1.19.4"
|
||||
) // We are not gonna use this build script anymore so dont bother fixing this
|
||||
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip")
|
||||
else
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19 dosnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") // As 1.19.x or higher doesnt have parchment mappings yet, we use 1.18.2 mapping
|
||||
// Note: parchment may have later mappings at the time you are reading this, but at the time this was written, it didnt
|
||||
// Check the main branch for the new build system, with the working mappings
|
||||
}
|
||||
|
||||
//Manifold
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.seibel.lod.common.wrappers.world.WorldWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.client.event.InputEvent;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
@@ -70,7 +70,7 @@ public class ForgeClientProxy
|
||||
@SubscribeEvent
|
||||
public void chunkLoadEvent(ChunkEvent.Load event)
|
||||
{
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getWorld()), WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||
#else
|
||||
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getLevel()), WorldWrapper.getWorldWrapper(event.getLevel()));
|
||||
@@ -78,7 +78,7 @@ public class ForgeClientProxy
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
public void worldSaveEvent(WorldEvent.Save event)
|
||||
#else
|
||||
public void worldSaveEvent(LevelEvent.Save event)
|
||||
@@ -89,14 +89,15 @@ public class ForgeClientProxy
|
||||
|
||||
/** This is also called when a new dimension loads */
|
||||
@SubscribeEvent
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
public void worldLoadEvent(WorldEvent.Load event)
|
||||
#else
|
||||
public void worldLoadEvent(LevelEvent.Load event)
|
||||
#endif
|
||||
{
|
||||
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
|
||||
#if PRE_MC_1_19_1
|
||||
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
|
||||
#if PRE_MC_1_19
|
||||
if (event.getWorld() != null) {
|
||||
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||
}
|
||||
@@ -108,7 +109,7 @@ public class ForgeClientProxy
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
public void worldUnloadEvent(WorldEvent.Unload event)
|
||||
{
|
||||
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||
@@ -130,7 +131,7 @@ public class ForgeClientProxy
|
||||
event.getClass() == BlockEvent.FluidPlaceBlockEvent.class ||
|
||||
event.getClass() == BlockEvent.PortalSpawnEvent.class)
|
||||
{
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()), event.getWorld());
|
||||
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType());
|
||||
#else
|
||||
@@ -144,7 +145,7 @@ public class ForgeClientProxy
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(#if PRE_MC_1_19_1 InputEvent.KeyInputEvent event #else InputEvent.Key event #endif)
|
||||
public void onKeyInput(#if PRE_MC_1_19 InputEvent.KeyInputEvent event #else InputEvent.Key event #endif)
|
||||
{
|
||||
if (Minecraft.getInstance().player == null) return;
|
||||
if (event.getAction() != GLFW.GLFW_PRESS) return;
|
||||
|
||||
@@ -49,14 +49,14 @@ import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
#elif MC_1_17_1
|
||||
import net.minecraftforge.fmlclient.ConfigGuiHandler;
|
||||
#elif POST_MC_1_19_1
|
||||
#elif POST_MC_1_19
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
#else // 1.18+ untill 1.19
|
||||
import net.minecraftforge.client.ConfigGuiHandler;
|
||||
#endif
|
||||
|
||||
// these imports change due to forge refactoring classes in 1.19
|
||||
#if POST_MC_1_19_1
|
||||
#if POST_MC_1_19
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.client.model.data.ModelData;
|
||||
@@ -109,7 +109,7 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
#if PRE_MC_1_17_1
|
||||
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
||||
() -> (client, parent) -> ConfigGui.getScreen(parent, ""));
|
||||
#elif POST_MC_1_19_1
|
||||
#elif POST_MC_1_19
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
|
||||
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> ConfigGui.getScreen(parent, "")));
|
||||
#else
|
||||
@@ -120,21 +120,21 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
|
||||
}
|
||||
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19_
|
||||
private final ModelDataMap modelData = new ModelDataMap.Builder().build();
|
||||
#else
|
||||
private final ModelData modelData = ModelData.EMPTY;
|
||||
#endif
|
||||
|
||||
@Override
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, Random random) {
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData);
|
||||
}
|
||||
#else
|
||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random)
|
||||
{
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19_1, RenderType.solid() #endif);
|
||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19, RenderType.solid() #endif);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
#endif
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
@@ -69,7 +69,7 @@ public class MixinOptionsScreen extends Screen {
|
||||
// For now it goes to the client option by default
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
||||
// Add a title to the screen
|
||||
#if PRE_MC_1_19_1
|
||||
#if PRE_MC_1_19
|
||||
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
||||
#else
|
||||
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
package com.seibel.lod.forge.mixins;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_3
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.lod.common.Config;
|
||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||
import com.seibel.lod.core.api.ClientApi;
|
||||
@@ -85,7 +89,7 @@ public class MixinWorldRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#else
|
||||
#elif PRE_MC_1_19_3
|
||||
@Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true)
|
||||
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
|
||||
// get the partial ticks since renderChunkLayer doesn't
|
||||
@@ -110,5 +114,30 @@ public class MixinWorldRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#else
|
||||
@Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true)
|
||||
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
|
||||
// get the partial ticks since renderChunkLayer doesn't
|
||||
// have access to them
|
||||
previousPartialTicks = tickDelta;
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"),
|
||||
method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V",
|
||||
cancellable = true)
|
||||
private void renderChunkLayer(RenderType renderType, PoseStack modelViewMatrixStack, double cameraXBlockPos, double cameraYBlockPos, double cameraZBlockPos, Matrix4f projectionMatrix, CallbackInfo callback)
|
||||
{
|
||||
// only render before solid blocks
|
||||
if (renderType.equals(RenderType.solid()))
|
||||
{
|
||||
Mat4f mcModelViewMatrix = McObjectConverter.Convert(modelViewMatrixStack.last().pose());
|
||||
Mat4f mcProjectionMatrix = McObjectConverter.Convert(projectionMatrix);
|
||||
|
||||
ClientApi.INSTANCE.renderLods(mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
|
||||
}
|
||||
if (Config.Client.Advanced.lodOnlyMode) {
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
modLoader="javafml" #//mandatory
|
||||
loaderVersion="[40,43)" # // mandatory. This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
loaderVersion="[40,46)" # // mandatory. This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
license="GNU GPLv3"
|
||||
issueTrackerURL="${issues}"
|
||||
|
||||
@@ -29,4 +28,4 @@ issueTrackerURL="${issues}"
|
||||
mandatory=true
|
||||
versionRange="[41.0.95,)" #// NOTE: this will cause issues for anything using MC 1.18 and lower, this is only here for MC 1.19
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
side="BOTH"
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ maven_group=com.seibel.lod
|
||||
archives_base_name=DistantHorizons
|
||||
|
||||
# Mod info
|
||||
mod_version=1.6.8a
|
||||
mod_version=1.6.11a
|
||||
mod_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.
|
||||
mod_authors=["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"]
|
||||
@@ -17,7 +17,7 @@ mod_issues=https://gitlab.com/jeseibel/minecraft-lod-mod/-/issues
|
||||
toml_version=3.6.4
|
||||
manifold_version=2022.1.18
|
||||
enabled_platforms=fabric,forge
|
||||
mcVersions=1.16.5,1.17.1,1.18.1,1.18.2,1.19,1.19.1
|
||||
mcVersions=1.16.5,1.17.1,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4
|
||||
|
||||
##### FOR IDE SUPPORT AND TELL IDE TO USE CERTIAN MC VERSION: SWITCH THIS:
|
||||
mcVer=1.19.1
|
||||
mcVer=1.19.4
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
@echo off
|
||||
|
||||
SETLOCAL
|
||||
CALL :buildVersion "1.19"
|
||||
CALL :buildVersion "1.18.2"
|
||||
CALL :buildVersion "1.18.1"
|
||||
CALL :buildVersion "1.17.1"
|
||||
CALL :buildVersion "1.16.5"
|
||||
EXIT /B %ERRORLEVEL%
|
||||
|
||||
:buildVersion
|
||||
@echo on
|
||||
call ./gradlew.bat clean -PmcVer="%~1" --no-daemon
|
||||
call ./gradlew.bat core:build -PmcVer="%~1" --no-daemon
|
||||
call ./gradlew.bat build -PmcVer="%~1" --no-daemon
|
||||
call ./gradlew.bat mergeJars -PmcVer="%~1" --no-daemon
|
||||
@echo off
|
||||
EXIT /B 0
|
||||
Reference in New Issue
Block a user