- Fixed custom rendered models rendering full bright when supposed to render full dark
This commit is contained in:
simibubi 2021-07-11 01:14:38 +02:00
parent 3f57eeacb4
commit 2821fd7135
4 changed files with 8 additions and 7 deletions

View File

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
# mod version info
mod_version = 0.3.2
mod_version = 0.3.2a
minecraft_version = 1.16.5
forge_version = 36.1.32

View File

@ -56,7 +56,7 @@ public class Create {
public static final String ID = "create";
public static final String NAME = "Create";
public static final String VERSION = "0.3.2";
public static final String VERSION = "0.3.2a";
public static final Logger LOGGER = LogManager.getLogger();

View File

@ -49,6 +49,7 @@ public class SuperByteBuffer {
// Vertex Lighting
private boolean useWorldLight;
private boolean hybridLight;
private boolean useCustomLightCoords;
private int packedLightCoords;
private Matrix4f lightTransform;
@ -100,7 +101,6 @@ public class SuperByteBuffer {
WORLD_LIGHT_CACHE.clear();
}
boolean hasDefaultLight = packedLightCoords != 0;
float f = .5f;
int vertexCount = template.getVertexCount();
for (int i = 0; i < vertexCount; i++) {
@ -177,10 +177,9 @@ public class SuperByteBuffer {
}
light = getLight(Minecraft.getInstance().world, lightPos);
if (hasDefaultLight) {
if (useCustomLightCoords)
light = maxLight(light, packedLightCoords);
}
} else if (hasDefaultLight) {
} else if (useCustomLightCoords) {
light = packedLightCoords;
} else {
light = template.getLight(i);
@ -213,6 +212,7 @@ public class SuperByteBuffer {
hasOverlay = false;
overlay = OverlayTexture.DEFAULT_UV;
useWorldLight = false;
useCustomLightCoords = false;
hybridLight = false;
packedLightCoords = 0;
lightTransform = null;
@ -368,6 +368,7 @@ public class SuperByteBuffer {
}
public SuperByteBuffer light(int packedLightCoords) {
useCustomLightCoords = true;
this.packedLightCoords = packedLightCoords;
return this;
}

View File

@ -5,7 +5,7 @@ license="MIT"
[[mods]]
modId="create"
version="v0.3.2 for 1.16.5"
version="v0.3.2a for 1.16.5"
displayName="Create"
#updateJSONURL=""
displayURL="https://www.curseforge.com/minecraft/mc-mods/create"