Package buildcraft.api.blueprints

Examples of buildcraft.api.blueprints.MappingRegistry


  }

  public void writeToNBT(NBTTagCompound nbt) {
    nbt.setLong("initialDate", initialDate);

    MappingRegistry registry = new MappingRegistry();

    NBTTagList list = new NBTTagList();

    for (SequenceAction action : actions) {
      NBTTagCompound cpt = new NBTTagCompound();
      action.writeToNBT(cpt);
      cpt.setString("class", classToStr.get(action.getClass()));
      registry.scanAndTranslateStacksToRegistry(cpt);
      list.appendTag(cpt);
    }

    nbt.setTag("actions", list);

    NBTTagCompound registryNBT = new NBTTagCompound();
    registry.write(registryNBT);
    nbt.setTag("registry", registryNBT);
  }
View Full Code Here


  }

  public void readFromNBT(NBTTagCompound nbt) {
    initialDate = nbt.getLong("initialDate");

    MappingRegistry registry = new MappingRegistry();
    registry.read(nbt.getCompoundTag("registry"));

    NBTTagList list = nbt.getTagList("actions", Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < list.tagCount(); ++i) {
      NBTTagCompound cpt = list.getCompoundTagAt(i);

      try {
        registry.scanAndTranslateStacksToWorld(cpt);
        SequenceAction action = (SequenceAction) strToClass.get(cpt.getString("class")).newInstance();
        action.world = world;
        action.readFromNBT(cpt);

        action.date = (action.date - initialDate) + world.getTotalWorldTime();
View Full Code Here

      items.appendTag(cpt);
    }

    nbt.setTag("items", items);

    MappingRegistry registry = new MappingRegistry();

    NBTTagCompound slotNBT = new NBTTagCompound();
    NBTTagCompound registryNBT = new NBTTagCompound();

    slotToBuild.writeToNBT(slotNBT, registry);
    registry.write(registryNBT);

    nbt.setTag("registry", registryNBT);

    if (slotToBuild instanceof BuildingSlotBlock) {
      nbt.setByte ("slotKind", (byte) 0);
View Full Code Here

      sPos.stack = ItemStack.loadItemStackFromNBT(items
          .getCompoundTagAt(i));
      stacksToDisplay.add(sPos);
    }

    MappingRegistry registry = new MappingRegistry();
    registry.read(nbt.getCompoundTag("registry"));

    if (nbt.getByte("slotKind") == 0) {
      slotToBuild = new BuildingSlotBlock();
    } else {
      slotToBuild = new BuildingSlotEntity();
View Full Code Here

TOP

Related Classes of buildcraft.api.blueprints.MappingRegistry

Copyright © 2018 www.massapicom. 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.