Package net.minecraft.tileentity

Examples of net.minecraft.tileentity.TileEntity.readFromNBT()


        System.out.println(new String(bdata));

        // reconstruct TE
        NBTTagCompound compound = (NBTTagCompound) JsonToNBT.func_150315_a(new String(bdata, Charsets.UTF_8));
        TileEntity te = (TileEntity) Class.forName(compound.getString("TE_CLASS")).newInstance();
        te.readFromNBT(compound);

        world.setTileEntity(bc.getX(), bc.getY(), bc.getZ(), te);
      }
      catch (Exception e)
      {
View Full Code Here


        if (nbt != null)
        {
            te = world.getTileEntity(x, y, z);
            if (te != null)
            {
                te.readFromNBT(nbt);
            }
        }

        if (DEBUG)
        {
View Full Code Here

        if (nbt != null)
        {
            te = world.getTileEntity(x, y, z);
            if (te != null)
            {
                te.readFromNBT(nbt);
            }
        }

        if (DEBUG)
        {
View Full Code Here

                      {
                        TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k );
                        TileEntity nte = blk.createTileEntity( world, meta );
                        NBTTagCompound data = new NBTTagCompound();
                        ote.writeToNBT( data );
                        nte.readFromNBT( (NBTTagCompound) data.copy() );
                        world.setTileEntity( i + rel_x, j + rel_y, k + rel_z, nte );
                      }
                      world.markBlockForUpdate( i + rel_x, j + rel_y, k + rel_z );
                    }
View Full Code Here

    tileNBT.setInteger("z", z);

    context.world().setBlock(x, y, z, block, meta, 3);

    TileEntity tile = context.world().getTileEntity(x, y, z);
    tile.readFromNBT(tileNBT);
  }

  @Override
  public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
    TileEntity tile = context.world().getTileEntity(x, y, z);
View Full Code Here

      tileNBT.setInteger("x", x);
      tileNBT.setInteger("y", y);
      tileNBT.setInteger("z", z);

      if (tile != null) {
        tile.readFromNBT(tileNBT);
      }
    }
  }

  @Override
View Full Code Here

        if(!world.isRemote) {
            NBTTagCompound tag = new NBTTagCompound();
            TileEntity te = world.getTileEntity(x, y, z);
            te.writeToNBT(tag);
            tag.setShort("RequiredPlayerRange", (short)0);
            te.readFromNBT(tag);
            world.markBlockForUpdate(x, y, z);
        }

    }
View Full Code Here

    @Override
    public void handleClientSide(PacketSendNBTPacket message, EntityPlayer player){
        TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
        if(te != null) {
            try {
                te.readFromNBT(message.tag);
            } catch(Throwable e) {
                BlockTrackEntryInventory.addTileEntityToBlackList(te, e);
            }
        }
    }
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.