User Tools

Site Tools


zh_cn:tutorial:blockentity

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
zh_cn:tutorial:blockentity [2025/04/01 12:17] – [注册方块和方块实体] solidblockzh_cn:tutorial:blockentity [2025/04/01 12:20] (current) – [方块实体刻] solidblock
Line 125: Line 125:
 在你的 ''BlockEntity'' 类中: 在你的 ''BlockEntity'' 类中:
 <code java DemoBlockEntity.java> <code java DemoBlockEntity.java>
-public class DemoBlockEntity extends BlockEntity {+public class DemoBlockEntity extends BlockEntity implements BlockEntityTicker<DemoBlockEntity> {
     [...]     [...]
          
-    public static void tick(World world, BlockPos pos, BlockState state, DemoBlockEntity be) {+    @Override 
 +    public static void tick(World world, BlockPos pos, BlockState state, DemoBlockEntity blockEntity) {
         [...]         [...]
     }     }
zh_cn/tutorial/blockentity.1743509853.txt.gz · Last modified: 2025/04/01 12:17 by solidblock