2424 * This should really probably not be in an examplemod for beginners,
2525 * but I added comments to it so its all good
2626 *
27+ * TODO: Update this to 1.15
28+ *
2729 * @author Cadiboo
2830 */
2931public class MiniModelTileEntityRenderer extends TileEntityRenderer <MiniModelTileEntity > {
@@ -36,33 +38,33 @@ public MiniModelTileEntityRenderer(final TileEntityRendererDispatcher tileEntity
3638 * Render our TileEntity
3739 */
3840 @ Override
39- public void func_225616_a_ (final MiniModelTileEntity tileEntityIn , final float partialTicks , final MatrixStack matrixStack , final IRenderTypeBuffer renderTypeBuffer , final int packedLight , final int backupPackedLight ) {
40-
41- final MiniModel miniModel = tileEntityIn .miniModel ;
42-
43- if (miniModel == null )
44- return ;
45-
46- if (!miniModel .isBuilt ())
47- miniModel .rebuild ();
48-
49- // Setup correct GL state
50- // this.field_228858_b_.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
51- RenderHelper .disableStandardItemLighting ();
52- // Translucency
53- if (ExampleModConfig .modelTranslucency ) {
54- RenderSystem .blendFunc (GL11 .GL_ONE , GL11 .GL_ONE );
55- } else {
56- RenderSystem .blendFunc (GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA );
57- }
58- RenderSystem .enableBlend ();
59-
60- if (Minecraft .isAmbientOcclusionEnabled ()) {
61- RenderSystem .shadeModel (GL11 .GL_SMOOTH );
62- } else {
63- RenderSystem .shadeModel (GL11 .GL_FLAT );
64- }
41+ public void render (final MiniModelTileEntity tileEntityIn , final float partialTicks , final MatrixStack matrixStack , final IRenderTypeBuffer renderTypeBuffer , final int packedLight , final int backupPackedLight ) {
6542
43+ // final MiniModel miniModel = tileEntityIn.miniModel;
44+ //
45+ // if (miniModel == null)
46+ // return;
47+ //
48+ // if (!miniModel.isBuilt())
49+ // miniModel.rebuild();
50+ //
51+ // // Setup correct GL state
52+ //// this.field_228858_b_.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
53+ // RenderHelper.disableStandardItemLighting();
54+ // // Translucency
55+ // if (ExampleModConfig.modelTranslucency) {
56+ // RenderSystem.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
57+ // } else {
58+ // RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
59+ // }
60+ // RenderSystem.enableBlend();
61+ //
62+ // if (Minecraft.isAmbientOcclusionEnabled()) {
63+ // RenderSystem.shadeModel(GL11.GL_SMOOTH);
64+ // } else {
65+ // RenderSystem.shadeModel(GL11.GL_FLAT);
66+ // }
67+ //
6668// GlStateManager.pushMatrix();
6769//
6870// // Translate to render pos. The 0.5 is to translate into the centre of the block, rather than to the corner of it
@@ -110,22 +112,22 @@ public boolean isGlobalRenderer(final MiniModelTileEntity te) {
110112// }
111113// }
112114// }
113-
114- /**
115- * This should work.
116- * Draws a BufferBuilder without resetting its internal data.
117- *
118- * @param bufferBuilder The BufferBuilder to draw (but not reset)
119- */
120- private void drawBufferWithoutResetting (final BufferBuilder bufferBuilder ) {
121- // Get the internal data from the BufferBuilder (This resets the BufferBuilder's own copy of this data)
122- final ByteBuffer byteBuffer = bufferBuilder .func_227832_f_ ().getSecond ();
123- // Set the BufferBuilder's internal data to the original data
124- bufferBuilder .putBulkData (byteBuffer );
125- // Draw the BufferBuilder (This resets the BufferBuilder's data)
126- WorldVertexBufferUploader .draw (bufferBuilder );
127- // Set the BufferBuilder's internal data back to the original data
128- bufferBuilder .putBulkData (byteBuffer );
129- }
115+ //
116+ // /**
117+ // * This should work.
118+ // * Draws a BufferBuilder without resetting its internal data.
119+ // *
120+ // * @param bufferBuilder The BufferBuilder to draw (but not reset)
121+ // */
122+ // private void drawBufferWithoutResetting(final BufferBuilder bufferBuilder) {
123+ // // Get the internal data from the BufferBuilder (This resets the BufferBuilder's own copy of this data)
124+ // final ByteBuffer byteBuffer = bufferBuilder.getAndResetData ().getSecond();
125+ // // Set the BufferBuilder's internal data to the original data
126+ // bufferBuilder.putBulkData(byteBuffer);
127+ // // Draw the BufferBuilder (This resets the BufferBuilder's data)
128+ // WorldVertexBufferUploader.draw(bufferBuilder);
129+ // // Set the BufferBuilder's internal data back to the original data
130+ // bufferBuilder.putBulkData(byteBuffer);
131+ // }
130132
131133}
0 commit comments