Class CrumbleBlock


public class CrumbleBlock extends BlockEntity
A floor that gives way: delayTicks after the player first stands on it, its cells vanish, and they come back respawnTicks later (never, if 0).
  • Constructor Details

    • CrumbleBlock

      public CrumbleBlock(String id, int x, int y, int w, int h, int delayTicks, int respawnTicks)

      Creates a crumbling block.

      Parameters
      • id: the id
      • x: left, fixed point, on a tile edge
      • y: top, fixed point, on a tile edge
      • w: width, whole tiles, fixed point
      • h: height, whole tiles, fixed point
      • delayTicks: ticks between first being stood on and giving way
      • respawnTicks: ticks until it returns, 0 for never
  • Method Details

    • getPhase

      public int getPhase()
      Description copied from class: LevelEntity

      A small number the view reads to pick a frame: open or closed, lit or not, how cracked. The default is 0.

      Returns

      the visual phase

      Overrides:
      getPhase in class LevelEntity
    • onAdded

      public void onAdded(PlatformWorld world)
      Description copied from class: LevelEntity

      Called once when the entity is added to a world, before the first step: the place to write solid cells. The default does nothing.

      Parameters
      • world: the world
      Overrides:
      onAdded in class LevelEntity
    • step

      public void step(PlatformWorld world)
      Description copied from class: LevelEntity

      Advances one tick. The default does nothing.

      Parameters
      • world: the world
      Overrides:
      step in class LevelEntity
    • onTouch

      public void onTouch(PlatformWorld world, Actor c)
      Description copied from class: LevelEntity

      Called each tick a living actor overlaps the entity.

      Parameters
      • world: the world
      • c: the actor
      Overrides:
      onTouch in class LevelEntity
    • hashState

      public long hashState(long h)
      Description copied from class: LevelEntity

      Mixes the entity's play-relevant state into a hash. The default mixes the position and whether it is active.

      Parameters
      • h: the running hash
      Returns

      the updated hash

      Overrides:
      hashState in class BlockEntity