예제 #1
0
  public void setTile(int x, int y, Tile t, int m) {
    Chunk chunk = loadChunkI(x, y);
    if (t != Tiles.air) {
      TileInstance ti = new TileInstance(chunk, x, y, t);
      ti.metadata = (byte) m;
      if (t.hasTileEntity(ti.metadata)) {
        ti.tileEntity = t.createTileEntity(ti);
        ti.tileEntity.world = this;
        ti.tileEntity.posX = x;
        ti.tileEntity.posY = y;
        ti.tileEntity.init();
      }

      chunk.setTileInstance(x, y, ti);
    } else chunk.setTileInstance(x, y, null);
    chunk.markDirty();
  }