Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private boolean isReliquaryCrafted;
- private static final String IDENTIFIER = Reference.MOD_ID;
- public ModWorldSavedData()
- {
- super(IDENTIFIER);
- }
- public ReliquaryWorldData(String name)
- {
- super(name);
- }
- @Override
- public void readFromNBT(NBTTagCompound compound)
- {
- isReliquaryCrafted = compound.getBoolean("isReliquaryCrafted");
- }
- @Override
- public NBTTagCompound writeToNBT(NBTTagCompound compound)
- {
- compound.setBoolean("isreliquarycrafted", isReliquaryCrafted);
- return compound;
- }
- public void onReliquaryCrafted()
- {
- if(!isReliquaryCrafted)
- {
- this.isReliquaryCrafted = true;
- this.markDirty();
- }
- }
- public void setReliquaryCrafted(boolean isReliquaryCrafted)
- {
- this.isReliquaryCrafted = isReliquaryCrafted;
- this.markDirty();
- }
- public boolean isReliquaryCrafted()
- {
- return isReliquaryCrafted;
- }
- public static ReliquaryWorldData get(World world)
- {
- MapStorage storage = world.getMapStorage();
- ReliquaryWorldData instance = (ReliquaryWorldData)storage.getOrLoadData(ReliquaryWorldData.class, IDENTIFIER);
- if(instance == null)
- {
- instance = new ReliquaryWorldData();
- storage.setData(IDENTIFIER, instance);
- }
- return instance;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement