Compare commits

..

36 Commits

Author SHA1 Message Date
coolGi 268993e38c Fixed 1.19 building 2023-05-01 14:09:40 +09:30
coolGi 752eeeb7af Updated readme, renaming branch to stable and updating dependency versions 2023-05-01 13:33:24 +09:30
coolGi 7f57a7c794 Moved sodium away from cursedforged to modrinth 2023-05-01 13:31:30 +09:30
coolGi 5fb1915c69 Forgot to update the loaderVersion for forge 2023-03-15 12:09:22 +00:00
coolGi a7e2ead7fa Incramented version number 2023-03-15 22:13:02 +10:30
coolGi 21a510c023 Forgot to add build_19_4 to the stages 2023-03-15 11:29:14 +00:00
coolGi b3ee205f49 Added the 1.19 access widener 2023-03-15 21:57:09 +10:30
coolGi e242893a92 Fixed up CI 2023-03-15 21:50:00 +10:30
coolGi 48c5d32093 Updated core submodule 2023-03-15 21:46:44 +10:30
coolGi a3d167a958 Fixed up the build, buildsystem and the transparent lod button. 2023-03-15 21:45:57 +10:30
coolGi 923fe0576f Merge branch '1.19.1_tmp' into '1.19.1_tmp'
Porting to 1.19.4

See merge request jeseibel/minecraft-lod-mod!27
2023-03-15 10:34:17 +00:00
JupiterSky11 9bb1a04402 Made building for 1.19.4 function. 2023-03-15 05:38:20 -04:00
coolGi e355fcd660 1.19.3 port done (I think) 2022-12-21 20:51:57 +10:30
AquaticLava 6c62155d36 Fixed 1.19.3 StepStructureStart and ChunkLoader classes. 2022-12-21 01:27:44 -07:00
coolGi 2d2ea5b44f Fixed multiplayer servers not working 2022-12-20 20:27:47 +10:30
coolGi 05dbe0f07e Forgot to bump the maximum forge loader version 2022-12-20 19:05:27 +10:30
coolGi e27676d06b Updated readme to say how to manually add the core to the merged jar as its broken atm 2022-12-20 19:00:05 +10:30
coolGi 89e32cd17a Hack to make core shadow and relocate stuff 2022-12-20 18:59:13 +10:30
coolGi 8f48d15b1f 1.19.3 99% finished, only a few generation modes left to fix 2022-12-20 18:37:34 +10:30
coolGi 4af31ac5b9 1.19.3 now builds and some things work (code for generator broken tough) 2022-12-20 17:11:55 +10:30
coolGi 993a9a6864 Updated version number 2022-12-20 17:10:23 +10:30
coolGi 9c90db3718 Fixed the accesswidener and TextureAtlasSpriteWrapper, and found the Registries locations. 2022-12-18 21:01:18 +10:30
coolGi 4d37429c49 Fixed most things for 1.19.3. Just need to find where registries are now stored 2022-12-16 17:48:59 +10:30
coolGi e03536f315 Save commit for 1.19.3 port (part 1) 2022-12-11 18:50:45 +10:30
James Seibel 6057141094 update the version number 1.6.8a -> 1.6.9a 2022-08-07 14:25:49 -05:00
James Seibel 55f7e2cd30 Add 1.19.2 support 2022-08-07 14:25:24 -05:00
James Seibel 39e923ae79 update the version number 1.6.7a -> 1.6.8a 2022-07-31 12:07:00 -05:00
coolGi 99852fded6 Fixed gitlab ci and updated readme to say it now supports 1.19.1 2022-07-28 21:00:29 +09:30
coolGi d75bf8afe7 The quickest update to dh. (1.19.1 support) 2022-07-28 20:48:23 +09:30
James Seibel 086185783c Update the required Forge version
41.0.94 is the last version that doesn't work
2022-07-14 01:52:14 +00:00
coolGi 70321c2d0f Changed the version range to say when forge decided to rename stuff 2022-07-13 13:23:29 +09:30
coolGi 9ce353d897 Changed version numbers to 1.6.7 2022-07-12 23:42:07 +09:30
coolGi 1d1a2d455d Changed version numbers to 1.6.7 2022-07-12 23:41:52 +09:30
coolGi fa1e7704e0 Forge fix *again. For the 2nd time.* **In the same update.** 2022-07-12 23:36:36 +09:30
jas35484 1227c56353 Merge branch 'minecraft-lod-mod-1.6.4a_dev' into 1.6.4a_dev
# Conflicts:
#	.gitlab-ci.yml
2022-07-11 07:48:24 -05:00
Mitchell Skaggs 6576f55c55 Fix CI 2022-06-23 04:49:50 -05:00
42 changed files with 776 additions and 97 deletions
+104
View File
@@ -3,6 +3,10 @@ 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
- build_18_1
@@ -149,6 +153,106 @@ build_19:
- cache/
allow_failure: true
# 1.19.1 build
build_19_1:
stage: build_19_1
script:
- echo "Building 1.19.1..."
- ./gradlew deleteMerged -PmcVer="1.19.1" --gradle-user-home cache/;
- ./gradlew clean -PmcVer="1.19.1" --gradle-user-home cache/;
- ./gradlew core:build -PmcVer="1.19.1" --gradle-user-home cache/;
- ./gradlew build -PmcVer="1.19.1" --gradle-user-home cache/;
- ./gradlew mergeJars -PmcVer="1.19.1" --gradle-user-home cache/;
image: eclipse-temurin:17
artifacts:
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
when: always
cache:
key: "gradleCache"
policy: pull-push
paths:
- .gradle
- cache/
allow_failure: true
# unused deployment stage
#deploy:
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+43
View File
@@ -0,0 +1,43 @@
# 1.18.2 version based stuff
java_version = 17
minecraft_version=1.19.1
parchment_version=2022.03.13
compatible_minecraft_versions=["1.19", "1.19.1"]
# 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=42.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
+43
View File
@@ -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
+43
View File
@@ -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
+43
View File
@@ -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
+5 -5
View File
@@ -6,15 +6,15 @@ parchment_version=2022.03.13
compatible_minecraft_versions=["1.19"]
# Fabric loader
fabric_loader_version=0.14.7
fabric_api_version=0.55.3+1.19
fabric_loader_version=0.14.8
fabric_api_version=0.57.0+1.19
# Fabric mod versions
modmenu_version=4.0.0
starlight_version_fabric=0
phosphor_version_fabric=0
lithium_version=0
sodium_version=3820973
iris_version=1.19.x-v1.2.5
sodium_version=mc1.19.2-0.4.4
iris_version=1.19.x-v1.2.6
immersive_portals_version = 0
bclib_version=0
@@ -30,7 +30,7 @@ fabric_api_version=0.55.3+1.19
enable_bclib=0
# Forge loader
forge_version=41.0.85
forge_version=41.0.94
# Forge mod versions
starlight_version_forge=0
terraforged_version=
+51 -12
View File
@@ -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,7 +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.19.3
- 1.19.2
- 1.19.1 & 1.19
- 1.18.2
- 1.18.1 & 1.18
- 1.17.1 & 1.17
@@ -26,10 +30,29 @@ Architectury version: 3.4-SNAPSHOT\
Architectury loom version: 0.12.0-SNAPSHOT\
Java Compiler plugin: Manifold Preprocessor
#### 1.19 mods
Forge version: 41.0.10\
Fabric version: 0.14.7\
Fabric API version: 0.55.3+1.19\
#### 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.1 mods
Forge version: 42.0.0\
Fabric version: 0.14.8\
Fabric API version: 0.58.5+1.19.1\
Modmenu version: 4.0.0
#### 1.18.2 mods
@@ -66,11 +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: 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
@@ -93,7 +120,11 @@ https://fabricmc.net/wiki/tutorial:setup
4. Import the project into eclipse
## Switching Versions
This branch support 5 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
- 1.18.1 (which also runs on 1.18)
@@ -116,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.
+17 -5
View File
@@ -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"
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_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")
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
@@ -400,4 +412,4 @@ subprojects { p ->
p.runClient.enabled = false
p.runServer.enabled = false
}
}
}
+10 -2
View File
@@ -33,10 +33,18 @@ dependencies {
// Mojmap mappings
officialMojangMappings()
// Parchment mappings (it adds parameter mappings & javadoc)
if (rootProject.minecraft_version != "1.19")
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
@@ -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
}
}
@@ -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
}
@@ -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!
@@ -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
);
}
}
@@ -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();
@@ -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
}
}
@@ -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);
@@ -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) {
@@ -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
}
}
@@ -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: ca2b09c2c8...131ba164cf
+11 -3
View File
@@ -107,10 +107,18 @@ dependencies {
// Mojmap mappings
officialMojangMappings()
// Parchment mappings (it adds parameter mappings & javadoc)
if (rootProject.minecraft_version != "1.19")
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));
}
@@ -49,7 +49,7 @@ public class MixinFogRenderer {
private static final float A_EVEN_LARGER_VALUE = 42069420694206942069.F;
@Inject(at = @At("RETURN"), method = "setupFog")
#if PRE_MC_1_19
#if PRE_MC_1_19_1
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, CallbackInfo callback) {
#else
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float g, CallbackInfo callback) {
@@ -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
View File
@@ -61,10 +61,18 @@ dependencies {
// Mojmap mappings
officialMojangMappings()
// Parchment mappings (it adds parameter mappings & javadoc)
if (rootProject.minecraft_version != "1.19")
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,9 +35,15 @@ 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
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.event.world.WorldEvent;
#else
import net.minecraftforge.event.level.BlockEvent;
import net.minecraftforge.event.level.ChunkEvent;
import net.minecraftforge.event.level.LevelEvent;
#endif
import net.minecraftforge.eventbus.api.SubscribeEvent;
/**
@@ -64,30 +70,56 @@ public class ForgeClientProxy
@SubscribeEvent
public void chunkLoadEvent(ChunkEvent.Load event)
{
#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()));
#endif
}
@SubscribeEvent
#if PRE_MC_1_19
public void worldSaveEvent(WorldEvent.Save event)
#else
public void worldSaveEvent(LevelEvent.Save event)
#endif
{
eventApi.worldSaveEvent();
}
/** This is also called when a new dimension loads */
@SubscribeEvent
#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 (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()));
}
#else
if (event.getLevel() != null) {
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getLevel()));
}
#endif
}
@SubscribeEvent
#if PRE_MC_1_19
public void worldUnloadEvent(WorldEvent.Unload event)
{
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
}
#else
public void worldUnloadEvent(LevelEvent.Unload event)
{
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getLevel()));
}
#endif
@SubscribeEvent
public void blockChangeEvent(BlockEvent event)
@@ -99,8 +131,13 @@ public class ForgeClientProxy
event.getClass() == BlockEvent.FluidPlaceBlockEvent.class ||
event.getClass() == BlockEvent.PortalSpawnEvent.class)
{
#if PRE_MC_1_19
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()), event.getWorld());
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType());
#else
IChunkWrapper chunk = new ChunkWrapper(event.getLevel().getChunk(event.getPos()), event.getLevel());
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getLevel().dimensionType());
#endif
// recreate the LOD where the blocks were changed
eventApi.blockChangeEvent(chunk, dimType);
@@ -49,7 +49,9 @@ import net.minecraftforge.fml.loading.FMLLoader;
import net.minecraftforge.fml.ExtensionPoint;
#elif MC_1_17_1
import net.minecraftforge.fmlclient.ConfigGuiHandler;
#else // 1.18+
#elif POST_MC_1_19
import net.minecraftforge.client.ConfigScreenHandler;
#else // 1.18+ untill 1.19
import net.minecraftforge.client.ConfigGuiHandler;
#endif
@@ -107,6 +109,9 @@ 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
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> ConfigGui.getScreen(parent, "")));
#else
ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class,
() -> new ConfigGuiHandler.ConfigGuiFactory((client, parent) -> ConfigGui.getScreen(parent, "")));
@@ -115,7 +120,7 @@ public class ForgeMain implements LodForgeMethodCaller
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
}
#if PRE_MC_1_19
#if PRE_MC_1_19_
private final ModelDataMap modelData = new ModelDataMap.Builder().build();
#else
private final ModelData modelData = ModelData.EMPTY;
@@ -54,7 +54,7 @@ public class MixinFogRenderer
method = "setupFog(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/FogRenderer$FogMode;FZF)V",
remap = // Remap messiness due to this being added by forge.
#if MC_1_16_5 true
#elif PRE_MC_1_19 false
#elif PRE_MC_1_19_1 false
#else true #endif
)
private static void disableSetupFog(Camera camera, FogMode fogMode, float f, boolean bl, float partTick, CallbackInfo callback)
@@ -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
}
+4 -5
View File
@@ -1,6 +1,5 @@
modLoader="javafml" #//mandatory
loaderVersion="[36,42)" # // 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}"
@@ -15,7 +14,7 @@ issueTrackerURL="${issues}"
description= "${description}" #//mandatory. The description text for the mod
logoFile="logo.png"
catalogueImageIcon="icon.png"
credits="Leonardo, Cola, Ran, CoolGi, and Leetom. Without their hard work, Distant Horizons wouldn't be the mod it is today."
credits="Leonardo, Cola, Ran, coolGi, and Leetom. Without their hard work, Distant Horizons wouldn't be the mod it is today."
#// if not set defaults to "false"
clientSideOnly="true"
#// if not set defaults to "BOTH"
@@ -27,6 +26,6 @@ issueTrackerURL="${issues}"
[[dependencies.lod]]
modId="forge"
mandatory=true
versionRange="[41.0.64,)" #// NOTE: this will cause issues for anything using MC 1.18 and lower, this is only here for MC 1.19
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
View File
@@ -5,7 +5,7 @@ maven_group=com.seibel.lod
archives_base_name=DistantHorizons
# Mod info
mod_version=1.6.6a
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
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
mcVer=1.19.4
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-18
View File
@@ -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