Compare commits
22 Commits
2.0.0a
...
Archive-1.18.X
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f37f7f02a | |||
| a88feda9ec | |||
| 07b7ecb30a | |||
| 32bbe487c0 | |||
| b367e5c3aa | |||
| a43b2b69a6 | |||
| 2a1de6f579 | |||
| 7dadff4219 | |||
| 07c53a02ca | |||
| 1e54885d88 | |||
| 68f4084ab0 | |||
| 6fa968e016 | |||
| 93c2078724 | |||
| 2289d898ce | |||
| 15e5a04ffd | |||
| 150ba98a4e | |||
| d9484c9df4 | |||
| a92e09c2be | |||
| f7e1dc378f | |||
| f7b84b1909 | |||
| abae2f6358 | |||
| e83939f1b2 |
@@ -9,6 +9,7 @@ fabric_api_version=0.46.6+1.18
|
||||
# Fabric mod versions
|
||||
modmenu_version=3.0.1
|
||||
starlight_version_fabric=3554912
|
||||
phosphor_version_fabric=3573395
|
||||
lithium_version=mc1.18.1-0.7.7
|
||||
sodium_version=3605309
|
||||
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
|
||||
# 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
|
||||
|
||||
+3
-1
@@ -10,6 +10,7 @@ fabric_api_version=0.48.0+1.18.2
|
||||
# Fabric mod versions
|
||||
modmenu_version=3.1.0
|
||||
starlight_version_fabric=3667443
|
||||
phosphor_version_fabric=3573395
|
||||
lithium_version=mc1.18.2-0.7.9
|
||||
sodium_version=3669187
|
||||
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
|
||||
# 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
|
||||
@@ -32,7 +34,7 @@ forge_version=40.0.18
|
||||
starlight_version_forge=0
|
||||
|
||||
# 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
|
||||
# 2 = Can be referenced in code and runs in client
|
||||
enable_starlight_forge=0
|
||||
|
||||
@@ -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
|
||||
|
||||
> 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`
|
||||
|
||||
**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`
|
||||
3. `./gradlew assemble`
|
||||
4. `./gradlew mergeJars`
|
||||
|
||||
@@ -203,6 +203,18 @@ allprojects { p ->
|
||||
runClient.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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-7
@@ -27,15 +27,9 @@ import java.util.stream.Stream;
|
||||
|
||||
public class TintGetterOverrideFast implements BlockAndTintGetter {
|
||||
LevelReader parent;
|
||||
private final Object2ObjectArrayMap<ColorResolver, ConcurrentHashMap<Biome, Integer>> tintCaches;
|
||||
|
||||
public TintGetterOverrideFast(LevelReader 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) {
|
||||
@@ -49,7 +43,7 @@ public class TintGetterOverrideFast implements BlockAndTintGetter {
|
||||
@Override
|
||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||
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
|
||||
|
||||
+1
-8
@@ -26,17 +26,11 @@ import java.util.stream.Stream;
|
||||
|
||||
public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
||||
LevelReader parent;
|
||||
private final Object2ObjectArrayMap<ColorResolver, BlockTintCache> tintCaches;
|
||||
public int smoothingRange;
|
||||
|
||||
public TintGetterOverrideSmooth(LevelReader parent, int smoothingRange) {
|
||||
this.parent = parent;
|
||||
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) {
|
||||
@@ -71,8 +65,7 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
||||
|
||||
@Override
|
||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||
BlockTintCache blockTintCache = this.tintCaches.get(colorResolver);
|
||||
return blockTintCache.getColor(blockPos);
|
||||
return calculateBlockTint(blockPos, colorResolver);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+16
-7
@@ -10,11 +10,9 @@ import com.mojang.blaze3d.platform.NativeImage;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.seibel.lod.common.wrappers.misc.LightMapWrapper;
|
||||
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.SingletonHandler;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
|
||||
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
|
||||
import com.mojang.math.Vector3f;
|
||||
@@ -214,13 +212,14 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
}
|
||||
return getMaximumRenderedChunks();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int[] getLightmapPixels()
|
||||
{
|
||||
LightTexture tex = GAME_RENDERER.lightTexture();
|
||||
tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug
|
||||
NativeImage lightMapPixels = tex.lightPixels;
|
||||
//tex.tick(); // This call makes no sense, but it fixes pause menu flicker bug
|
||||
NativeImage lightMapPixels = tex.lightTexture.getPixels();
|
||||
LightMapWrapper lightMap = new LightMapWrapper(lightMapPixels);
|
||||
|
||||
|
||||
@@ -260,9 +259,17 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ILightMapWrapper getLightmapWrapper() {
|
||||
return new LightMapWrapper(GAME_RENDERER.lightTexture());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getLightmapTextureHeight()
|
||||
{
|
||||
int height = -1;
|
||||
@@ -281,6 +288,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getLightmapTextureWidth()
|
||||
{
|
||||
int width = -1;
|
||||
@@ -300,6 +308,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getLightmapGLFormat() {
|
||||
int glFormat = -1;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.seibel.lod.common.wrappers.misc;
|
||||
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.lwjgl.opengl.GL32;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
@@ -11,11 +13,17 @@ public class LightMapWrapper implements ILightMapWrapper
|
||||
{
|
||||
static NativeImage lightMap = null;
|
||||
|
||||
private LightTexture tex;
|
||||
|
||||
public LightMapWrapper(NativeImage newLightMap)
|
||||
{
|
||||
lightMap = newLightMap;
|
||||
}
|
||||
|
||||
public LightMapWrapper(LightTexture lightTexture) {
|
||||
tex = lightTexture;
|
||||
}
|
||||
|
||||
public static void setLightMap(NativeImage newLightMap)
|
||||
{
|
||||
lightMap = newLightMap;
|
||||
@@ -26,4 +34,14 @@ public class LightMapWrapper implements ILightMapWrapper
|
||||
{
|
||||
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
|
||||
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;
|
||||
|
||||
|
||||
+1
-1
Submodule core updated: aa3cde0537...02b0637adc
+13
-4
@@ -17,6 +17,10 @@ configurations {
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentFabric.extendsFrom common
|
||||
|
||||
addModJar
|
||||
include.extendsFrom addModJar
|
||||
modImplementation.extendsFrom addModJar
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -36,19 +40,24 @@ dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
|
||||
// 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
|
||||
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}")
|
||||
|
||||
// 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
|
||||
addMod("curse.maven:sodium-394468:${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))
|
||||
|
||||
// Lithium
|
||||
addMod("maven.modrinth:lithium:${rootProject.lithium_version}", rootProject.enable_lithium)
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
"accessWidener" : "lod.accesswidener",
|
||||
"depends": {
|
||||
"fabricloader": "*",
|
||||
"fabric": "*",
|
||||
"fabric-lifecycle-events-v1": "*",
|
||||
"fabric-key-binding-api-v1": "*",
|
||||
"fabric-networking-api-v1": "*",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"java": ">=${java_version}"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user