2015-11-24 19:59:33 +01:00
|
|
|
/*
|
|
|
|
* This file ("TileEntityBookletStand.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-01-03 16:05:51 +01:00
|
|
|
* http://ellpeck.de/actaddlicense/
|
2015-11-24 19:59:33 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-01-03 16:05:51 +01:00
|
|
|
* © 2016 Ellpeck
|
2015-11-24 19:59:33 +01:00
|
|
|
*/
|
|
|
|
|
2015-12-30 22:02:15 +01:00
|
|
|
package de.ellpeck.actuallyadditions.tile;
|
2015-11-24 19:59:33 +01:00
|
|
|
|
2015-12-30 22:02:15 +01:00
|
|
|
import de.ellpeck.actuallyadditions.booklet.EntrySet;
|
2015-11-24 19:59:33 +01:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
|
|
|
public class TileEntityBookletStand extends TileEntityBase{
|
|
|
|
|
2015-12-04 18:55:50 +01:00
|
|
|
public EntrySet assignedEntry = new EntrySet(null);
|
2015-11-29 14:30:44 +01:00
|
|
|
public String assignedPlayer;
|
2015-11-24 19:59:33 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canUpdate(){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
2015-12-21 22:18:33 +01:00
|
|
|
super.writeSyncableNBT(compound, isForSync);
|
2015-12-04 18:55:50 +01:00
|
|
|
compound.setTag("SavedEntry", this.assignedEntry.writeToNBT());
|
2015-11-24 19:59:33 +01:00
|
|
|
|
2015-11-29 14:30:44 +01:00
|
|
|
if(this.assignedPlayer != null){
|
|
|
|
compound.setString("Player", this.assignedPlayer);
|
2015-11-24 19:59:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
2015-12-21 22:18:33 +01:00
|
|
|
super.readSyncableNBT(compound, isForSync);
|
2015-12-04 18:55:50 +01:00
|
|
|
this.assignedEntry = EntrySet.readFromNBT(compound.getCompoundTag("SavedEntry"));
|
2015-11-24 19:59:33 +01:00
|
|
|
|
2015-11-29 14:30:44 +01:00
|
|
|
String player = compound.getString("Player");
|
|
|
|
if(player != null){
|
|
|
|
this.assignedPlayer = player;
|
2015-11-24 19:59:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|