Compare commits

...

22 Commits

Author SHA1 Message Date
Ran 3f37f7f02a Update Readme.md 2022-04-17 17:00:53 +00:00
TomTheFurry a88feda9ec Fix it so it build 2022-04-04 15:47:49 +08:00
TomTheFurry 07b7ecb30a Maybe fixed the light again? 2022-04-04 12:01:01 +08:00
TomTheFurry 32bbe487c0 Fix dumb stuff costing performance on world gen 2022-04-03 16:02:06 +08:00
TomTheFurry b367e5c3aa Fix dumb stuff costing performance on world gen 2022-04-03 16:01:54 +08:00
TomTheFurry a43b2b69a6 Fix up big blocks missing side faces 2022-04-03 13:06:18 +08:00
James Seibel 2a1de6f579 add missing fabric libraries for sodium 2022-04-02 23:46:31 -05:00
James Seibel 7dadff4219 automatically copy lod.accesswidener when building
By default the fabric build folder needs this file to run, but it wasn't being copied over, now it should be.
2022-04-02 23:08:33 -05:00
James Seibel 07c53a02ca Add phosphor as an option to build.gradle 2022-04-02 23:06:57 -05:00
TomTheFurry 1e54885d88 Disabled framebuffer fix for now making optifine shaders to work again 2022-04-02 22:24:17 +08:00
TomTheFurry 68f4084ab0 Fix coolGi's java-8 port 2022-04-02 22:18:40 +08:00
TomTheFurry 6fa968e016 Make lightmap fix works with Optifine shaders? 2022-04-02 21:11:38 +08:00
TomTheFurry 93c2078724 Make lightmap fix works with Optifine shaders? 2022-04-02 21:09:39 +08:00
TomTheFurry 2289d898ce Update core. 2022-04-02 15:25:28 +08:00
TomTheFurry 15e5a04ffd Maybe fixed colormatic's mod compat? 2022-04-02 13:49:28 +08:00
TomTheFurry 150ba98a4e MacOS Patch Successful! + fix missing fabric api 2022-04-01 19:46:54 +08:00
coolGi2007 d9484c9df4 Why dose the readme still say preprocessor_test 2022-04-01 08:26:59 +00:00
James Seibel a92e09c2be Merge branch '1.18.X' of gitlab.com:jeseibel/minecraft-lod-mod into 1.18.X 2022-03-31 21:23:41 -05:00
James Seibel f7e1dc378f Fix the default folder selection if sub-dimensions are disabled 2022-03-31 21:23:38 -05:00
Ran f7b84b1909 It was nice knowing you fabric-api 2022-03-31 14:49:53 +06:00
Ran abae2f6358 I forgor 2022-03-31 14:35:03 +06:00
Ran e83939f1b2 Remove fabric api as a dependency 2022-03-31 14:30:41 +06:00
12 changed files with 74 additions and 30 deletions
+2
View File
@@ -9,6 +9,7 @@ fabric_api_version=0.46.6+1.18
# Fabric mod versions # Fabric mod versions
modmenu_version=3.0.1 modmenu_version=3.0.1
starlight_version_fabric=3554912 starlight_version_fabric=3554912
phosphor_version_fabric=3573395
lithium_version=mc1.18.1-0.7.7 lithium_version=mc1.18.1-0.7.7
sodium_version=3605309 sodium_version=3605309
iris_version=1.18.x-v1.1.4 iris_version=1.18.x-v1.1.4
@@ -20,6 +21,7 @@ fabric_api_version=0.46.6+1.18
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_starlight=0 enable_starlight=0
enable_phosphor=0
enable_sodium=1 enable_sodium=1
enable_lithium=0 enable_lithium=0
enable_iris=0 enable_iris=0
+3 -1
View File
@@ -10,6 +10,7 @@ fabric_api_version=0.48.0+1.18.2
# Fabric mod versions # Fabric mod versions
modmenu_version=3.1.0 modmenu_version=3.1.0
starlight_version_fabric=3667443 starlight_version_fabric=3667443
phosphor_version_fabric=3573395
lithium_version=mc1.18.2-0.7.9 lithium_version=mc1.18.2-0.7.9
sodium_version=3669187 sodium_version=3669187
iris_version=1.18.x-v1.2.2 iris_version=1.18.x-v1.2.2
@@ -21,6 +22,7 @@ fabric_api_version=0.48.0+1.18.2
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_starlight=0 enable_starlight=0
enable_phosphor=0
enable_sodium=1 enable_sodium=1
enable_lithium=0 enable_lithium=0
enable_iris=0 enable_iris=0
@@ -32,7 +34,7 @@ forge_version=40.0.18
starlight_version_forge=0 starlight_version_forge=0
# Forge mod run # Forge mod run
# 0 = Dont enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_starlight_forge=0 enable_starlight_forge=0
+3 -1
View File
@@ -1,3 +1,5 @@
# THIS VERSION IS NO LONGER MAINTAINED! ALL DEVELOPMENT HAVE BEEN MOVED OVER TO THE MAIN BRANCH
# <img src="https://gitlab.com/jeseibel/distant-horizons-core/-/raw/main/_logo%20files/LOD%20logo%20flat%20-%20with%20boarder.png" width="32"> Distant Horizons # <img src="https://gitlab.com/jeseibel/distant-horizons-core/-/raw/main/_logo%20files/LOD%20logo%20flat%20-%20with%20boarder.png" width="32"> Distant Horizons
> A mod that adds a Level of Detail System to Minecraft > A mod that adds a Level of Detail System to Minecraft
@@ -80,7 +82,7 @@ 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` 6. The compiled jar file will be in the folder `Merged`
**If in terminal:** **If in terminal:**
1. `git clone -b preprocessor_test --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git` 1. `git clone -b 1.18.X --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
2. `cd minecraft-lod-mod` 2. `cd minecraft-lod-mod`
3. `./gradlew assemble` 3. `./gradlew assemble`
4. `./gradlew mergeJars` 4. `./gradlew mergeJars`
+12
View File
@@ -203,6 +203,18 @@ allprojects { p ->
runClient.enabled = false runClient.enabled = false
runServer.enabled = false runServer.enabled = false
} }
// this is necessary for running the fabric build
if (p == project(":common")) {
println "Coping [common/src/main/resources/lod.accesswidner] to [fabric/build/resources/main]."
copy {
from "$rootProject.rootDir/common/src/main/resources"
into "$rootProject.rootDir/fabric/build/resources/main"
include "*.accesswidener"
}
}
} }
@@ -27,15 +27,9 @@ import java.util.stream.Stream;
public class TintGetterOverrideFast implements BlockAndTintGetter { public class TintGetterOverrideFast implements BlockAndTintGetter {
LevelReader parent; LevelReader parent;
private final Object2ObjectArrayMap<ColorResolver, ConcurrentHashMap<Biome, Integer>> tintCaches;
public TintGetterOverrideFast(LevelReader parent) { public TintGetterOverrideFast(LevelReader parent) {
this.parent = parent; this.parent = parent;
this.tintCaches = Util.make(new Object2ObjectArrayMap(3), object2ObjectArrayMap -> {
object2ObjectArrayMap.put(BiomeColors.GRASS_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
object2ObjectArrayMap.put(BiomeColors.FOLIAGE_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
object2ObjectArrayMap.put(BiomeColors.WATER_COLOR_RESOLVER, new ConcurrentHashMap<Biome, Integer>());
});
} }
private Biome _getBiome(BlockPos pos) { private Biome _getBiome(BlockPos pos) {
@@ -49,7 +43,7 @@ public class TintGetterOverrideFast implements BlockAndTintGetter {
@Override @Override
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) { public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
Biome b = _getBiome(blockPos); Biome b = _getBiome(blockPos);
return tintCaches.get(colorResolver).computeIfAbsent(b, (key) -> colorResolver.getColor(b, blockPos.getX(), blockPos.getZ())); return colorResolver.getColor(b, blockPos.getX(), blockPos.getZ());
} }
@Override @Override
@@ -26,17 +26,11 @@ import java.util.stream.Stream;
public class TintGetterOverrideSmooth implements BlockAndTintGetter { public class TintGetterOverrideSmooth implements BlockAndTintGetter {
LevelReader parent; LevelReader parent;
private final Object2ObjectArrayMap<ColorResolver, BlockTintCache> tintCaches;
public int smoothingRange; public int smoothingRange;
public TintGetterOverrideSmooth(LevelReader parent, int smoothingRange) { public TintGetterOverrideSmooth(LevelReader parent, int smoothingRange) {
this.parent = parent; this.parent = parent;
this.smoothingRange = smoothingRange; this.smoothingRange = smoothingRange;
this.tintCaches = Util.make(new Object2ObjectArrayMap(3), object2ObjectArrayMap -> {
object2ObjectArrayMap.put(BiomeColors.GRASS_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.GRASS_COLOR_RESOLVER)));
object2ObjectArrayMap.put(BiomeColors.FOLIAGE_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.FOLIAGE_COLOR_RESOLVER)));
object2ObjectArrayMap.put(BiomeColors.WATER_COLOR_RESOLVER, new BlockTintCache((pos) -> calculateBlockTint(pos, BiomeColors.WATER_COLOR_RESOLVER)));
});
} }
private Biome _getBiome(BlockPos pos) { private Biome _getBiome(BlockPos pos) {
@@ -71,8 +65,7 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter {
@Override @Override
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) { public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
BlockTintCache blockTintCache = this.tintCaches.get(colorResolver); return calculateBlockTint(blockPos, colorResolver);
return blockTintCache.getColor(blockPos);
} }
@Override @Override
@@ -10,11 +10,9 @@ import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import com.seibel.lod.common.wrappers.misc.LightMapWrapper; import com.seibel.lod.common.wrappers.misc.LightMapWrapper;
import com.seibel.lod.core.api.ApiShared; import com.seibel.lod.core.api.ApiShared;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler; import com.seibel.lod.core.handlers.dependencyInjection.ModAccessorHandler;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.LightTexture;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
@@ -214,13 +212,14 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
} }
return getMaximumRenderedChunks(); return getMaximumRenderedChunks();
} }
@Override @Override
@Deprecated
public int[] getLightmapPixels() public int[] getLightmapPixels()
{ {
LightTexture tex = GAME_RENDERER.lightTexture(); LightTexture tex = GAME_RENDERER.lightTexture();
tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug //tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug
NativeImage lightMapPixels = tex.lightPixels; NativeImage lightMapPixels = tex.lightTexture.getPixels();
LightMapWrapper lightMap = new LightMapWrapper(lightMapPixels); LightMapWrapper lightMap = new LightMapWrapper(lightMapPixels);
@@ -260,9 +259,17 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
return pixels; return pixels;
} }
@Override
public ILightMapWrapper getLightmapWrapper() {
return new LightMapWrapper(GAME_RENDERER.lightTexture());
}
@Override @Override
@Deprecated
public int getLightmapTextureHeight() public int getLightmapTextureHeight()
{ {
int height = -1; int height = -1;
@@ -281,6 +288,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
} }
@Override @Override
@Deprecated
public int getLightmapTextureWidth() public int getLightmapTextureWidth()
{ {
int width = -1; int width = -1;
@@ -300,6 +308,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
@Override @Override
@Deprecated
public int getLightmapGLFormat() { public int getLightmapGLFormat() {
int glFormat = -1; int glFormat = -1;
@@ -2,6 +2,8 @@ package com.seibel.lod.common.wrappers.misc;
import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.NativeImage;
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper; import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
import net.minecraft.client.renderer.LightTexture;
import org.lwjgl.opengl.GL32;
/** /**
* @author James Seibel * @author James Seibel
@@ -11,11 +13,17 @@ public class LightMapWrapper implements ILightMapWrapper
{ {
static NativeImage lightMap = null; static NativeImage lightMap = null;
private LightTexture tex;
public LightMapWrapper(NativeImage newLightMap) public LightMapWrapper(NativeImage newLightMap)
{ {
lightMap = newLightMap; lightMap = newLightMap;
} }
public LightMapWrapper(LightTexture lightTexture) {
tex = lightTexture;
}
public static void setLightMap(NativeImage newLightMap) public static void setLightMap(NativeImage newLightMap)
{ {
lightMap = newLightMap; lightMap = newLightMap;
@@ -26,4 +34,14 @@ public class LightMapWrapper implements ILightMapWrapper
{ {
return lightMap.getPixelRGBA(skyLight, blockLight); return lightMap.getPixelRGBA(skyLight, blockLight);
} }
@Override
public void bind() {
GL32.glBindTexture(GL32.GL_TEXTURE_2D, tex.lightTexture.getId());
}
@Override
public void unbind() {
GL32.glBindTexture(GL32.GL_TEXTURE_2D, 0);
}
} }
@@ -16,6 +16,7 @@ accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chu
# lighting # lighting
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage; 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 blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine; accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
+1 -1
Submodule core updated: aa3cde0537...02b0637adc
+13 -4
View File
@@ -17,6 +17,10 @@ configurations {
compileClasspath.extendsFrom common compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common developmentFabric.extendsFrom common
addModJar
include.extendsFrom addModJar
modImplementation.extendsFrom addModJar
} }
repositories { repositories {
@@ -36,19 +40,24 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Fabric API // Fabric API
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" addModJar(fabricApi.module("fabric-lifecycle-events-v1", rootProject.fabric_api_version))
addModJar(fabricApi.module("fabric-key-binding-api-v1", rootProject.fabric_api_version))
addModJar(fabricApi.module("fabric-networking-api-v1", rootProject.fabric_api_version))
// Mod Menu // Mod Menu
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") { modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
exclude(group: "net.fabricmc.fabric-api")
}
// Starlight // Starlight
addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight) addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight)
// Phosphor
addMod("curse.maven:phosphor-372124:${rootProject.phosphor_version_fabric}", rootProject.enable_phosphor)
// Sodium // Sodium
addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium) addMod("curse.maven:sodium-394468:${rootProject.sodium_version}", rootProject.enable_sodium)
implementation "org.joml:joml:1.10.2" 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))
// Lithium // Lithium
addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium) addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium)
+3 -1
View File
@@ -33,7 +33,9 @@
"accessWidener" : "lod.accesswidener", "accessWidener" : "lod.accesswidener",
"depends": { "depends": {
"fabricloader": "*", "fabricloader": "*",
"fabric": "*", "fabric-lifecycle-events-v1": "*",
"fabric-key-binding-api-v1": "*",
"fabric-networking-api-v1": "*",
"minecraft": "${minecraft_version}", "minecraft": "${minecraft_version}",
"java": ">=${java_version}" "java": ">=${java_version}"
}, },