Package net.minecraft.tileentity

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


    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

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

  @Override
View Full Code Here


        if (entity != null)
        {
            try
            {
                NBTTagCompound compound = new NBTTagCompound();
                entity.writeToNBT(compound);
                tile = compound;
            }
            catch (Exception e)
            {
            }
View Full Code Here

        this.flag = 3;
        TileEntity te = world.getTileEntity(x, y, z);
        if (te != null)
        {
            nbt = new NBTTagCompound();
            te.writeToNBT(nbt);
        }
        else nbt = null;
        if (DEBUG)
        {
            System.out.printf("Created BlockSnapshot - [World: %s ][Location: %d,%d,%d ][Block: %s ][Meta: %d ]", world.getWorldInfo().getWorldName(), x, y, z, block, meta);
View Full Code Here

                else
                    ((SmelteryLogic) te).moltenMetal.add(0, temp);
            }

            NBTTagCompound data = new NBTTagCompound();
            te.writeToNBT(data);
            TConstruct.packetPipeline.sendToDimension(new PacketUpdateTE(x, y, z, data), dimension);
        }
    }

}
View Full Code Here

  public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
    TileEntity tile = context.world().getTileEntity(x, y, z);
    Pipe<?> pipe = BlockGenericPipe.getPipe(context.world(), x, y, z);

    if (BlockGenericPipe.isValid(pipe)) {
      tile.writeToNBT(tileNBT);

      // remove all pipe contents

      tileNBT.removeTag("travelingEntities");
View Full Code Here

    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

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

  @Override
View Full Code Here

    while (iterator.hasNext()) {
      TileEntity tileentity = (TileEntity) iterator.next();
      nbttagcompound1 = new NBTTagCompound();
      try {
        tileentity.writeToNBT(nbttagcompound1);
        nbttaglist2.appendTag(nbttagcompound1);
      } catch (Throwable t) {
        if (t instanceof RuntimeException) {
          String message = t.getMessage();
          if (message != null && message.contains("any is missing a mapping")) {
View Full Code Here

    public static boolean isHacked(IBlockAccess world, int x, int y, int z){
        TileEntity te = world.getTileEntity(x, y, z);
        if(te != null) {
            NBTTagCompound tag = new NBTTagCompound();
            te.writeToNBT(tag);
            if(tag.hasKey("RequiredPlayerRange") && tag.getShort("RequiredPlayerRange") == 0) return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public void onHackFinished(World world, int x, int y, int z, EntityPlayer player){
        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

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.