@Override
 public void readFromNBT(NBTTagCompound tag) {
   _pulsesCompleted = tag.getInteger("pulsesCompleted");
   _ticksCompleted = tag.getInteger("ticksCompleted");
   _isActive = tag.getBoolean("isActive");
   _lastClockState = tag.getBoolean("lastClockState");
 }
  public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
    this.entityName = par1NBTTagCompound.getString("EntityId");
    this.spawnDelay = par1NBTTagCompound.getShort("Delay");
    powered = par1NBTTagCompound.getBoolean("Powered");
    spawnSpeed = par1NBTTagCompound.getShort("Speed");
    requiresPlayer = par1NBTTagCompound.getBoolean("RequiresPlayer");
    ignoreSpawnRequirements = par1NBTTagCompound.getBoolean("IgnoreSpawnRequirements");
    skeletonType = par1NBTTagCompound.getInteger("SkeletonType");

    this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay");
    this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay");
    this.spawnCount = par1NBTTagCompound.getShort("SpawnCount");

    if (par1NBTTagCompound.hasKey("MaxNearbyEntities", 99)) {
      this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities");
      this.activatingRangeFromPlayer = par1NBTTagCompound.getShort("RequiredPlayerRange");
    }

    if (par1NBTTagCompound.hasKey("SpawnRange", 99)) {
      this.spawnRange = par1NBTTagCompound.getShort("SpawnRange");
    }

    if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) {
      this.renderedEntity = null;
    }
  }
 @Override
 public void readFromNBT(NBTTagCompound nbt) {
   isAIActive.setValue(nbt.getBoolean("isHuntingActive"));
   isTaming = nbt.getBoolean("isTaming");
   standPoint = Point3D.readFromNBT("standPoint", nbt);
   ticksActive = nbt.getInteger("ticksActive");
 }
 @Override
 public void readFromNBT(NBTTagCompound tagCompound) {
   super.readFromNBT(tagCompound);
   powerOn = tagCompound.getBoolean("powerOn");
   connected = tagCompound.getBoolean("connected");
   totalRfPerTick = tagCompound.getInteger("rfPerTick");
 }
  @SuppressWarnings("unchecked")
  @Override
  public void readFromNBT(NBTTagCompound nbt) {
    super.readFromNBT(nbt);

    this.spawned = nbt.getBoolean("spawned");
    this.playerInRange = this.lastPlayerInRange = nbt.getBoolean("playerInRange");
    this.isBossDefeated = nbt.getBoolean("defeated");
    this.playerCheated = nbt.getBoolean("playerCheated");

    try {
      this.bossClass = (Class<E>) Class.forName(nbt.getString("bossClass"));
    } catch (Exception e) {
      e.printStackTrace();
    }

    this.roomCoords = new Vector3();
    this.roomCoords.x = nbt.getDouble("roomCoordsX");
    this.roomCoords.y = nbt.getDouble("roomCoordsY");
    this.roomCoords.z = nbt.getDouble("roomCoordsZ");
    this.roomSize = new Vector3();
    this.roomSize.x = nbt.getDouble("roomSizeX");
    this.roomSize.y = nbt.getDouble("roomSizeY");
    this.roomSize.z = nbt.getDouble("roomSizeZ");

    if (nbt.hasKey("lastKillTime")) {
      this.lastKillTime = nbt.getLong("lastKillTime");
    }
  }
  @Override
  public void readFromNBT(NBTTagCompound tagCompound) {
    super.readFromNBT(tagCompound);

    facing = ForgeDirection.getOrientation(tagCompound.getInteger("direction"));

    isValidMultiblock = tagCompound.getBoolean("isValidMultiblock");

    NBTTagList itemsTag = (NBTTagList) tagCompound.getTag("Items");
    furnaceItems = new ItemStack[getSizeInventory()];

    for (int i = 0; i < itemsTag.tagCount(); i++) {
      NBTTagCompound slotTag = (NBTTagCompound) itemsTag.getCompoundTagAt(i);
      byte slot = slotTag.getByte("Slot");

      if (slot >= 0 && slot < furnaceItems.length)
        furnaceItems[slot] = ItemStack.loadItemStackFromNBT(slotTag);
    }

    furnaceBurnTime = tagCompound.getShort("BurnTime");
    furnaceCookTime = tagCompound.getShort("CookTime");
    currentItemBurnTime = TileEntityFurnace.getItemBurnTime(furnaceItems[1]);
    cooking = tagCompound.getBoolean("active");
    type = tagCompound.getInteger("type");
    if (type == 1) partBlocks = stonebrick;
    hole = hole.readFromNBT(tagCompound, "hole");
  }
  @Override
  public void setupFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) {
    if (tagCompound != null) {
      line = tagCompound.getString("text");
      if (tagCompound.hasKey("color")) {
        color = tagCompound.getInteger("color");
      } else {
        color = 0xffffff;
      }
      if (tagCompound.hasKey("rfcolor")) {
        rfcolor = tagCompound.getInteger("rfcolor");
      } else {
        rfcolor = 0xffffff;
      }
      if (tagCompound.hasKey("rfcolor_neg")) {
        rfcolorNeg = tagCompound.getInteger("rfcolor_neg");
      } else {
        rfcolorNeg = 0xffffff;
      }

      hidebar = tagCompound.getBoolean("hidebar");
      hidetext = tagCompound.getBoolean("hidetext");
      showdiff = tagCompound.getBoolean("showdiff");
      showpct = tagCompound.getBoolean("showpct");

      format = FormatStyle.values()[tagCompound.getInteger("format")];
    }
  }
 @Override
 public void readRestorableFromNBT(NBTTagCompound tagCompound) {
   super.readRestorableFromNBT(tagCompound);
   readBufferFromNBT(tagCompound);
   large = tagCompound.getBoolean("large");
   transparent = tagCompound.getBoolean("transparent");
   color = tagCompound.getInteger("color");
 }
  @Override
  public void readFromNBT(NBTTagCompound nbtTags) {
    super.readFromNBT(nbtTags);

    authenticated = nbtTags.getBoolean("authenticated");
    locked = nbtTags.getBoolean("locked");
    password = nbtTags.getString("password");
  }
 public void readCapabilitiesFromNBT(NBTTagCompound par1NBTTagCompound) {
   if (par1NBTTagCompound.hasKey("abilities")) {
     NBTTagCompound nbttagcompound = par1NBTTagCompound.getCompoundTag("abilities");
     disableDamage = nbttagcompound.getBoolean("invulnerable");
     isFlying = nbttagcompound.getBoolean("flying");
     allowFlying = nbttagcompound.getBoolean("mayfly");
     isCreativeMode = nbttagcompound.getBoolean("instabuild");
   }
 }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    color = CrystalElement.elements[NBT.getInteger("color")];
    hasMultiblock = NBT.getBoolean("multi");
    energy = NBT.getInteger("energy");
    enhanced = NBT.getBoolean("enhance");
  }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    facing = dirs[NBT.getInteger("face")];
    hasMultiblock = NBT.getBoolean("multi");
    depth = NBT.getInteger("depth");
    isTurbo = NBT.getBoolean("turbo");
  }
Beispiel #13
0
 @Override
 public void readFromNBT(NBTTagCompound tag) {
   inventory.readFromNBT(tag, 6, "");
   insertSides = new boolean[6];
   extractSides = new boolean[6];
   for (int i = 0; i < 6; i++) {
     insertSides[i] = tag.getBoolean("InsertSide" + String.valueOf(i));
     extractSides[i] = tag.getBoolean("ExtractSide" + String.valueOf(i));
   }
 }
  @Override
  protected void readSyncTag(NBTTagCompound NBT) {
    super.readSyncTag(NBT);

    connections = ReikaArrayHelper.booleanFromByteBitflags(NBT.getByte("conn"), 6);

    insulated = NBT.getBoolean("insul");

    shouldMelt = NBT.getBoolean("melt");
  }
Beispiel #15
0
    public void readFromNBT(NBTTagCompound nbt) {
      oreWildcard = nbt.getBoolean("ore");
      subitemsWildcard = nbt.getBoolean("sub");

      for (int i = 0; i < 7; ++i) {
        if (nbt.hasKey("stacks[" + i + "]")) {
          setStack(i, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("stacks[" + i + "]")));
        }
      }
    }
 @Override
 public void readLosely(NBTTagCompound compound) {
   this.hasLens.setValue(compound.getBoolean("hasLens"));
   this.color.setValue(compound.getInteger("color"));
   this.brightness.setValue(compound.getFloat("brightness"));
   this.prevBrightness = this.brightness.getValue();
   this.focus.setValue(compound.getFloat("focus"));
   this.prevFocus = this.focus.getValue();
   this.beat.setValue(compound.getBoolean("beat"));
 }
    @Override
    public void readNBT(
        Capability<ICustomData> capability, ICustomData instance, EnumFacing side, NBTBase nbt) {

      final NBTTagCompound tag = (NBTTagCompound) nbt;
      instance.setBound(tag.getBoolean("isBound"));
      instance.setSilenced(tag.getBoolean("isSilenced"));
      instance.setWarded(tag.getBoolean("isWarded"));
      instance.setDenounced(tag.getBoolean("isDenounced"));
      instance.setConfined(tag.getBoolean("isConfined"));
    }
  public void readFromNBT(NBTTagCompound tag) {
    super.readFromNBT(tag);

    hasAir = tag.getBoolean("b0");
    hasFire = tag.getBoolean("b1");
    hasWater = tag.getBoolean("b2");
    hasEarth = tag.getBoolean("b3");
    hasOrdo = tag.getBoolean("b4");
    hasEntropy = tag.getBoolean("b5");
    placerName = tag.getString("placer");
  }
  public static FireworkStarPattern getFromCompound(NBTTagCompound compound) {
    FireworkStarPattern pattern = new FireworkStarPattern();

    pattern.type = compound.getByte("Type");
    pattern.hasTrail = compound.getBoolean("Trail");
    pattern.hasFlicker = compound.getBoolean("Flicker");
    pattern.primaryColors = compound.getIntArray("Colors");
    pattern.secondaryColors = compound.getIntArray("FadeColors");

    return pattern;
  }
  @Override
  protected boolean canModify(ItemStack tool, ItemStack[] input) {
    ToolCore toolItem = (ToolCore) tool.getItem();
    if (!validType(toolItem)) return false;

    NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
    if (!tags.getBoolean("Lava") && !tags.hasKey("Lapis")) {
      return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key);
    }
    return false;
  }
 @Override
 protected void readEntityFromNBT(NBTTagCompound var1) {
   this.xTile = var1.getShort("xTile");
   this.yTile = var1.getShort("yTile");
   this.zTile = var1.getShort("zTile");
   this.inTile = var1.getByte("inTile") & 255;
   this.inData = var1.getByte("inData") & 255;
   this.arrowShake = var1.getByte("shake") & 255;
   this.inGround = var1.getBoolean("inGround");
   this.beenInGround = var1.getBoolean("beenInGrond");
   this.pickupMode = var1.getByte("pickup");
 }
  @Override
  public void readEntityFromNBT(NBTTagCompound nbt) {
    super.readEntityFromNBT(nbt);

    int c = nbt.getInteger("color");
    color = c >= 0 ? CrystalElement.elements[c] : CrystalElement.randomElement();

    isPylonSpawn = nbt.getBoolean("pylon");
    doDrops = nbt.getBoolean("dodrops");

    if (nbt.getBoolean("isdead")) this.setDead();
  }
 @Override
 public void readFromNBT(NBTTagCompound data) {
   super.readFromNBT(data);
   masterX = data.getInteger("masterX");
   masterY = data.getInteger("masterY");
   masterZ = data.getInteger("masterZ");
   hasMaster = data.getBoolean("hasMaster");
   isMaster = data.getBoolean("isMaster");
   if (hasMaster() && isMaster()) {
     // Any other values should ONLY BE READ BY THE MASTER
   }
 }
 @Override
 public void readFromNBT(NBTTagCompound nbt) {
   super.readFromNBT(nbt);
   isMaster = nbt.getBoolean("isMaster");
   xLength = nbt.getInteger("xLen");
   zLength = nbt.getInteger("zLen");
   hasMaster = nbt.getBoolean("hasMaster");
   if (hasMaster) {
     masterX = nbt.getInteger("masterX");
     masterY = nbt.getInteger("masterY");
     masterZ = nbt.getInteger("masterZ");
   }
 }
 @Override
 public void readFromNBT(NBTTagCompound compound) {
   this.hasLens.setValue(compound.getBoolean("hasLens"));
   this.color.setValue(compound.getInteger("color"));
   this.brightness.setValue(compound.getFloat("brightness"));
   this.prevBrightness = this.brightness.getValue();
   this.pitch.setValue(compound.getFloat("pitch"));
   this.prevPitch = this.pitch.getValue();
   this.rotation.setValue(compound.getFloat("rotation"));
   this.prevRotation = this.rotation.getValue();
   this.focus.setValue(compound.getFloat("focus"));
   this.prevFocus = this.focus.getValue();
   this.beat.setValue(compound.getBoolean("beat"));
 }
Beispiel #26
0
 @Override
 public void readFromNBT(NBTTagCompound nbttagcompound) {
   super.readFromNBT(nbttagcompound);
   NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10);
   storage = new ItemStack[getSizeInventory()];
   for (int i = 0; i < nbttaglist.tagCount(); i++) {
     NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
     byte byte0 = nbttagcompound1.getByte("Slot");
     if (byte0 >= 0 && byte0 < storage.length)
       storage[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
   }
   hasQuern = nbttagcompound.getBoolean("hasQuern");
   shouldRotate = nbttagcompound.getBoolean("shouldRotate");
 }
 @Override
 public void readEntityFromNBT(NBTTagCompound tag) {
   if (tag.hasKey("ammoItemId")) {
     _ammoSource = new ItemStack(tag.getInteger("ammoItemId"), 1, 0);
     distance = tag.getDouble("distance");
     _falling = tag.getBoolean("falling");
     if (tag.hasKey("owner")) _owner = tag.getString("owner");
   } else if (tag.hasKey("ammoSource")) {
     _ammoSource = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("ammoSource"));
     distance = tag.getDouble("distance");
     _falling = tag.getBoolean("falling");
     if (tag.hasKey("owner")) _owner = tag.getString("owner");
   }
 }
 @Override
 public void readFromNbt(NBTTagCompound compound) {
   super.readFromNbt(compound);
   if (compound.hasKey("effect")) {
     this.effect = compound.getBoolean("effect");
   }
 }
  @Override
  public void onBlockPlacedBy(
      World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
    if (world.isRemote) return;
    if (stack.hasTagCompound()) {
      TileEntity te = world.getTileEntity(x, y, z);
      if (te instanceof TileVendorBlock) {
        TileVendorBlock tentity = (TileVendorBlock) te;
        NBTTagCompound tagCompound = stack.getTagCompound();
        if (tagCompound == null) {
          return;
        }
        NBTTagList tagList = tagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
        for (int i = 0; i < tagList.tagCount(); i++) {
          NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i);
          byte slot = tag.getByte("Slot");
          if (slot >= 0 && slot < tentity.getSizeInventory()) {
            tentity.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tag));
          }
        }
        tentity.coinSum = tagCompound.getInteger("CoinSum");
        tentity.userCoinSum = tagCompound.getInteger("UserCoinSum");
        tentity.itemPrice = tagCompound.getInteger("ItemPrice");
        tentity.blockOwner = tagCompound.getString("BlockOwner");
        tentity.infiniteMode = tagCompound.getBoolean("Infinite");
      }
      world.markBlockForUpdate(x, y, z);

    } else {
      // item has no owner so we'll set one and get out of here
      ((TileVendorBlock) world.getTileEntity(x, y, z)).blockOwner = entity.getCommandSenderName();
    }
    int meta = stack.getItemDamage();
    world.setBlockMetadataWithNotify(x, y, z, meta, 2);
  }
Beispiel #30
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  protected void readEntityFromNBT(NBTTagCompound tagCompund) {
    if (tagCompund.getBoolean("CustomDisplayTile")) {
      int i = tagCompund.getInteger("DisplayData");

      if (tagCompund.hasKey("DisplayTile", 8)) {
        Block block = Block.getBlockFromName(tagCompund.getString("DisplayTile"));

        if (block == null) {
          this.func_174899_a(Blocks.air.getDefaultState());
        } else {
          this.func_174899_a(block.getStateFromMeta(i));
        }
      } else {
        Block block1 = Block.getBlockById(tagCompund.getInteger("DisplayTile"));

        if (block1 == null) {
          this.func_174899_a(Blocks.air.getDefaultState());
        } else {
          this.func_174899_a(block1.getStateFromMeta(i));
        }
      }

      this.setDisplayTileOffset(tagCompund.getInteger("DisplayOffset"));
    }

    if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) {
      this.entityName = tagCompund.getString("CustomName");
    }
  }