Skip to content

Commit

Permalink
Fix particles becoming dark, fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
Hantonik committed Sep 15, 2024
1 parent e67d366 commit 9a2c27e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 40 deletions.
7 changes: 6 additions & 1 deletion Common/src/main/java/hantonik/fbp/util/FBPConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ public final class FBPConstants {
public static final ParticleRenderType FBP_PARTICLE_RENDER = new ParticleRenderType() {
@Override
public void begin(BufferBuilder buffer, @NotNull TextureManager manager) {
Minecraft.getInstance().gameRenderer.lightTexture().turnOnLightLayer();

RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShader(GameRenderer::getParticleShader);

RenderSystem.enableCull();

Expand All @@ -78,9 +80,12 @@ public void end(Tesselator tesselator) {
public static final ParticleRenderType FBP_TERRAIN_RENDER = new ParticleRenderType() {
@Override
public void begin(BufferBuilder buffer, TextureManager manager) {
Minecraft.getInstance().gameRenderer.lightTexture().turnOnLightLayer();

RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShader(GameRenderer::getRendertypeTranslucentShader);
Expand Down
3 changes: 2 additions & 1 deletion Common/src/main/java/hantonik/fbp/util/FBPRenderHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import hantonik.fbp.platform.Services;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.util.Mth;
import org.joml.Vector2f;
import org.joml.Vector3d;
Expand Down Expand Up @@ -69,7 +70,7 @@ public static void renderCubeShaded(VertexConsumer buffer, Vector2f[] uv, double
}

public static void addVertex(VertexConsumer buffer, Vector3d pos, float u, float v, int light, float red, float green, float blue, float alpha, Vector3d normal) {
buffer.vertex(pos.x, pos.y, pos.z).color(red, green, blue, alpha).uv(u, v).uv2(light).normal((float) normal.x, (float) normal.y, (float) normal.z).endVertex();
buffer.vertex(pos.x, pos.y, pos.z).color(red, green, blue, alpha).uv(u, v).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(light).normal((float) normal.x, (float) normal.y, (float) normal.z).endVertex();
}

public static Vector3d rotate(Vector3d vector, float angleX, float angleY, float angleZ) {
Expand Down
3 changes: 1 addition & 2 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ mixin {
add sourceSets.main, "${mod_id}.refmap.json"

config "${mod_id}.mixins.json"
config "${mod_id}.forge.mixins.json"
}

println "Forge: $forge_version"
Expand Down Expand Up @@ -98,7 +97,7 @@ jar {

manifest {
attributes([
'MixinConfigs': "${mod_id}.mixins.json,${mod_id}.forge.mixins.json"
'MixinConfigs': "${mod_id}.mixins.json"
])
}

Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions Forge/src/main/resources/fbp.forge.mixins.json

This file was deleted.

3 changes: 2 additions & 1 deletion update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"homepage": "https://www.curseforge.com/minecraft/mc-mods/fbp-renewed",

"promos": {
"1.19.4-latest": "19.4.0.3-beta"
"1.19.4-latest": "19.4.0.4-beta"
},

"1.19.4": {
"19.4.0.4-beta": "Fix particles becoming dark",
"19.4.0.3-beta": "Fix a crash on Freeze effect",
"19.4.0.2-beta": "Fix publication on Modrinth",
"19.4.0.1-beta": "Fix crash when config file is corrupt",
Expand Down

0 comments on commit 9a2c27e

Please sign in to comment.