public static void setFloat(ItemStack stack, String tag, float f) { getNBT(stack).setFloat(tag, f); }
@Override public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_TIME, time); par1nbtTagCompound.setFloat(TAG_TIME_FRACTION, timeFraction); par1nbtTagCompound.setBoolean(TAG_FLIP, flip); par1nbtTagCompound.setInteger(TAG_FLIP_TICKS, flipTicks); par1nbtTagCompound.setBoolean(TAG_MOVE, move); par1nbtTagCompound.setBoolean(TAG_LOCK, lock); }
cmp.setFloat(TAG_ROTATION_X, rotationX); cmp.setFloat(TAG_ROTATION_Y, rotationY); cmp.setBoolean(TAG_REQUEST_UPDATE, requestsClientUpdate); cmp.setInteger(TAG_PADDING_COLOR, paddingColor); cmp.setInteger(TAG_FORCED_MANA_PAYLOAD, mmForcedManaPayload); cmp.setInteger(TAG_FORCED_TICKS_BEFORE_MANA_LOSS, mmForcedTicksBeforeManaLoss); cmp.setFloat(TAG_FORCED_MANA_LOSS_PER_TICK, mmForcedManaLossPerTick); cmp.setFloat(TAG_FORCED_GRAVITY, mmForcedGravity); cmp.setFloat(TAG_FORCED_VELOCITY_MULTIPLIER, mmForcedVelocityMultiplier);
@Override public void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { super.writeEntityToNBT(cmp); cmp.setBoolean(TAG_CHARGING, isCharging()); cmp.setInteger(TAG_VARIETY, getVariety()); cmp.setInteger(TAG_CHARGE_TICKS, getChargeTicks()); cmp.setInteger(TAG_LIVE_TICKS, getLiveTicks()); cmp.setInteger(TAG_DELAY, getDelay()); cmp.setFloat(TAG_ROTATION, getRotation()); }
private static void addCapData(@Nonnull NBTTagCompound tag, @Nonnull SetType setType, float value) { switch (setType) { case LEVEL: tag.setFloat("level", value); break; default: throw new IllegalArgumentException(); } }
@Override public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { super.writeEntityToNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_TICKS_EXISTED, getTicksExisted()); par1nbtTagCompound.setInteger(TAG_COLOR, getColor()); par1nbtTagCompound.setInteger(TAG_MANA, getMana()); par1nbtTagCompound.setInteger(TAG_STARTING_MANA, getStartingMana()); par1nbtTagCompound.setInteger(TAG_MIN_MANA_LOSS, getMinManaLoss()); par1nbtTagCompound.setFloat(TAG_TICK_MANA_LOSS, getManaLossPerTick()); par1nbtTagCompound.setFloat(TAG_GRAVITY, getGravity()); ItemStack stack = getSourceLens(); NBTTagCompound lensCmp = new NBTTagCompound(); if(!stack.isEmpty()) lensCmp = stack.writeToNBT(lensCmp); par1nbtTagCompound.setTag(TAG_LENS_STACK, lensCmp); BlockPos coords = getBurstSourceBlockPos(); par1nbtTagCompound.setInteger(TAG_SPREADER_X, coords.getX()); par1nbtTagCompound.setInteger(TAG_SPREADER_Y, coords.getY()); par1nbtTagCompound.setInteger(TAG_SPREADER_Z, coords.getZ()); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_X, motionX); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_Y, motionY); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_Z, motionZ); UUID identity = getShooterUUID(); boolean hasShooter = identity != null; par1nbtTagCompound.setBoolean(TAG_HAS_SHOOTER, hasShooter); if(hasShooter) { par1nbtTagCompound.setLong(TAG_SHOOTER_UUID_MOST, identity.getMostSignificantBits()); par1nbtTagCompound.setLong(TAG_SHOOTER_UUID_LEAST, identity.getLeastSignificantBits()); } }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound = super.writeToNBT(nbttagcompound); nbttagcompound.setFloat("Wound", tension); return nbttagcompound; }
@Override public void writeRuleData(NBTTagCompound tag) { super.writeRuleData(tag); tag.setString("mobID", registryName.toString()); tag.setFloat("xOffset", xOffset); tag.setFloat("yOffset", yOffset); tag.setFloat("zOffset", zOffset); tag.setFloat("rotation", rotation); tag.setTag("entityData", this.tag); }
@Override public boolean store(@Nonnull Registry registry, @Nonnull Set<NBTAction> phase, @Nonnull NBTTagCompound nbt, @Nonnull Type type, @Nonnull String name, @Nonnull IGrindingMultiplier object) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoHandlerFoundException { NBTTagCompound tag = new NBTTagCompound(); tag.setFloat(CM, object.getChanceMultiplier()); tag.setFloat(PM, object.getPowerMultiplier()); tag.setFloat(GM, object.getGrindingMultiplier()); tag.setInteger(DMJ, object.getDurability()); nbt.setTag(name, tag); return true; }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbtRoot) { nbtRoot.setInteger("experienceLevel", experienceLevel); nbtRoot.setInteger("experienceTotal", experienceTotal); nbtRoot.setFloat("experience", experience); return nbtRoot; }
public void setVelocityOfArrow(ItemStack stack, float velocity) { NBTHelper.checkNBT(stack); NBTTagCompound tag = stack.getTagCompound(); tag.setFloat("velocity", velocity); }
@Override public void writeEntityToNBT(@Nonnull NBTTagCompound root) { super.writeEntityToNBT(root); root.setFloat("scale", getScale()); root.setByte("growthMode", (byte) getGrowthMode().ordinal()); }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound = super.writeToNBT(nbttagcompound); nbttagcompound.setString("UID", allele.getUID()); nbttagcompound.setShort("MT", maturity); nbttagcompound.setFloat("SP", yield); return nbttagcompound; }
@Override public void writeToNBT(NBTTagCompound nbt, String str) { nbt.setDouble(str + "windHit", windHit); nbt.setDouble(str + "windTarget", windTarget); nbt.setDouble(str + "windVariation", windVariation); nbt.setFloat(str + "windTargetFiltred", windTargetFiltred.get()); } }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { nbt = super.writeToNBT(nbt); energyManager.writeToNBT(nbt); nbt.setInteger("EngineHeat", heat); nbt.setFloat("EngineProgress", progress); nbt.setBoolean("ForceCooldown", forceCooldown); return nbt; }
private static void addCoolant(Fluid fluid, float coolingMultiplier) { float coolingPerMb = coolingMultiplier * WATER_COOLING_PER_MB; NBTTagCompound coolantTag = new NBTTagCompound(); coolantTag.setString(KEY_FLUID_NAME, fluid.getName()); coolantTag.setFloat(KEY_COOLING_PER_MB, coolingPerMb); FMLInterModComms.sendMessage(EnderIO, FLUID_COOLANT_ADD, coolantTag); } }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound = super.writeToNBT(nbttagcompound); nbttagcompound.setInteger("Charge", charge); nbttagcompound.setFloat("Progress", progress); nbttagcompound.setInteger("Stage", stage); nbttagcompound.setInteger("Duration", duration); nbttagcompound.setBoolean("Reverse", reverse); return nbttagcompound; }
@Override public NBTTagCompound serialize(NBTTagCompound tag) { super.serialize(tag); tag.setString(Constants.NBT.WILL_TYPE, type.toString()); tag.setDouble("currentInversion", currentInversion); tag.setInteger("currentInfectionRadius", currentInfectionRadius); tag.setInteger("consecutiveFailedChecks", consecutiveFailedChecks); tag.setFloat("animationOffset", animationOffsetValue); return tag; }
@SuppressWarnings("ConstantConditions") public static ItemStack setFoodStats(ItemStack stack, int hunger, float saturation, long cost) { if (!stack.hasTagCompound()) stack.setTagCompound(new NBTTagCompound()); NBTTagCompound tag = stack.getTagCompound(); tag.setInteger(FOOD_LEVEL, hunger); tag.setFloat(SATURATION_LEVEL, saturation); tag.setLong(SELL_VALUE, cost); return stack; }