@Override
 public void writeToNBT(NBTTagCompound tag) {
   tag.setInteger("pulsesCompleted", _pulsesCompleted);
   tag.setInteger("ticksCompleted", _ticksCompleted);
   tag.setBoolean("isActive", _isActive);
   tag.setBoolean("lastClockState", _lastClockState);
 }
 @Override
 public void writeToNBT(NBTTagCompound nbt) {
   nbt.setBoolean("isHuntingActive", isAIActive.getBoolean());
   nbt.setBoolean("isTaming", isTaming);
   standPoint.writeToNBT("standPoint", nbt);
   nbt.setInteger("ticksActive", ticksActive);
 }
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   Boolean value = redstoneOut.getValue();
   tagCompound.setBoolean("rs", value == null ? false : value);
   tagCompound.setBoolean("prevIn", prevIn);
 }
Exemple #4
0
  public void writeToNBT(NBTTagCompound nbttagcompound) {
    transport.writeToNBT(nbttagcompound);
    logic.writeToNBT(nbttagcompound);

    // Save pulser if any
    if (gate != null) {
      NBTTagCompound nbttagcompoundC = new NBTTagCompound();
      gate.writeToNBT(nbttagcompoundC);
      nbttagcompound.setTag("Gate", nbttagcompoundC);
      // Wire states are stored for pipes with gates only
      for (int i = 0; i < 4; ++i)
        nbttagcompound.setBoolean("wireState[" + i + "]", broadcastSignal[i]);
      nbttagcompound.setBoolean("redstoneState", broadcastRedstone);
    }

    for (int i = 0; i < 4; ++i) nbttagcompound.setBoolean("wireSet[" + i + "]", wireSet[i]);

    for (int i = 0; i < 8; ++i) {
      nbttagcompound.setInteger(
          "action[" + i + "]", activatedActions[i] != null ? activatedActions[i].getId() : 0);
      nbttagcompound.setInteger(
          "trigger[" + i + "]", activatedTriggers[i] != null ? activatedTriggers[i].getId() : 0);
    }

    for (int i = 0; i < 8; ++i)
      if (triggerParameters[i] != null) {
        NBTTagCompound cpt = new NBTTagCompound();
        triggerParameters[i].writeToNBT(cpt);
        nbttagcompound.setTag("triggerParameters[" + i + "]", cpt);
      }
  }
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   tagCompound.setBoolean("powerOn", powerOn);
   tagCompound.setBoolean("connected", connected);
   tagCompound.setInteger("rfPerTick", totalRfPerTick);
 }
  public void writeToNBT(NBTTagCompound nbt) {
    super.writeToNBT(nbt);

    NBTTagCompound energyTag = new NBTTagCompound();
    this.storage.writeToNBT(energyTag);
    nbt.setTag("storage", energyTag);
    nbt.setBoolean("flag", this.flag);
    nbt.setBoolean("flag1", this.flag1);
    NBTTagList list = new NBTTagList();

    for (int i = 0; i < this.slots.length; ++i) {
      if (this.slots[i] != null) {
        NBTTagCompound compound = new NBTTagCompound();
        compound.setByte("Slot", (byte) i);
        this.slots[i].writeToNBT(compound);
        list.appendTag(compound);
      }
    }

    nbt.setTag("Items", list);

    if (this.isInventoryNameLocalized()) {
      nbt.setString("CustomName", this.localizedName);
    }
  }
 @Override
 public void writeLosely(NBTTagCompound compound) {
   compound.setBoolean("hasLens", this.hasLens.getValue());
   compound.setInteger("color", this.color.getValue());
   compound.setFloat("brightness", this.brightness.getValueDirect());
   compound.setFloat("focus", this.focus.getValue());
   compound.setBoolean("beat", this.beat.getValue());
 }
 public void writeCapabilitiesToNBT(NBTTagCompound par1NBTTagCompound) {
   NBTTagCompound nbttagcompound = new NBTTagCompound();
   nbttagcompound.setBoolean("invulnerable", disableDamage);
   nbttagcompound.setBoolean("flying", isFlying);
   nbttagcompound.setBoolean("mayfly", allowFlying);
   nbttagcompound.setBoolean("instabuild", isCreativeMode);
   par1NBTTagCompound.setTag("abilities", nbttagcompound);
 }
Exemple #9
0
 @Override
 public void writeToNBT(NBTTagCompound tag) {
   inventory.writeToNBT(tag, "");
   for (int i = 0; i < 6; i++) {
     tag.setBoolean("InsertSide" + String.valueOf(i), insertSides[i]);
     tag.setBoolean("ExtractSide" + String.valueOf(i), extractSides[i]);
   }
 }
  @Override
  public void writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    nbtTags.setBoolean("authenticated", authenticated);
    nbtTags.setBoolean("locked", locked);
    nbtTags.setString("password", password);
  }
 @Override
 public void writeRestorableToNBT(NBTTagCompound tagCompound) {
   super.writeRestorableToNBT(tagCompound);
   writeBufferToNBT(tagCompound);
   tagCompound.setBoolean("large", large);
   tagCompound.setBoolean("transparent", transparent);
   tagCompound.setInteger("color", color);
 }
  @Override
  protected void writeSyncTag(NBTTagCompound NBT) {
    super.writeSyncTag(NBT);

    NBT.setInteger("color", color.ordinal());
    NBT.setBoolean("multi", hasMultiblock);
    NBT.setInteger("energy", energy);
    NBT.setBoolean("enhance", enhanced);
  }
  @Override
  public void writeToNBT(NBTTagCompound data) {
    super.writeToNBT(data);

    NBTTagList itemList = new NBTTagList();
    NBTTagList sideItemList = new NBTTagList();
    NBTTagCompound configData;

    data.setBoolean("shareRS", isRSShared);

    for (int i = 0; i < 3; i++) {

      if (inventory.getStackInSlot(i) != null) {
        NBTTagCompound itemCompound = new NBTTagCompound();
        itemCompound.setInteger("slot", i);
        inventory.getStackInSlot(i).writeToNBT(itemCompound);
        itemList.appendTag(itemCompound);
      }

      if (tanks[i].getFluid() != null) {
        data.setInteger("tankCap" + i, tanks[i].getCapacity());
        data.setTag("Fluid" + i, tanks[i].getFluid().writeToNBT(new NBTTagCompound()));
      }

      data.setBoolean("rsControl" + i, rsControl[i]);
      data.setBoolean("rsLatch" + i, rsLatch[i]);
    }

    data.setTag("items", itemList);

    for (int i = 0; i < 6; i++) {
      data.setInteger("side" + i, sides[i]);
      configData = new NBTTagCompound();
      configs[i].writeToNBT(configData);
      data.setCompoundTag("config" + i, configData);
      data.setBoolean("rs" + i, sideRS[i]);
      data.setBoolean("lock" + i, sideLocked[i]);
      data.setInteger("facID" + i, facID[i]);
      data.setInteger("facMeta" + i, facMeta[i]);

      if (sideInventory.getStackInSlot(i) != null) {
        NBTTagCompound itemCompound = new NBTTagCompound();
        itemCompound.setInteger("slot", i);
        sideInventory.getStackInSlot(i).writeToNBT(itemCompound);
        sideItemList.appendTag(itemCompound);
      }
    }

    data.setTag("sideItems", sideItemList);

    if (capacitor != null) {
      data.setInteger("realPower", capacitor.getEnergyStored());
      capacitor.writeToNBT(data);
      data.setInteger("powerCap2", capacitor.getMaxEnergyStored());
    }
  }
 @Override
 public void writeToNBT(NBTTagCompound compound) {
   compound.setBoolean("hasLens", this.hasLens.getValue());
   compound.setInteger("color", this.color.getValue());
   compound.setFloat("brightness", this.brightness.getValueDirect());
   compound.setFloat("pitch", this.pitch.getValue());
   compound.setFloat("rotation", this.rotation.getValue());
   compound.setFloat("focus", this.focus.getValue());
   compound.setBoolean("beat", this.beat.getValue());
 }
  @Override
  protected void writeSyncTag(NBTTagCompound NBT) {
    super.writeSyncTag(NBT);

    NBT.setByte("conn", ReikaArrayHelper.booleanToByteBitflags(connections));

    NBT.setBoolean("insul", insulated);

    NBT.setBoolean("melt", shouldMelt);
  }
  @Override
  protected void writeSyncTag(NBTTagCompound NBT) {
    super.writeSyncTag(NBT);

    if (facing != null) NBT.setInteger("face", facing.ordinal());

    NBT.setBoolean("multi", hasMultiblock);
    NBT.setInteger("depth", depth);
    NBT.setBoolean("turbo", isTurbo);
  }
  @Override
  public void writeEntityToNBT(NBTTagCompound nbt) {
    super.writeEntityToNBT(nbt);

    if (color != null) nbt.setInteger("color", color.ordinal());

    nbt.setBoolean("dodrops", doDrops);
    nbt.setBoolean("pylon", isPylonSpawn);

    nbt.setBoolean("isdead", isDead);
  }
  public NBTTagCompound getSavedCompound() {
    NBTTagCompound compound = new NBTTagCompound();

    compound.setByte("Type", this.type);
    compound.setBoolean("Trail", this.hasTrail);
    compound.setBoolean("Flicker", this.hasFlicker);
    compound.setIntArray("Colors", this.primaryColors);
    compound.setIntArray("FadeColors", this.secondaryColors);

    return compound;
  }
  /** (abstract) Protected helper method to write subclass entity data to NBT. */
  public void writeEntityToNBT(NBTTagCompound tagCompound) {
    super.writeEntityToNBT(tagCompound);

    if (this.dataWatcher.getWatchableObjectByte(17) == 1) {
      tagCompound.setBoolean("powered", true);
    }

    tagCompound.setShort("Fuse", (short) this.fuseTime);
    tagCompound.setByte("ExplosionRadius", (byte) this.explosionRadius);
    tagCompound.setBoolean("ignited", this.hasIgnited());
  }
  public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);

    tag.setBoolean("b0", hasAir);
    tag.setBoolean("b1", hasFire);
    tag.setBoolean("b2", hasWater);
    tag.setBoolean("b3", hasEarth);
    tag.setBoolean("b4", hasOrdo);
    tag.setBoolean("b5", hasEntropy);
    tag.setString("placer", placerName);
  }
Exemple #21
0
    public void writeToNBT(NBTTagCompound nbt) {
      nbt.setBoolean("ore", oreWildcard);
      nbt.setBoolean("sub", subitemsWildcard);

      for (int i = 0; i < 7; ++i) {
        if (stacks[i] != null) {
          NBTTagCompound stackNBT = new NBTTagCompound();
          stacks[i].writeToNBT(stackNBT);
          nbt.setTag("stacks[" + i + "]", stackNBT);
        }
      }
    }
 @Override
 public void writeToNBT(NBTTagCompound data) {
   super.writeToNBT(data);
   data.setInteger("masterX", masterX);
   data.setInteger("masterY", masterY);
   data.setInteger("masterZ", masterZ);
   data.setBoolean("hasMaster", hasMaster);
   data.setBoolean("isMaster", isMaster);
   if (hasMaster() && isMaster()) {
     // Any other values should ONLY BE SAVED TO THE MASTER
   }
 }
  /** Writes a tile entity to NBT. */
  public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
    super.writeToNBT(par1NBTTagCompound);
    par1NBTTagCompound.setShort("CookingTime", (short) this.cookingTime);
    par1NBTTagCompound.setBoolean("FinishedCooking", this.finishedCooking);
    par1NBTTagCompound.setShort("ReadyTime", (short) this.readyTime);
    par1NBTTagCompound.setBoolean("TooLate", this.tooLate);

    if (this.setItemstack() != null) {
      par1NBTTagCompound.setCompoundTag(
          "CookingItem", this.setItemstack().writeToNBT(new NBTTagCompound()));
    }
  }
 @Override
 protected void writeEntityToNBT(NBTTagCompound var1) {
   var1.setShort("xTile", (short) this.xTile);
   var1.setShort("yTile", (short) this.yTile);
   var1.setShort("zTile", (short) this.zTile);
   var1.setByte("inTile", (byte) this.inTile);
   var1.setByte("inData", (byte) this.inData);
   var1.setByte("shake", (byte) this.arrowShake);
   var1.setBoolean("inGround", this.inGround);
   var1.setBoolean("beenInGround", this.beenInGround);
   var1.setByte("pickup", (byte) this.pickupMode);
 }
Exemple #25
0
  public void addToParty(EntityPixelmon p) {
    if (mode == PokeballManagerMode.Player && pokedex != null) {
      pokedex.set(Pokedex.nameToID(p.getName()), DexRegisterStatus.caught);
      pokedex.sendToPlayer(pokedex.owner);
    }
    if (p.moveset.size() == 0) p.loadMoveset();
    if (!hasSpace()) {
      ChatHandler.sendChat(
          p.getOwner(), "Your party is full, " + p.getName() + " is sent to your computer!");
      PixelmonStorage.ComputerManager.getPlayerStorage(player).addToComputer(p);
      return;
    }
    if (p.caughtBall == null) p.caughtBall = EnumPokeballs.PokeBall;
    if (mode == PokeballManagerMode.Player) p.setOwner(player.username);
    else if (mode == PokeballManagerMode.Trainer) p.setTrainer(trainer);
    NBTTagCompound n = new NBTTagCompound();
    int id = 0;
    if (mode == PokeballManagerMode.Player) id = new Random().nextInt(32000);
    else if (mode == PokeballManagerMode.Trainer) id = new Random().nextInt(32000) * -1 - 1;
    boolean isUsed = false;
    do {
      isUsed = false;
      for (int i = 0; i < partyPokemon.length; i++) {
        NBTTagCompound nbt = partyPokemon[i];
        if (nbt != null) {
          if (mode == PokeballManagerMode.Player) {
            id = new Random().nextInt(32000);
          } else if (mode == PokeballManagerMode.Trainer) {
            id = new Random().nextInt(32000) * -1 - 1;
          }
        }
      }
    } while (contains(id));

    p.setPokemonId(id);
    p.writeEntityToStorageNBT(n);
    p.writeToNBT(n);
    n.setString("id", "Pixelmon");
    n.setName(p.getName());
    n.setBoolean("IsInBall", true);
    n.setBoolean("IsShiny", p.getIsShiny());
    n.setInteger("PixelmonOrder", getNextOpen());
    if (p.getHeldItem() != null) {
      n.setCompoundTag("Held Item", p.getHeldItem().writeToNBT(new NBTTagCompound()));
    }
    partyPokemon[getNextOpen()] = n;
    if (p.getHealth() > 0) n.setBoolean("IsFainted", false);
    if (mode == PokeballManagerMode.Player)
      ((EntityPlayerMP) player)
          .playerNetServerHandler.sendPacketToPlayer(
              new PixelmonDataPacket(n, EnumPackets.AddToStorage).getPacket());
  }
 @Override
 public void writeToNBT(NBTTagCompound nbt) {
   super.writeToNBT(nbt);
   nbt.setBoolean("isMaster", isMaster);
   nbt.setInteger("xLen", xLength);
   nbt.setInteger("zLen", zLength);
   nbt.setBoolean("hasMaster", hasMaster);
   if (hasMaster) {
     nbt.setInteger("masterX", masterX);
     nbt.setInteger("masterY", masterY);
     nbt.setInteger("masterZ", masterZ);
   }
 }
Exemple #27
0
  /** (abstract) Protected helper method to write subclass entity data to NBT. */
  public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
    super.writeEntityToNBT(par1NBTTagCompound);

    if (this.isChild()) {
      par1NBTTagCompound.setBoolean("IsBaby", true);
    }

    if (this.isVillager()) {
      par1NBTTagCompound.setBoolean("IsVillager", true);
    }

    par1NBTTagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1);
  }
 @Override
 public void writeToNbt(NBTTagCompound compound) {
   super.writeToNbt(compound);
   if (this.pluginPickupSet) {
     compound.setBoolean("infinitePickupDelay", this.infinitePickupDelay);
   } else {
     compound.removeTag("infinitePickupDelay");
   }
   if (this.pluginDespawnSet) {
     compound.setBoolean("infiniteDespawnDelay", this.infiniteDespawnDelay);
   } else {
     compound.removeTag("infiniteDespawnDelay");
   }
 }
    @Override
    public NBTBase writeNBT(
        Capability<ICustomData> capability, ICustomData instance, EnumFacing side) {

      final NBTTagCompound tag = new NBTTagCompound();

      tag.setBoolean("isBound", instance.isBound());
      tag.setBoolean("isSilenced", instance.isSilenced());
      tag.setBoolean("isWarded", instance.isWarded());
      tag.setBoolean("isDenounced", instance.isDenounced());
      tag.setBoolean("isConfined", instance.isConfined());

      return tag;
    }
  public static void findCompoundAndWrite() {
    NBTTagCompound cmp = new NBTTagCompound();

    cmp.setBoolean("useGradients", useGradients);
    cmp.setBoolean("contrastHudText", contrastHudText);
    cmp.setBoolean("useVanillaFont", useVanillaFont);
    cmp.setBoolean("drawHud", drawHud);
    cmp.setInteger("hudRelativeTo", hudRelativeTo);
    cmp.setInteger("hudPosX", hudPosX);
    cmp.setInteger("hudPosY", hudPosY);
    cmp.setString("hudCategory", hudCategory);
    cmp.setString("hudPlayer", hudPlayer);

    injectNBTToFile(cmp);
  }