zh_cn:tutorial:blockentityrenderers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
zh_cn:tutorial:blockentityrenderers [2019/12/19 10:10] – lightcolour | zh_cn:tutorial:blockentityrenderers [2019/12/19 10:13] – lightcolour | ||
---|---|---|---|
Line 90: | Line 90: | ||
} | } | ||
</ | </ | ||
- | Finally, we will get the Minecraft ' | + | 最后,我们将获得Minecraft的'' |
- | We also pass '' | + | 我们还将'' |
- | an item lying on the ground. Try experimenting with this value and see what happens (it's an enum). | + | 躺在地上的物品。 尝试尝试使用此值,看看会发生什么(这是一个枚举)。 |
- | We also need to call '' | + | 在这些GL调用之后,我们还需要调用'' |
<code java> | <code java> | ||
public void render(DemoBlockEntity blockEntity, | public void render(DemoBlockEntity blockEntity, | ||
Line 104: | Line 104: | ||
</ | </ | ||
- | You can try your newly created block entity renderer right now. | + | 您可以立即尝试新创建的块实体渲染器。 |
- | However, if you didn't make your block transparent, | + | 但是,如果您没有使块透明,您会发现有些不对劲-浮动块,点唱机是黑色的! |
- | This is because by default, | + | 这是因为默认情况下,无论您在方块实体中进行渲染的任何内容,都将接收光线,就好像它与块实体//处于同一位置一样。 |
- | So the floating block receives light from //inside// our opaque block, which means it receives no light! | + | 因此,浮动块从不透明的块中接收inside的光,这意味着它没有接收到光! |
- | To fix this, we will tell Minecraft | + | 为了解决这个问题,我们将告诉Minecraft从上方的一个方块方块实体的位置接收光。 |
- | To get the light, we call '' | + | 要获取灯光,我们在块实体上方的位置调用'' |
- | and to use the light we use it in '' | + | 并使用灯光,我们在'' |
<code java> | <code java> | ||
@Override | @Override | ||
Line 124: | Line 124: | ||
</ | </ | ||
- | The jukebox should now have the proper lighting. | + | 点唱机现在应具有适当的照明。 |
zh_cn/tutorial/blockentityrenderers.txt · Last modified: 2023/08/29 10:31 by wjz_p