Exemplo n.º 1
0
 public void setMeta(int x, int y, int m) {
   Chunk chunk = getChunkI(x, y);
   if (chunk == null) return;
   TileInstance t = chunk.getTileInstance(x, y);
   if (t != null) {
     int m0 = t.metadata;
     t.metadata = (byte) m;
     if (m0 != m) chunk.markDirty();
   }
 }
Exemplo n.º 2
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();
  }