From 432bb57cab4e575f63203536e105af81e28e41bf Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 28 Aug 2024 06:55:12 +0800 Subject: implement whole multiblock hatch configuration copying (#2965) enable whole multiblock hatch configuration copying does not include crafting bus for now Co-authored-by: Martin Robertz Co-authored-by: boubou19 --- .../gregtech/api/interfaces/IDataCopyable.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/gregtech/api/interfaces/IDataCopyable.java (limited to 'src/main/java/gregtech/api/interfaces') 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); +} -- cgit