Compare commits

...

21 Commits

Author SHA1 Message Date
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
32 changed files with 577 additions and 75 deletions
+79 -1
View File
@@ -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
View File
@@ -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
+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=4145281
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=4145281
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
+23 -7
View File
@@ -16,8 +16,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 +28,23 @@ 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.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
@@ -130,6 +138,14 @@ If running on IDE, to ensure IDE pickup the changed versions, you will need to r
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.
+14 -3
View File
@@ -86,8 +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" : "1_19",
"1.19.2" : "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))
@@ -240,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" && rootProject.minecraft_version != "1.19.2")
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
@@ -401,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" && rootProject.minecraft_version != "1.19.1" && rootProject.minecraft_version != "1.19.2")
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: 5f116f0ea7...131ba164cf
+10 -2
View File
@@ -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" && rootProject.minecraft_version != "1.19.2")
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
@@ -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));
}
@@ -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" && rootProject.minecraft_version != "1.19.1" && rootProject.minecraft_version != "1.19.2")
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
@@ -96,6 +96,7 @@ public class ForgeClientProxy
#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_1
if (event.getWorld() != null) {
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
@@ -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
}
+2 -3
View File
@@ -1,6 +1,5 @@
modLoader="javafml" #//mandatory
loaderVersion="[40,44)" # // 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
View File
@@ -5,7 +5,7 @@ maven_group=com.seibel.lod
archives_base_name=DistantHorizons
# Mod info
mod_version=1.6.9a
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,1.19.2
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.2
mcVer=1.19.4
-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