Biscuit!

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

Редакция NLZONE · 1 мин чтения · 0 просмотров
Biscuit!
Скачать Biscuit!1.20 – 1.21.9 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

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

  • Тип: мод
  • Загрузчик: fabric, quilt
  • Версии Minecraft: 1.20 – 1.21.9
  • Скачиваний на Modrinth: 1 746

Подробно

[](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [](http://makeapullrequest.com)

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

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

Setup In your build.gradle include: gradle repositories { maven { url "https://api.modrinth.com/maven" } }

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

java // 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("mysecret");

// 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: java BiscuitEvents.PRETRANSFER.register((packet, profile, cookieJar, ci) -> { cookieJar.setCookie(cookie); });

Как установить

Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.

Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.

Редакция NLZONE

Пишем о серверах, модах и играх, в которые играем сами. Нашли ошибку — напишите нам, исправим.

Комментарии 0

Комментарии к этому материалу отключены.

Читайте также