Esempio n. 1
0
 static {
   for (BlockFace face1 : new BlockFace[] {BlockFace.THIS, BlockFace.TOP, BlockFace.BOTTOM}) {
     for (BlockFace face2 : new BlockFace[] {BlockFace.THIS, BlockFace.WEST, BlockFace.EAST}) {
       for (BlockFace face3 : new BlockFace[] {BlockFace.THIS, BlockFace.NORTH, BlockFace.SOUTH}) {
         BlockFaces faces = new BlockFaces(face1, face2, face3);
         Vector3 offset = faces.getOffset();
         byte hash = getOffsetHash(offset);
         offsetHash.put(hash, faces);
       }
     }
   }
 }
Esempio n. 2
0
 public static BlockFaces fromOffset(Vector3 offset) {
   return offsetHash.get(getOffsetHash(offset));
 }
Esempio n. 3
0
 public void addAllBlocks(Map<Byte, Block> blocks) {
   _blocksById.putAll(blocks);
   for (Block b : blocks.values()) {
     _blocksByTitle.put(b.getTitle(), b);
   }
 }
Esempio n. 4
0
 public void removeBlock(Block block) {
   _blocksById.remove(block.getId());
   _blocksByTitle.remove(block.getTitle());
 }
Esempio n. 5
0
 public void addBlock(Block block) {
   _blocksById.put(block.getId(), block);
   _blocksByTitle.put(block.getTitle(), block);
 }
Esempio n. 6
0
 public int availableBlocksSize() {
   return _blocksById.size();
 }
Esempio n. 7
0
 public Block getBlock(byte id) {
   return _blocksById.get(id);
 }