use of net.minecraft.nbt.NBTTagString in project EnderIO by SleepyTrousers.
the class HandleThings method store.
@Override
public boolean store(@Nonnull Registry registry, @Nonnull Set<NBTAction> phase, @Nonnull NBTTagCompound nbt, @Nonnull String name, @Nonnull Things object) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoHandlerFoundException {
NBTTagList list = new NBTTagList();
for (NNIterator<String> itr = object.getNameList().fastIterator(); itr.hasNext(); ) {
list.appendTag(new NBTTagString(itr.next()));
}
nbt.setTag(name, list);
return true;
}
use of net.minecraft.nbt.NBTTagString in project ForestryMC by ForestryMC.
the class MemorizedRecipe method writeToNBT.
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
InventoryUtil.writeToNBT(craftMatrix, nbttagcompound);
nbttagcompound.setLong("LastUsed", lastUsed);
nbttagcompound.setBoolean("Locked", locked);
nbttagcompound.setInteger("SelectedRecipe", selectedRecipe);
NBTTagList recipesNbt = new NBTTagList();
for (IRecipe recipe : recipes) {
ResourceLocation recipeKey = ForgeRegistries.RECIPES.getKey(recipe);
if (recipeKey != null) {
recipesNbt.appendTag(new NBTTagString(recipeKey.toString()));
}
}
nbttagcompound.setTag("Recipes", recipesNbt);
return nbttagcompound;
}
use of net.minecraft.nbt.NBTTagString in project GregTech by GregTechCE.
the class TileEntitySurfaceRock method writeToNBT.
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
compound.setString("Material", Material.MATERIAL_REGISTRY.getNameForObject(material));
NBTTagList tagList = new NBTTagList();
this.undergroundMaterials.forEach(it -> tagList.appendTag(new NBTTagString(Material.MATERIAL_REGISTRY.getNameForObject(it))));
compound.setTag("UndergroundMaterials", tagList);
return compound;
}
use of net.minecraft.nbt.NBTTagString in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class TabKingdomKeys method getSkulls.
public void getSkulls(List list) throws IOException {
ItemStack WHC56skull = new ItemStack(Items.SKULL, 1, 3);
try {
WHC56skull.setTagCompound(new NBTTagCompound());
WHC56skull.getTagCompound().setTag("SkullOwner", new NBTTagString("Wehavecookies56"));
list.add(WHC56skull);
ItemStack AAskull = new ItemStack(Items.SKULL, 1, 3);
AAskull.setTagCompound(new NBTTagCompound());
AAskull.getTagCompound().setTag("SkullOwner", new NBTTagString("Abelatox"));
list.add(AAskull);
} catch (Exception e) {
}
}
use of net.minecraft.nbt.NBTTagString in project RFTools by McJty.
the class MatterTransmitterTileEntity method writeRestorableToNBT.
@Override
public void writeRestorableToNBT(NBTTagCompound tagCompound) {
super.writeRestorableToNBT(tagCompound);
if (name != null && !name.isEmpty()) {
tagCompound.setString("tpName", name);
}
if (teleportDestination != null) {
BlockPos c = teleportDestination.getCoordinate();
if (c != null) {
BlockPosTools.writeToNBT(tagCompound, "dest", c);
tagCompound.setInteger("dim", teleportDestination.getDimension());
}
}
if (teleportId != null) {
tagCompound.setInteger("destId", teleportId);
}
tagCompound.setBoolean("private", privateAccess);
tagCompound.setBoolean("hideBeam", beamHidden);
tagCompound.setBoolean("once", once);
NBTTagList playerTagList = new NBTTagList();
for (String player : allowedPlayers) {
playerTagList.appendTag(new NBTTagString(player));
}
tagCompound.setTag("players", playerTagList);
}
Aggregations