tutorial:blockentityrenderers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:blockentityrenderers [2022/03/21 03:25] – solidblock | tutorial:blockentityrenderers [2023/02/09 13:14] (current) – "you wants" -> "you want" mschae23 | ||
---|---|---|---|
Line 12: | Line 12: | ||
<code java> | <code java> | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
- | public class DemoBlockEntityRenderer<T extends BlockEntity> | + | public class DemoBlockEntityRenderer implements BlockEntityRenderer< |
// A jukebox itemstack | // A jukebox itemstack | ||
private static ItemStack stack = new ItemStack(Items.JUKEBOX, | private static ItemStack stack = new ItemStack(Items.JUKEBOX, | ||
Line 52: | Line 52: | ||
@Override | @Override | ||
public void onInitializeClient() { | public void onInitializeClient() { | ||
- | BlockEntityRendererRegistry.INSTANCE.register(DEMO_BLOCK_ENTITY, | + | BlockEntityRendererRegistry.register(DEMO_BLOCK_ENTITY, |
} | } | ||
</ | </ | ||
Line 77: | Line 77: | ||
// Rotate the item | // Rotate the item | ||
- | matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion((blockEntity.getWorld().getTime() + tickDelta) * 4)); | + | matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees((blockEntity.getWorld().getTime() + tickDelta) * 4)); |
} | } | ||
</ | </ | ||
Line 110: | Line 110: | ||
===== Rendering according to block entity data ===== | ===== Rendering according to block entity data ===== | ||
- | Sometimes you wants to render according to the block entity data (nbt), and you find they are all empty, even if you can access the data through ''/ | + | Sometimes you want to render according to the block entity data (nbt), and you find they are all empty, even if you can access the data through ''/ |
tutorial/blockentityrenderers.1647833127.txt.gz · Last modified: 2022/03/21 03:25 by solidblock