User Tools

Site Tools


tutorial:blockentityrenderers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:blockentityrenderers [2019/07/28 07:03] – ↷ Page moved from blockentityrenderers to tutorial:blockentityrenderers fudgetutorial:blockentityrenderers [2019/08/06 18:35] fudge
Line 26: Line 26:
 @Override @Override
 public void onInitialize() { public void onInitialize() {
-    ...+    [...]
     BlockEntityRendererRegistry.INSTANCE.register(DemoBlockEntity.class, new MyBlockEntityRenderer());     BlockEntityRendererRegistry.INSTANCE.register(DemoBlockEntity.class, new MyBlockEntityRenderer());
 } }
Line 48: Line 48:
 <code java> <code java>
     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {
-       ...+        [...]
         // Calculate the current offset in the y value         // Calculate the current offset in the y value
         double offset = Math.sin((blockEntity.getWorld().getTime() + partialTicks) / 8.0) / 4.0;         double offset = Math.sin((blockEntity.getWorld().getTime() + partialTicks) / 8.0) / 4.0;
Line 64: Line 64:
 <code java> <code java>
     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {
-        ...+        [...]
         MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Type.GROUND);         MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Type.GROUND);
  
Line 83: Line 83:
     @Override     @Override
     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {     public void render(DemoBlockEntity blockEntity, double x, double y, double z, float partialTicks, int destroyStage) {
-        ...+        [...]
                  
         // Put this right above "MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Type.GROUND);"         // Put this right above "MinecraftClient.getInstance().getItemRenderer().renderItem(stack, ModelTransformation.Type.GROUND);"
Line 89: Line 89:
         GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, (float) (light & 0xFFFF), (float) ((light >> 16) & 0xFFFF));         GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, (float) (light & 0xFFFF), (float) ((light >> 16) & 0xFFFF));
                  
-        ...+        [...]
     }     }
 </code> </code>
  
 The jukebox should now have the proper lighting.  The jukebox should now have the proper lighting. 
tutorial/blockentityrenderers.txt · Last modified: 2023/02/09 13:14 by mschae23