aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/IDataCopyable.java
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2024-08-28 06:55:12 +0800
committerGitHub <noreply@github.com>2024-08-27 22:55:12 +0000
commit432bb57cab4e575f63203536e105af81e28e41bf (patch)
treeb44b53b7c6a8d30ffd5c23c004ac8ca6c5c3c501 /src/main/java/gregtech/api/interfaces/IDataCopyable.java
parentefef6ba7b449de1af1e14f6cec141a101d7b1e8d (diff)
downloadGT5-Unofficial-432bb57cab4e575f63203536e105af81e28e41bf.tar.gz
GT5-Unofficial-432bb57cab4e575f63203536e105af81e28e41bf.tar.bz2
GT5-Unofficial-432bb57cab4e575f63203536e105af81e28e41bf.zip
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 <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/IDataCopyable.java')
-rw-r--r--src/main/java/gregtech/api/interfaces/IDataCopyable.java30
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);
+}