Class NbtClipboardContent
java.lang.Object
net.lenni0451.imnbt.utils.clipboard.NbtClipboardContent
- All Implemented Interfaces:
ClipboardOwner,Transferable
Nbt clipboard content.
Contains the nbt tag that is in the clipboard.
Contains the nbt tag that is in the clipboard.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.lenni0451.mcstructs.nbt.io.NamedTaggetFromClipboard(Clipboard clipboard) Get the nbt tag from the clipboard.static net.lenni0451.mcstructs.nbt.io.NamedTagGet the nbt tag from the system clipboard.getTransferData(DataFlavor flavor) booleanisDataFlavorSupported(DataFlavor flavor) voidlostOwnership(Clipboard clipboard, Transferable contents) voidsetContents(Clipboard clipboard) Set the clipboard contents and owner to this instance.voidSet the system clipboard contents and owner to this instance.
-
Constructor Details
-
NbtClipboardContent
-
-
Method Details
-
getFromClipboard
public static net.lenni0451.mcstructs.nbt.io.NamedTag getFromClipboard(Clipboard clipboard) throws UnsupportedFlavorException, IOException Get the nbt tag from the clipboard.- Parameters:
clipboard- The clipboard to get the tag from- Returns:
- The nbt tag
- Throws:
UnsupportedFlavorException- If the clipboard does not contain a nbt tagIOException- If a serialization error occurs
-
getFromSystemClipboard
public static net.lenni0451.mcstructs.nbt.io.NamedTag getFromSystemClipboard() throws UnsupportedFlavorException, IOExceptionGet the nbt tag from the system clipboard.- Returns:
- The nbt tag
- Throws:
UnsupportedFlavorException- If the clipboard does not contain a nbt tagIOException- If a serialization error occurs
-
setContents
Set the clipboard contents and owner to this instance.- Parameters:
clipboard- The clipboard to set
-
setSystemClipboard
public void setSystemClipboard()Set the system clipboard contents and owner to this instance. -
lostOwnership
- Specified by:
lostOwnershipin interfaceClipboardOwner
-
getTransferDataFlavors
- Specified by:
getTransferDataFlavorsin interfaceTransferable
-
isDataFlavorSupported
- Specified by:
isDataFlavorSupportedin interfaceTransferable
-
getTransferData
- Specified by:
getTransferDatain interfaceTransferable- Throws:
UnsupportedFlavorExceptionIOException
-