Jump to content

[1.7.2]Is it possible to save a World obj. in NBT?


memcallen

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.