Posted November 1, 201410 yr I have a class which essentially justs saves a block position to nbt and can load it from nbt, and I want to store either a TileEntity or a world obj. in the nbt as well heres my class if you need it: package com.example.gammacraft.Helpers; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class BlockPos { int x,y,z; World world; TileEntity te; public BlockPos(int x,int y,int z,World world,TileEntity te) { this.x=x; this.y=y; this.z=z; this.world=world; this.te=te; } public BlockPos(){ } public void writeToNBT(NBTTagCompound nbt){ nbt.setInteger("x", x); nbt.setInteger("y", y); nbt.setInteger("z", z); } public void readFromNBT(NBTTagCompound nbt){ this.x = nbt.getInteger("x"); this.y = nbt.getInteger("y"); this.z = nbt.getInteger("z"); } } The proud(ish) developer of Ancients
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.