Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 16th, 2014  |  syntax: None  |  size: 1.42 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.voxel.engine.core.Block;
  2.  
  3. /**
  4.  * Created with IntelliJ IDEA.
  5.  * User: Toby's PC
  6.  * Date: 07/01/14
  7.  * Time: 19:18
  8.  */
  9. public class Block {
  10.  
  11.     public boolean isActive;
  12.     public BlockType blockType;
  13.  
  14.     public enum BlockType{
  15.         BLOCK_TYPE_DEFAULT(0),
  16.         BLOCK_TYPE_GRASS(1),
  17.         BLOCK_TYPE_DIRT(2),
  18.         BLOCK_TYPE_WATER(3),
  19.         BLOCK_TYPE_STONE(4),
  20.         BLOCK_TYPE_WOOD(5),
  21.         BLOCK_TYPE_SAND(6),
  22.         BLOCK_TYPE_SNOW(7),
  23.         BLOCK_TYPE_NUM_TYPES(8),
  24.         BLOCK_TYPE_TRUNK(9),
  25.         BLOCK_TYPE_TREE_LEAF_ONE(10),
  26.         BLOCK_TYPE_TREE_LEAF_TWO(11),
  27.         BLOCK_TYPE_RED_FLOWER(12),
  28.         BLOCK_TYPE_SILVER_BLOCK(13),
  29.         BLOCK_TYPE_GOLD_BLOCK(14),
  30.         BLOCK_TYPE_FACE(15),
  31.         BLOCK_TYPE_GRASS2(16),
  32.         BLOCK_TYPE_GRASS3(17);
  33.  
  34.         private int blockID;
  35.  
  36.         BlockType(int i){
  37.              blockID = i;
  38.         }
  39.  
  40.         public int getID(){
  41.             return blockID;
  42.         }
  43.     }
  44.  
  45.     public BlockType getType(){
  46.         return blockType;
  47.     }
  48.  
  49.     public void setType(BlockType type){
  50.         blockType = type;
  51.     }
  52.  
  53.     public Block(BlockType type){
  54.         blockType = type;
  55.     }
  56.  
  57.     public boolean isActive(){
  58.         return isActive;
  59.     }
  60.  
  61.     public void setActive(boolean active){
  62.         isActive = active;
  63.     }
  64.  
  65.     public int getID(){
  66.         return blockType.getID();
  67.     }
  68. }
clone this paste RAW Paste Data