aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/IDataCopyable.java
blob: 9994354fa7681286e772e14716f8f1c228a8bced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
}