Skip to content

KittehOrg/CardboardBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6faa12e · Mar 7, 2025

History

11 Commits
Jan 15, 2025
Jan 15, 2025
Jan 15, 2025
Jan 24, 2025
Mar 7, 2025
Mar 7, 2025
Mar 7, 2025
Mar 7, 2025
Jun 28, 2024
Jun 28, 2024
Mar 7, 2025
Mar 7, 2025
Jan 15, 2025
Jan 15, 2025
Jan 15, 2025

Repository files navigation

Cardboard Box

A simple library for storing and retrieving ItemStacks in Bukkit-related environments.

Version support

Currently, Cardboard Box supports 1.7 through 1.21.4.
Requires Java 21.

Will it need an update for 1.21.5? Maybe.
Will it need an update for 1.22? Definitely.

Support

Via Discord. #cardboardbox channel on MOSS.

Example Code

Example demonstration of storing and retrieving the item in a player's hand:

if (CardboardBox.isReady()) {
    ItemStack item = player.getInventory().getItemInMainHand();
    byte[] data = CardboardBox.serializeItem(item);
    this.getLogger().info(Base64.getEncoder().encodeToString(data));
    ItemStack item2 = CardboardBox.deserializeItem(data);
    this.getLogger().info(item2.toString());
}

Adding to your project

Repository

maven {
    name = "dependencyDownload"
    url = uri("https://dependency.download/releases")
}
<repository>
    <id>dependency.download</id>
    <url>https://dependency.download/releases</url>
</repository>

Dependency

implementation("dev.kitteh:cardboardbox:3.0.2")
<dependency>
    <groupId>dev.kitteh</groupId>
    <artifactId>cardboardbox</artifactId>
    <version>3.0.2</version>
</dependency>