Examples of SerializableBlockData


Examples of de.beimax.simplespleef.gamehelpers.SerializableBlockData

  public FloorRepairWorker(int startAfter, int tickTime, List<Block> floor) {
    super(startAfter, tickTime);
    for (Block block : floor) {
      if (block == null) continue; // no NPEs
      if (block.getType() != Material.AIR) // add location to original locations
        originalBlocks.put(block.getLocation(), new SerializableBlockData(block.getTypeId(), block.getData()));
    }
  }
View Full Code Here

Examples of de.beimax.simplespleef.gamehelpers.SerializableBlockData

  public void executeTick() {
    // get a random entry
    Location location = getRandomEntry();
    //System.out.println("Tick FloorRepairWorker " + location);
    if (location != null) {
      SerializableBlockData blockData = originalBlocks.get(location); // get original block data
      if (blockData == null) return; // no NPEs, should not happen here, but just to make sure...
      // repair it
      Block block = location.getBlock();
      // get old data
      BlockState oldState = block.getState();
      block.setTypeIdAndData(blockData.getTypeId(), blockData.getData(), false);
      // update chunk information
      block.getWorld().refreshChunk(block.getChunk().getX(), block.getChunk().getZ());
      air.remove(location);       
      // notify others - and myself
      game.trackersUpdateBlock(block, oldState);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.