BlockModelRenderer .java

net.minecraft.client.renderer.BlockModelRenderer (class, 639 lines): members: renderModelAmbientOcclusion, renderModelBrightnessColor, renderModelStandard.

net.minecraft.client.rendererclass639 linesclient38.1 KB

API Surface (9)

boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn)
boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
boolean renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
void renderModelBrightnessColor(IBakedModel bakedModel, float p_178262_2_, float red, float green, float blue)
void renderModelBrightness(IBakedModel model, IBlockState p_178266_2_, float brightness, boolean p_178266_4_)
void updateVertexBrightness(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags)
BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_)
BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_)

String literals (3)

"Tesselating block model"
"Block model being tesselated"
"Using AO"

Full Source

BlockModelRenderer.java639 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.renderer;
2
3
import java.util.BitSet;
4
import java.util.List;
5
import net.minecraft.block.Block;
6
import net.minecraft.block.state.IBlockState;
7
import net.minecraft.client.Minecraft;
8
import net.minecraft.client.renderer.block.model.BakedQuad;
9
import net.minecraft.client.renderer.texture.TextureUtil;
10
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
11
import net.minecraft.client.resources.model.IBakedModel;
12
import net.minecraft.crash.CrashReport;
13
import net.minecraft.crash.CrashReportCategory;
14
import net.minecraft.util.BlockPos;
15
import net.minecraft.util.EnumFacing;
16
import net.minecraft.util.MathHelper;
17
import net.minecraft.util.ReportedException;
18
import net.minecraft.util.Vec3i;
19
import net.minecraft.world.IBlockAccess;
20
21
public class BlockModelRenderer
22
{
23
    public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn)
24
    {
25
        Block block = blockStateIn.getBlock();
26
        block.setBlockBoundsBasedOnState(blockAccessIn, blockPosIn);
27
        return this.renderModel(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, true);
28
    }
29
30
    public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
31
    {
32
        boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();
33
34
        try
35
        {
36
            Block block = blockStateIn.getBlock();
37
            return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides);
38
        }
39
        catch (Throwable throwable)
40
        {
41
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
42
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
43
            CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
44
            crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
45
            throw new ReportedException(crashreport);
46
        }
47
    }
48
49
    public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
50
    {
51
        boolean flag = false;
52
        float[] afloat = new float[EnumFacing.values().length * 2];
53
        BitSet bitset = new BitSet(3);
54
        BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace();
55
56
        for (EnumFacing enumfacing : EnumFacing.values())
57
        {
58
            List<BakedQuad> list = modelIn.getFaceQuads(enumfacing);
59
60
            if (!list.isEmpty())
61
            {
62
                BlockPos blockpos = blockPosIn.offset(enumfacing);
63
64
                if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing))
65
                {
66
                    this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
67
                    flag = true;
68
                }
69
            }
70
        }
71
72
        List<BakedQuad> list1 = modelIn.getGeneralQuads();
73
74
        if (list1.size() > 0)
75
        {
76
            this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
77
            flag = true;
78
        }
79
80
        return flag;
81
    }
82
83
    public boolean renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
84
    {
85
        boolean flag = false;
86
        BitSet bitset = new BitSet(3);
87
88
        for (EnumFacing enumfacing : EnumFacing.values())
89
        {
90
            List<BakedQuad> list = modelIn.getFaceQuads(enumfacing);
91
92
            if (!list.isEmpty())
93
            {
94
                BlockPos blockpos = blockPosIn.offset(enumfacing);
95
96
                if (!checkSides || blockIn.shouldSideBeRendered(blockAccessIn, blockpos, enumfacing))
97
                {
98
                    int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos);
99
                    this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, i, false, worldRendererIn, list, bitset);
100
                    flag = true;
101
                }
102
            }
103
        }
104
105
        List<BakedQuad> list1 = modelIn.getGeneralQuads();
106
107
        if (list1.size() > 0)
108
        {
109
            this.renderModelStandardQuads(blockAccessIn, blockIn, blockPosIn, (EnumFacing)null, -1, true, worldRendererIn, list1, bitset);
110
            flag = true;
111
        }
112
113
        return flag;
114
    }
115
116
    private void renderModelAmbientOcclusionQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, float[] quadBounds, BitSet boundsFlags, BlockModelRenderer.AmbientOcclusionFace aoFaceIn)
117
    {
118
        double d0 = (double)blockPosIn.getX();
119
        double d1 = (double)blockPosIn.getY();
120
        double d2 = (double)blockPosIn.getZ();
121
        Block.EnumOffsetType block$enumoffsettype = blockIn.getOffsetType();
122
123
        if (block$enumoffsettype != Block.EnumOffsetType.NONE)
124
        {
125
            long i = MathHelper.getPositionRandom(blockPosIn);
126
            d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
127
            d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
128
129
            if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
130
            {
131
                d1 += ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
132
            }
133
        }
134
135
        for (BakedQuad bakedquad : listQuadsIn)
136
        {
137
            this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), quadBounds, boundsFlags);
138
            aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds, boundsFlags);
139
            worldRendererIn.addVertexData(bakedquad.getVertexData());
140
            worldRendererIn.putBrightness4(aoFaceIn.vertexBrightness[0], aoFaceIn.vertexBrightness[1], aoFaceIn.vertexBrightness[2], aoFaceIn.vertexBrightness[3]);
141
142
            if (bakedquad.hasTintIndex())
143
            {
144
                int j = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
145
146
                if (EntityRenderer.anaglyphEnable)
147
                {
148
                    j = TextureUtil.anaglyphColor(j);
149
                }
150
151
                float f = (float)(j >> 16 & 255) / 255.0F;
152
                float f1 = (float)(j >> 8 & 255) / 255.0F;
153
                float f2 = (float)(j & 255) / 255.0F;
154
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0] * f, aoFaceIn.vertexColorMultiplier[0] * f1, aoFaceIn.vertexColorMultiplier[0] * f2, 4);
155
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1] * f, aoFaceIn.vertexColorMultiplier[1] * f1, aoFaceIn.vertexColorMultiplier[1] * f2, 3);
156
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2] * f, aoFaceIn.vertexColorMultiplier[2] * f1, aoFaceIn.vertexColorMultiplier[2] * f2, 2);
157
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3] * f, aoFaceIn.vertexColorMultiplier[3] * f1, aoFaceIn.vertexColorMultiplier[3] * f2, 1);
158
            }
159
            else
160
            {
161
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], 4);
162
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], 3);
163
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], 2);
164
                worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], 1);
165
            }
166
167
            worldRendererIn.putPosition(d0, d1, d2);
168
        }
169
    }
170
171
    private void fillQuadBounds(Block blockIn, int[] vertexData, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags)
172
    {
173
        float f = 32.0F;
174
        float f1 = 32.0F;
175
        float f2 = 32.0F;
176
        float f3 = -32.0F;
177
        float f4 = -32.0F;
178
        float f5 = -32.0F;
179
180
        for (int i = 0; i < 4; ++i)
181
        {
182
            float f6 = Float.intBitsToFloat(vertexData[i * 7]);
183
            float f7 = Float.intBitsToFloat(vertexData[i * 7 + 1]);
184
            float f8 = Float.intBitsToFloat(vertexData[i * 7 + 2]);
185
            f = Math.min(f, f6);
186
            f1 = Math.min(f1, f7);
187
            f2 = Math.min(f2, f8);
188
            f3 = Math.max(f3, f6);
189
            f4 = Math.max(f4, f7);
190
            f5 = Math.max(f5, f8);
191
        }
192
193
        if (quadBounds != null)
194
        {
195
            quadBounds[EnumFacing.WEST.getIndex()] = f;
196
            quadBounds[EnumFacing.EAST.getIndex()] = f3;
197
            quadBounds[EnumFacing.DOWN.getIndex()] = f1;
198
            quadBounds[EnumFacing.UP.getIndex()] = f4;
199
            quadBounds[EnumFacing.NORTH.getIndex()] = f2;
200
            quadBounds[EnumFacing.SOUTH.getIndex()] = f5;
201
            quadBounds[EnumFacing.WEST.getIndex() + EnumFacing.values().length] = 1.0F - f;
202
            quadBounds[EnumFacing.EAST.getIndex() + EnumFacing.values().length] = 1.0F - f3;
203
            quadBounds[EnumFacing.DOWN.getIndex() + EnumFacing.values().length] = 1.0F - f1;
204
            quadBounds[EnumFacing.UP.getIndex() + EnumFacing.values().length] = 1.0F - f4;
205
            quadBounds[EnumFacing.NORTH.getIndex() + EnumFacing.values().length] = 1.0F - f2;
206
            quadBounds[EnumFacing.SOUTH.getIndex() + EnumFacing.values().length] = 1.0F - f5;
207
        }
208
209
        float f9 = 1.0E-4F;
210
        float f10 = 0.9999F;
211
212
        switch (facingIn)
213
        {
214
            case DOWN:
215
                boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F);
216
                boundsFlags.set(0, (f1 < 1.0E-4F || blockIn.isFullCube()) && f1 == f4);
217
                break;
218
219
            case UP:
220
                boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F);
221
                boundsFlags.set(0, (f4 > 0.9999F || blockIn.isFullCube()) && f1 == f4);
222
                break;
223
224
            case NORTH:
225
                boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F);
226
                boundsFlags.set(0, (f2 < 1.0E-4F || blockIn.isFullCube()) && f2 == f5);
227
                break;
228
229
            case SOUTH:
230
                boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F);
231
                boundsFlags.set(0, (f5 > 0.9999F || blockIn.isFullCube()) && f2 == f5);
232
                break;
233
234
            case WEST:
235
                boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F);
236
                boundsFlags.set(0, (f < 1.0E-4F || blockIn.isFullCube()) && f == f3);
237
                break;
238
239
            case EAST:
240
                boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F);
241
                boundsFlags.set(0, (f3 > 0.9999F || blockIn.isFullCube()) && f == f3);
242
        }
243
    }
244
245
    private void renderModelStandardQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, BitSet boundsFlags)
246
    {
247
        double d0 = (double)blockPosIn.getX();
248
        double d1 = (double)blockPosIn.getY();
249
        double d2 = (double)blockPosIn.getZ();
250
        Block.EnumOffsetType block$enumoffsettype = blockIn.getOffsetType();
251
252
        if (block$enumoffsettype != Block.EnumOffsetType.NONE)
253
        {
254
            int i = blockPosIn.getX();
255
            int j = blockPosIn.getZ();
256
            long k = (long)(i * 3129871) ^ (long)j * 116129781L;
257
            k = k * k * 42317861L + k * 11L;
258
            d0 += ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
259
            d2 += ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
260
261
            if (block$enumoffsettype == Block.EnumOffsetType.XYZ)
262
            {
263
                d1 += ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
264
            }
265
        }
266
267
        for (BakedQuad bakedquad : listQuadsIn)
268
        {
269
            if (ownBrightness)
270
            {
271
                this.fillQuadBounds(blockIn, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, boundsFlags);
272
                brightnessIn = boundsFlags.get(0) ? blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn.offset(bakedquad.getFace())) : blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn);
273
            }
274
275
            worldRendererIn.addVertexData(bakedquad.getVertexData());
276
            worldRendererIn.putBrightness4(brightnessIn, brightnessIn, brightnessIn, brightnessIn);
277
278
            if (bakedquad.hasTintIndex())
279
            {
280
                int l = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
281
282
                if (EntityRenderer.anaglyphEnable)
283
                {
284
                    l = TextureUtil.anaglyphColor(l);
285
                }
286
287
                float f = (float)(l >> 16 & 255) / 255.0F;
288
                float f1 = (float)(l >> 8 & 255) / 255.0F;
289
                float f2 = (float)(l & 255) / 255.0F;
290
                worldRendererIn.putColorMultiplier(f, f1, f2, 4);
291
                worldRendererIn.putColorMultiplier(f, f1, f2, 3);
292
                worldRendererIn.putColorMultiplier(f, f1, f2, 2);
293
                worldRendererIn.putColorMultiplier(f, f1, f2, 1);
294
            }
295
296
            worldRendererIn.putPosition(d0, d1, d2);
297
        }
298
    }
299
300
    public void renderModelBrightnessColor(IBakedModel bakedModel, float p_178262_2_, float red, float green, float blue)
301
    {
302
        for (EnumFacing enumfacing : EnumFacing.values())
303
        {
304
            this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getFaceQuads(enumfacing));
305
        }
306
307
        this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getGeneralQuads());
308
    }
309
310
    public void renderModelBrightness(IBakedModel model, IBlockState p_178266_2_, float brightness, boolean p_178266_4_)
311
    {
312
        Block block = p_178266_2_.getBlock();
313
        block.setBlockBoundsForItemRender();
314
        GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
315
        int i = block.getRenderColor(block.getStateForEntityRender(p_178266_2_));
316
317
        if (EntityRenderer.anaglyphEnable)
318
        {
319
            i = TextureUtil.anaglyphColor(i);
320
        }
321
322
        float f = (float)(i >> 16 & 255) / 255.0F;
323
        float f1 = (float)(i >> 8 & 255) / 255.0F;
324
        float f2 = (float)(i & 255) / 255.0F;
325
326
        if (!p_178266_4_)
327
        {
328
            GlStateManager.color(brightness, brightness, brightness, 1.0F);
329
        }
330
331
        this.renderModelBrightnessColor(model, brightness, f, f1, f2);
332
    }
333
334
    private void renderModelBrightnessColorQuads(float brightness, float red, float green, float blue, List<BakedQuad> listQuads)
335
    {
336
        Tessellator tessellator = Tessellator.getInstance();
337
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
338
339
        for (BakedQuad bakedquad : listQuads)
340
        {
341
            worldrenderer.begin(7, DefaultVertexFormats.ITEM);
342
            worldrenderer.addVertexData(bakedquad.getVertexData());
343
344
            if (bakedquad.hasTintIndex())
345
            {
346
                worldrenderer.putColorRGB_F4(red * brightness, green * brightness, blue * brightness);
347
            }
348
            else
349
            {
350
                worldrenderer.putColorRGB_F4(brightness, brightness, brightness);
351
            }
352
353
            Vec3i vec3i = bakedquad.getFace().getDirectionVec();
354
            worldrenderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ());
355
            tessellator.draw();
356
        }
357
    }
358
359
    class AmbientOcclusionFace
360
    {
361
        private final float[] vertexColorMultiplier = new float[4];
362
        private final int[] vertexBrightness = new int[4];
363
364
        public void updateVertexBrightness(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags)
365
        {
366
            BlockPos blockpos = boundsFlags.get(0) ? blockPosIn.offset(facingIn) : blockPosIn;
367
            BlockModelRenderer.EnumNeighborInfo blockmodelrenderer$enumneighborinfo = BlockModelRenderer.EnumNeighborInfo.getNeighbourInfo(facingIn);
368
            BlockPos blockpos1 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[0]);
369
            BlockPos blockpos2 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[1]);
370
            BlockPos blockpos3 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]);
371
            BlockPos blockpos4 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]);
372
            int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos1);
373
            int j = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos2);
374
            int k = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos3);
375
            int l = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos4);
376
            float f = blockAccessIn.getBlockState(blockpos1).getBlock().getAmbientOcclusionLightValue();
377
            float f1 = blockAccessIn.getBlockState(blockpos2).getBlock().getAmbientOcclusionLightValue();
378
            float f2 = blockAccessIn.getBlockState(blockpos3).getBlock().getAmbientOcclusionLightValue();
379
            float f3 = blockAccessIn.getBlockState(blockpos4).getBlock().getAmbientOcclusionLightValue();
380
            boolean flag = blockAccessIn.getBlockState(blockpos1.offset(facingIn)).getBlock().isTranslucent();
381
            boolean flag1 = blockAccessIn.getBlockState(blockpos2.offset(facingIn)).getBlock().isTranslucent();
382
            boolean flag2 = blockAccessIn.getBlockState(blockpos3.offset(facingIn)).getBlock().isTranslucent();
383
            boolean flag3 = blockAccessIn.getBlockState(blockpos4.offset(facingIn)).getBlock().isTranslucent();
384
            float f4;
385
            int i1;
386
387
            if (!flag2 && !flag)
388
            {
389
                f4 = f;
390
                i1 = i;
391
            }
392
            else
393
            {
394
                BlockPos blockpos5 = blockpos1.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]);
395
                f4 = blockAccessIn.getBlockState(blockpos5).getBlock().getAmbientOcclusionLightValue();
396
                i1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos5);
397
            }
398
399
            float f5;
400
            int j1;
401
402
            if (!flag3 && !flag)
403
            {
404
                f5 = f;
405
                j1 = i;
406
            }
407
            else
408
            {
409
                BlockPos blockpos6 = blockpos1.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]);
410
                f5 = blockAccessIn.getBlockState(blockpos6).getBlock().getAmbientOcclusionLightValue();
411
                j1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos6);
412
            }
413
414
            float f6;
415
            int k1;
416
417
            if (!flag2 && !flag1)
418
            {
419
                f6 = f1;
420
                k1 = j;
421
            }
422
            else
423
            {
424
                BlockPos blockpos7 = blockpos2.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]);
425
                f6 = blockAccessIn.getBlockState(blockpos7).getBlock().getAmbientOcclusionLightValue();
426
                k1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos7);
427
            }
428
429
            float f7;
430
            int l1;
431
432
            if (!flag3 && !flag1)
433
            {
434
                f7 = f1;
435
                l1 = j;
436
            }
437
            else
438
            {
439
                BlockPos blockpos8 = blockpos2.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]);
440
                f7 = blockAccessIn.getBlockState(blockpos8).getBlock().getAmbientOcclusionLightValue();
441
                l1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos8);
442
            }
443
444
            int i3 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn);
445
446
            if (boundsFlags.get(0) || !blockAccessIn.getBlockState(blockPosIn.offset(facingIn)).getBlock().isOpaqueCube())
447
            {
448
                i3 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn.offset(facingIn));
449
            }
450
451
            float f8 = boundsFlags.get(0) ? blockAccessIn.getBlockState(blockpos).getBlock().getAmbientOcclusionLightValue() : blockAccessIn.getBlockState(blockPosIn).getBlock().getAmbientOcclusionLightValue();
452
            BlockModelRenderer.VertexTranslations blockmodelrenderer$vertextranslations = BlockModelRenderer.VertexTranslations.getVertexTranslations(facingIn);
453
454
            if (boundsFlags.get(1) && blockmodelrenderer$enumneighborinfo.field_178289_i)
455
            {
456
                float f29 = (f3 + f + f5 + f8) * 0.25F;
457
                float f30 = (f2 + f + f4 + f8) * 0.25F;
458
                float f31 = (f2 + f1 + f6 + f8) * 0.25F;
459
                float f32 = (f3 + f1 + f7 + f8) * 0.25F;
460
                float f13 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[1].field_178229_m];
461
                float f14 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[3].field_178229_m];
462
                float f15 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[5].field_178229_m];
463
                float f16 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[7].field_178229_m];
464
                float f17 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[1].field_178229_m];
465
                float f18 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[3].field_178229_m];
466
                float f19 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[5].field_178229_m];
467
                float f20 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[7].field_178229_m];
468
                float f21 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[1].field_178229_m];
469
                float f22 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[3].field_178229_m];
470
                float f23 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[5].field_178229_m];
471
                float f24 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[7].field_178229_m];
472
                float f25 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[1].field_178229_m];
473
                float f26 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[3].field_178229_m];
474
                float f27 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[5].field_178229_m];
475
                float f28 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[7].field_178229_m];
476
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178191_g] = f29 * f13 + f30 * f14 + f31 * f15 + f32 * f16;
477
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178200_h] = f29 * f17 + f30 * f18 + f31 * f19 + f32 * f20;
478
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178201_i] = f29 * f21 + f30 * f22 + f31 * f23 + f32 * f24;
479
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178198_j] = f29 * f25 + f30 * f26 + f31 * f27 + f32 * f28;
480
                int i2 = this.getAoBrightness(l, i, j1, i3);
481
                int j2 = this.getAoBrightness(k, i, i1, i3);
482
                int k2 = this.getAoBrightness(k, j, k1, i3);
483
                int l2 = this.getAoBrightness(l, j, l1, i3);
484
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178191_g] = this.getVertexBrightness(i2, j2, k2, l2, f13, f14, f15, f16);
485
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178200_h] = this.getVertexBrightness(i2, j2, k2, l2, f17, f18, f19, f20);
486
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178201_i] = this.getVertexBrightness(i2, j2, k2, l2, f21, f22, f23, f24);
487
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178198_j] = this.getVertexBrightness(i2, j2, k2, l2, f25, f26, f27, f28);
488
            }
489
            else
490
            {
491
                float f9 = (f3 + f + f5 + f8) * 0.25F;
492
                float f10 = (f2 + f + f4 + f8) * 0.25F;
493
                float f11 = (f2 + f1 + f6 + f8) * 0.25F;
494
                float f12 = (f3 + f1 + f7 + f8) * 0.25F;
495
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178191_g] = this.getAoBrightness(l, i, j1, i3);
496
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178200_h] = this.getAoBrightness(k, i, i1, i3);
497
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178201_i] = this.getAoBrightness(k, j, k1, i3);
498
                this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178198_j] = this.getAoBrightness(l, j, l1, i3);
499
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178191_g] = f9;
500
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178200_h] = f10;
501
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178201_i] = f11;
502
                this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178198_j] = f12;
503
            }
504
        }
505
506
        private int getAoBrightness(int br1, int br2, int br3, int br4)
507
        {
508
            if (br1 == 0)
509
            {
510
                br1 = br4;
511
            }
512
513
            if (br2 == 0)
514
            {
515
                br2 = br4;
516
            }
517
518
            if (br3 == 0)
519
            {
520
                br3 = br4;
521
            }
522
523
            return br1 + br2 + br3 + br4 >> 2 & 16711935;
524
        }
525
526
        private int getVertexBrightness(int p_178203_1_, int p_178203_2_, int p_178203_3_, int p_178203_4_, float p_178203_5_, float p_178203_6_, float p_178203_7_, float p_178203_8_)
527
        {
528
            int i = (int)((float)(p_178203_1_ >> 16 & 255) * p_178203_5_ + (float)(p_178203_2_ >> 16 & 255) * p_178203_6_ + (float)(p_178203_3_ >> 16 & 255) * p_178203_7_ + (float)(p_178203_4_ >> 16 & 255) * p_178203_8_) & 255;
529
            int j = (int)((float)(p_178203_1_ & 255) * p_178203_5_ + (float)(p_178203_2_ & 255) * p_178203_6_ + (float)(p_178203_3_ & 255) * p_178203_7_ + (float)(p_178203_4_ & 255) * p_178203_8_) & 255;
530
            return i << 16 | j;
531
        }
532
    }
533
534
    public static enum EnumNeighborInfo
535
    {
536
        DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]),
537
        UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]),
538
        NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}),
539
        SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}),
540
        WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}),
541
        EAST(new EnumFacing[]{EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH});
542
543
        protected final EnumFacing[] field_178276_g;
544
        protected final float field_178288_h;
545
        protected final boolean field_178289_i;
546
        protected final BlockModelRenderer.Orientation[] field_178286_j;
547
        protected final BlockModelRenderer.Orientation[] field_178287_k;
548
        protected final BlockModelRenderer.Orientation[] field_178284_l;
549
        protected final BlockModelRenderer.Orientation[] field_178285_m;
550
        private static final BlockModelRenderer.EnumNeighborInfo[] VALUES = new BlockModelRenderer.EnumNeighborInfo[6];
551
552
        private EnumNeighborInfo(EnumFacing[] p_i46236_3_, float p_i46236_4_, boolean p_i46236_5_, BlockModelRenderer.Orientation[] p_i46236_6_, BlockModelRenderer.Orientation[] p_i46236_7_, BlockModelRenderer.Orientation[] p_i46236_8_, BlockModelRenderer.Orientation[] p_i46236_9_)
553
        {
554
            this.field_178276_g = p_i46236_3_;
555
            this.field_178288_h = p_i46236_4_;
556
            this.field_178289_i = p_i46236_5_;
557
            this.field_178286_j = p_i46236_6_;
558
            this.field_178287_k = p_i46236_7_;
559
            this.field_178284_l = p_i46236_8_;
560
            this.field_178285_m = p_i46236_9_;
561
        }
562
563
        public static BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_)
564
        {
565
            return VALUES[p_178273_0_.getIndex()];
566
        }
567
568
        static {
569
            VALUES[EnumFacing.DOWN.getIndex()] = DOWN;
570
            VALUES[EnumFacing.UP.getIndex()] = UP;
571
            VALUES[EnumFacing.NORTH.getIndex()] = NORTH;
572
            VALUES[EnumFacing.SOUTH.getIndex()] = SOUTH;
573
            VALUES[EnumFacing.WEST.getIndex()] = WEST;
574
            VALUES[EnumFacing.EAST.getIndex()] = EAST;
575
        }
576
    }
577
578
    public static enum Orientation
579
    {
580
        DOWN(EnumFacing.DOWN, false),
581
        UP(EnumFacing.UP, false),
582
        NORTH(EnumFacing.NORTH, false),
583
        SOUTH(EnumFacing.SOUTH, false),
584
        WEST(EnumFacing.WEST, false),
585
        EAST(EnumFacing.EAST, false),
586
        FLIP_DOWN(EnumFacing.DOWN, true),
587
        FLIP_UP(EnumFacing.UP, true),
588
        FLIP_NORTH(EnumFacing.NORTH, true),
589
        FLIP_SOUTH(EnumFacing.SOUTH, true),
590
        FLIP_WEST(EnumFacing.WEST, true),
591
        FLIP_EAST(EnumFacing.EAST, true);
592
593
        protected final int field_178229_m;
594
595
        private Orientation(EnumFacing p_i46233_3_, boolean p_i46233_4_)
596
        {
597
            this.field_178229_m = p_i46233_3_.getIndex() + (p_i46233_4_ ? EnumFacing.values().length : 0);
598
        }
599
    }
600
601
    static enum VertexTranslations
602
    {
603
        DOWN(0, 1, 2, 3),
604
        UP(2, 3, 0, 1),
605
        NORTH(3, 0, 1, 2),
606
        SOUTH(0, 1, 2, 3),
607
        WEST(3, 0, 1, 2),
608
        EAST(1, 2, 3, 0);
609
610
        private final int field_178191_g;
611
        private final int field_178200_h;
612
        private final int field_178201_i;
613
        private final int field_178198_j;
614
        private static final BlockModelRenderer.VertexTranslations[] VALUES = new BlockModelRenderer.VertexTranslations[6];
615
616
        private VertexTranslations(int p_i46234_3_, int p_i46234_4_, int p_i46234_5_, int p_i46234_6_)
617
        {
618
            this.field_178191_g = p_i46234_3_;
619
            this.field_178200_h = p_i46234_4_;
620
            this.field_178201_i = p_i46234_5_;
621
            this.field_178198_j = p_i46234_6_;
622
        }
623
624
        public static BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_)
625
        {
626
            return VALUES[p_178184_0_.getIndex()];
627
        }
628
629
        static {
630
            VALUES[EnumFacing.DOWN.getIndex()] = DOWN;
631
            VALUES[EnumFacing.UP.getIndex()] = UP;
632
            VALUES[EnumFacing.NORTH.getIndex()] = NORTH;
633
            VALUES[EnumFacing.SOUTH.getIndex()] = SOUTH;
634
            VALUES[EnumFacing.WEST.getIndex()] = WEST;
635
            VALUES[EnumFacing.EAST.getIndex()] = EAST;
636
        }
637
    }
638
}
639

Deobfuscated MCP 1.8.9 source of BlockModelRenderer from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/renderer/BlockModelRenderer.java), stored verbatim.