Fix lightmap, again.

This commit is contained in:
TomTheFurry
2022-04-09 15:21:59 +08:00
parent 7eb0d62f75
commit 25d2b9df7b
5 changed files with 4 additions and 34 deletions
@@ -135,10 +135,6 @@ public class LodBufferBuilderFactory {
// only allow one generation process to happen at a time
if (builderThreadRunning) return false;
if (MC.getCurrentLightMap() == null)
// the lighting hasn't loaded yet
return false;
builderThreadRunning = true;
Runnable thread = () -> generateLodBuffersThread(renderer, lodDim, playerX, playerY, playerZ, fullRegen);
@@ -169,6 +169,8 @@ public class LodRenderer
// which blindness relies on.
return;
}
if (MC_RENDER.getLightmapWrapper() == null)
return;
// get MC's shader program
// Save all MC render state
@@ -70,20 +70,7 @@ public interface IMinecraftClientWrapper extends IBindable
IDimensionTypeWrapper getCurrentDimension();
String getCurrentDimensionId();
/** This texture changes every frame */
ILightMapWrapper getCurrentLightMap();
/**
* Returns the color int at the given pixel coordinates
* from the current lightmap.
* @param blockLight x location in texture space
* @param skyLight z location in texture space
*/
int getColorIntFromLightMap(int blockLight, int skyLight);
//=============//
// Simple gets //
//=============//
@@ -35,6 +35,7 @@ import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.misc.ILightMapWrapper;
import com.seibel.lod.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
import org.jetbrains.annotations.Nullable;
/**
* Contains everything related to
@@ -130,22 +131,8 @@ public interface IMinecraftRenderWrapper extends IBindable
}
return renderedPos;
}
/** @returns null if there was a issue getting the lightmap */
@Deprecated
int[] getLightmapPixels();
ILightMapWrapper getLightmapWrapper();
/** @returns -1 if there was an issue getting the lightmap */
@Deprecated
int getLightmapTextureHeight();
/** @returns -1 if there was an issue getting the lightmap */
@Deprecated
int getLightmapTextureWidth();
/** @returns -1 if there was an issue getting the lightmap */
@Deprecated
int getLightmapGLFormat();
// Try and disable vanilla fog. Return true if successful, or false if not able to.
boolean tryDisableVanillaFog();
@@ -27,8 +27,6 @@ import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
*/
public interface ILightMapWrapper extends IBindable
{
@Deprecated
int getLightValue(int skyLight, int blockLight);
// Returns the binded texture position
void bind();