Class BlockConfig



  • public class BlockConfig
    extends java.lang.Object
    An interface which is used to get information about custom blocks.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockConfig​()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName​(byte id, byte value)
      Default is "undefined".
      boolean hasSides​(byte spriteId, byte spriteValue)
      Is the block a true block with three sides or does it get rendered by a single sprite?
      boolean isIndestructible​(byte id, byte value)  
      boolean isLiquid​(byte id, byte value)
      Check if the block is liquid.
      boolean isObstacle​(byte id, byte value)
      Engine reserves ids are 0-9 and must be redirected to return super method.
      boolean isObstacle​(int block)  
      boolean isTransparent​(byte spriteId, byte spriteValue)
      When it is possible to see though the sides.
      RenderCell toRenderBlock​(byte id, byte value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockConfig

        public BlockConfig​()
    • Method Detail

      • isTransparent

        public boolean isTransparent​(byte spriteId,
                                     byte spriteValue)
        When it is possible to see though the sides.
        Parameters:
        spriteId -
        spriteValue -
        Returns:
      • isLiquid

        public boolean isLiquid​(byte id,
                                byte value)
        Check if the block is liquid.
        Parameters:
        id -
        value -
        Returns:
        true if liquid, false if not
      • getName

        public java.lang.String getName​(byte id,
                                        byte value)
        Default is "undefined".
        Parameters:
        id -
        value -
        Returns:
      • toRenderBlock

        public RenderCell toRenderBlock​(byte id,
                                        byte value)
        Parameters:
        id - there are ids < 10 which are filtered before
        value -
        Returns:
      • hasSides

        public boolean hasSides​(byte spriteId,
                                byte spriteValue)
        Is the block a true block with three sides or does it get rendered by a single sprite?
        This field is only used for representation (view) related data.
        Only used for blocks. Entities should return false.
        Parameters:
        spriteId -
        spriteValue -
        Returns:
        true if it has sides, false if is rendered as a single sprite
      • isIndestructible

        public boolean isIndestructible​(byte id,
                                        byte value)
        Parameters:
        id -
        value -
        Returns:
      • isObstacle

        public boolean isObstacle​(byte id,
                                  byte value)
        Engine reserves ids are 0-9 and must be redirected to return super method.
        Parameters:
        id -
        value -
        Returns:
      • isObstacle

        public boolean isObstacle​(int block)
        Parameters:
        block -
        Returns: