コード例 #1
0
ファイル: CraftBlockState.java プロジェクト: Hoeze/Spoutcraft
  public boolean update(boolean force) {
    Block block = getBlock();

    synchronized (block) {
      if (block.getTypeId() != type) {
        if (force) {
          type = block.getTypeId();
          block.setTypeId(this.getTypeId());
        } else {
          return false;
        }
      }
    }

    return true;
  }
コード例 #2
0
ファイル: CraftBlockState.java プロジェクト: Hoeze/Spoutcraft
 public CraftBlockState(final Block block) {
   this.world = (SpoutcraftWorld) block.getWorld();
   this.x = block.getX();
   this.y = block.getY();
   this.z = block.getZ();
   this.type = block.getTypeId();
   this.light = block.getLightLevel();
   this.chunk = (SpoutcraftChunk) block.getChunk();
   this.location = new FastLocation(x, y, z, 0, 0, world);
 }