COWMODSКаталог модов

Biscuit!

A simple API for working with 1.20.5 cookies and transfers in an easy and secure way!

Автор: mrnavastar1,8 тыс.2обновлён 4 янв. 2025 г.
БиблиотекиТехнологииУтилиты

Описание

Maintenance PRs Welcome

ko-fi

Biscuit!

A simple API for working with 1.20.5 cookies and transfers in an easy and secure way!

Features

  • Cookies as POJOs
  • Injected interfaces on many networking classes
  • Cookie Signing for tamper detection
  • Event system
  • Automatic identifier generation (May not be possbile)
  • Encryption
  • Spreading large data across many cookies

Setup

In your build.gradle include:

repositories {
    maven { url "https://api.modrinth.com/maven" }
}

dependencies {
  modImplementation("maven.modrinth:biscuit!:1.1.0")
}

Dev

// Make a class to represent your cookie
public static class TestCookie {

    private final String data;
    
    public TestCookie(String data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return data;
    }
}

// Register the cookie:
Biscuit.register(new Identifier("test", "cookie"), TestCookie.class);

// Register the cookie with a secret for tamper detection. The secret must be the same on all servers requesting this cookie:
Biscuit.register(new Identifier("test", "cookie"), TestCookie.class).setSecret("my_secret");

// Set/Get the cookie from the ServerPlayerEntity, ClientConnection, or any of the network handlers (Not handshake)
TestCookie cookie = new TestCookie("whoohoo!");
player.setCookie(cookie);

player.getCookie(TestCookie.class).whenComplete((cookie, throwable) -> {
    System.out.println(cookie);
});

Set a cookie before your mod (or another mod/the transfer command) transfers the player:

BiscuitEvents.PRE_TRANSFER.register((packet, profile, cookieJar, ci) -> {
    cookieJar.setCookie(cookie);
});

Последние версии

Все версии →
release

Biscuit! 1.1.1

1.1.1
4 янв. 2025 г.274Minecraft: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10fabric, quilt
Скачать
Что нового
- Fix missing kyro dependency
beta

Biscuit! 1.1.0

1.1.0
26 апр. 2024 г.1,4 тыс.Minecraft: 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4fabric, quilt
Скачать
Что нового
- Add Event system - Settings for kicking clients if they have invalid cookies - Remove need for `.finish()` call when registering cookies
beta

Biscuit! 1.0.0

1.0.0
25 апр. 2024 г.140Minecraft: 1.20.5, 1.20.6fabric, quilt
Скачать