mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-16 13:03:12 +01:00
b2a00d2c8d
And still not compilable. Oh god.
41 lines
1.3 KiB
Java
41 lines
1.3 KiB
Java
/*
|
|
* 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
|
|
* http://ellpeck.de/actaddlicense/
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
*
|
|
* © 2016 Ellpeck
|
|
*/
|
|
|
|
package de.ellpeck.actuallyadditions.mod.tile;
|
|
|
|
import de.ellpeck.actuallyadditions.api.internal.EntrySet;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
public class TileEntityBookletStand extends TileEntityBase{
|
|
|
|
public EntrySet assignedEntry = new EntrySet(null);
|
|
public String assignedPlayer;
|
|
|
|
@Override
|
|
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
|
super.writeSyncableNBT(compound, isForSync);
|
|
compound.setTag("SavedEntry", this.assignedEntry.writeToNBT());
|
|
|
|
if(this.assignedPlayer != null){
|
|
compound.setString("Player", this.assignedPlayer);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
|
super.readSyncableNBT(compound, isForSync);
|
|
this.assignedEntry = EntrySet.readFromNBT(compound.getCompoundTag("SavedEntry"));
|
|
|
|
String player = compound.getString("Player");
|
|
if(player != null){
|
|
this.assignedPlayer = player;
|
|
}
|
|
}
|
|
}
|