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 14, 2024
1 parent bd68a2f commit d0116e2
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 75 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 @@ -13,7 +13,6 @@ base {

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

println "Forge: $forge_version"
Expand Down Expand Up @@ -94,7 +93,7 @@ if (minecraft.reobf) {
jar {
manifest {
attributes([
'MixinConfigs': "${mod_id}.mixins.json,${mod_id}.forge.mixins.json"
'MixinConfigs': "${mod_id}.mixins.json"
])
}

Expand Down

This file was deleted.

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

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions NeoForge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ issueTrackerURL="https://github.com/Hantonik/FancyBlockParticles/issues"
credits="Original mod by TominoCZ"
description='''3D Digging particles! YAY!'''

[[mixins]]
config="${mod_id}.neoforge.mixins.json"
[[mixins]]
config="${mod_id}.mixins.json"

Expand Down
9 changes: 0 additions & 9 deletions NeoForge/src/main/resources/fbp.neoforge.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.20.6-latest": "20.6.0.3-beta"
"1.20.6-latest": "20.6.0.4-beta"
},

"1.20.6": {
"20.6.0.4-beta": "Fix particles becoming dark",
"20.6.0.3-beta": "Fix crash when config file is corrupt",
"20.6.0.2-beta": "Fix a crash on Freeze effect",
"20.6.0.1-beta": "Fixed a crash when particles were killed during the freeze effect",
Expand Down

0 comments on commit d0116e2

Please sign in to comment.