diff options
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/IDataCopyable.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IDataCopyable.java b/src/main/java/gregtech/api/interfaces/IDataCopyable.java new file mode 100644 index 0000000000..9994354fa7 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IDataCopyable.java @@ -0,0 +1,30 @@ +package gregtech.api.interfaces; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public interface IDataCopyable { + + /** + * Implementation will set the type field. caller can assume the returned tag (if not null) always contains a "type" + * field + * with a value of {@link #getCopiedDataIdentifier(EntityPlayer)} + * Implementation should not try to alert player of situations that copy has failed. + * + * @return null if cannot copy (e.g. not properly configured yet) or the data to copy. + */ + NBTTagCompound getCopiedData(EntityPlayer player); + + /** + * Callee should check if the given tag is valid. + * Implementation should not try to alert player of situations that paste has failed. + * + * @return true if pasted. false otherwise. + */ + boolean pasteCopiedData(EntityPlayer player, NBTTagCompound nbt); + + /** + * @return the type identifier. this should be a constant for the given set of arguments. + */ + String getCopiedDataIdentifier(EntityPlayer player); +} |