Fix the particle renderer not setting GL state between each type. MC-168672

This commit is contained in:
LexManos 2020-01-02 19:02:42 -08:00
parent ca031ca33f
commit 1e053298be
1 changed files with 13 additions and 3 deletions

View File

@ -39,17 +39,27 @@
this.field_187241_h.add(p_78873_1_);
}
@@ -312,7 +313,8 @@
@@ -305,14 +306,18 @@
public void func_228345_a_(MatrixStack p_228345_1_, IRenderTypeBuffer.Impl p_228345_2_, LightTexture p_228345_3_, ActiveRenderInfo p_228345_4_, float p_228345_5_) {
p_228345_3_.func_205109_c();
+ Runnable enable = () -> {
RenderSystem.enableAlphaTest();
RenderSystem.defaultAlphaFunc();
RenderSystem.enableDepthTest();
RenderSystem.enableFog();
+ };
RenderSystem.pushMatrix();
RenderSystem.multMatrix(p_228345_1_.func_227866_c_().func_227870_a_());
- for(IParticleRenderType iparticlerendertype : field_215241_b) {
+ for(IParticleRenderType iparticlerendertype : this.field_78876_b.keySet()) { // Forge: allow custom IParticleRenderType's
+ if (iparticlerendertype == IParticleRenderType.field_217606_f) continue;
+ enable.run(); //Forge: MC-168672 Make sure all render types have the correct GL state.
Iterable<Particle> iterable = this.field_78876_b.get(iparticlerendertype);
if (iterable != null) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -351,7 +353,7 @@
@@ -351,7 +356,7 @@
}
public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) {
@ -58,7 +68,7 @@
VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_);
double d0 = 0.25D;
voxelshape.func_197755_b((p_228348_3_, p_228348_5_, p_228348_7_, p_228348_9_, p_228348_11_, p_228348_13_) -> {
@@ -423,6 +425,12 @@
@@ -423,6 +428,12 @@
return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum());
}