Gokilcraft

Gokilcraft

I build Minecraft server plugins. Most of the work so far is one crate system, from the key on a player's hotbar to the file it is saved in.

This site shows that work with the measurements left in, including what has not been tested yet.

01

Work

An Example Crate in a savanna world, with its hologram and orange particles above the block

Free plugin

GokilCrates

A crate plugin for Spigot-family servers. It handles physical and virtual keys, guaranteed rewards at a spin count, a coin shop for duplicate prizes, seasonal opening times, and an editor that works from inside the game.

  • 4 releases
  • 9,826 lines of Java
  • 22 particle effects
  • 3 storage options
Two renders of the Mega Crate model: a gold and obsidian chest closed, then open with a floating gem

Private build

GokilCrates Pro

The larger edition, running on a test server. It adds payment through Vault, PlayerPoints, experience, items or custom currencies, seven languages, a textured menu pack, twelve animations played around the crate, layered sounds and ModelEngine 4 crate models.

The image is a render of the Mega Crate model file, which was generated by script with its idle, open and close animations.

02

Build notes

Every chest click paid for a crate check

The plugin asked each clicked inventory for its holder to see whether it was a crate menu. For a chest, that call copies block state. Plugin menus have no location, so checking the location first rules out block inventories almost for free.

2,633 nsto49 ns

One key change rewrote the whole ledger

With YAML storage, every issued or used key saved the full key ledger. Changes are now queued on the storage thread, and the file is written once after the last change in a burst.

997 msto17 ms

100 changes on a ledger with 1,000 keys.

Old 3D models stayed frozen on screen

Editing a crate left copies of its ModelEngine model in front of players. A small test client that logs in and counts entities showed the leak: 17 model parts became 34, 51, then 68. Players are now moved out of the model's tracking range before it is removed.

68 partsto17 parts

The host only opened one port

A resource pack served on its own port could not be downloaded from a panel host that exposes only the game port. Pro now looks at the first bytes of each new connection on that port. An HTTP request gets the pack, and anything else carries on as a normal Minecraft login.

Colour tags appeared as plain text

Bukkit and Spigot do not include MiniMessage, so menus showed tags such as <gold>. GokilCrates now has its own small reader for those servers. Its output was compared with real MiniMessage on 1,672 strings from the plugin's files and test cases.

0differences

Gradient colours were allowed to differ by up to 3 out of 255 per channel.

Autosave work left the main thread

Autosave used to build each player's YAML on the main thread. It now takes a quick copy there and does the rest on the storage thread.

217 µsto5 µs

Main-thread time for a player with data in 20 crates.

03

Test status

A plugin page should say what was actually run. This is where GokilCrates 1.0.3 stands.

ServerStatusWhat that means
Leaf 26.2 Tested Automated checks plus a connected test client that receives keys, opens crates, mass opens and reloads.
Paper Expected to work Leaf is built on Paper, but this has not been run on Paper itself.
Spigot, CraftBukkit Not run yet Built against the Spigot API. The colour reader was checked without MiniMessage, but not on a live Spigot or CraftBukkit server.
Folia Not run yet Uses Folia's scheduler API, exercised on Leaf. It has not been started on a real Folia server.