Releases: JetbyMC/Libb
Releases · JetbyMC/Libb
Release list
1.2.3
1.2.2
- If
display_nameis not specified, the item's name will be shown instead of nothing. - Automatic downloading of required libraries: libraries are no longer bundled within the plugin itself but are downloaded if not found on your server.
- Examples: Hikari and Adventure (this enables the use of MiniMessage on Spigot and also reduces the plugin's JAR size).
- Added the
LibbApi.getDependentPlugins()method, which returns a list of plugins that use Libb. - Upgraded from Java 17 to Java 21. ||Checked the stats and zero servers were running Java 17—I'm so proud of you all 🥹—you're finally starting to switch to newer versions.||
- Added the
[close]action, which closes the player's open GUI.
Libb 1.2.1
1.2
Serializers
- Reintroducing support for legacy colorization—and more!
# Available serializers:
# LEGACY_AMPERSAND - "&c&lExample &c&9Text"
# LEGACY_SECTION - "§c§lExample §c§9Text"
# MINI_MESSAGE - "<bold><red>Example</red> <blue>Text</blue></bold>"
# GSON - "[{"text":"Example","bold":true,"color":"red"},{"text":" Text","color":"blue"}]"
# PLAIN - "Example Text"
# MINIMAL - &l#RGBExample <#RGB>Text</#RGB>
# UNIFIED - Include all, except GSON
serializer:
type: UNIFIED
cache:
enabled: true
max-size: 500- Usage:
Serializer.TYPE.deserialize(String)→Component - Cache: When
cache: true, duplicate strings are not re-serialized—the component is retrieved from an LRU cache (default size: 500 entries). - Cache Preloading (Warm-up):
List<String> messages = config.getStringList("messages");
Serializer.UNIFIED.cacheAll(messages);- Dynamically obtaining a serializer (based on the type specified in the config):
SerializerType type = SerializerType.valueOf(config.getString("serializer.type"));
HashedSerializer serializer = Serializer.get(type);
Component component = serializer.deserialize(input);- GUIs now include built-in support for these serializers.
1.1
- Added
lockEmptySlotsmethod toAdvancedGuiwhich allows cancelling clicks on unregistered slots. - Added
updateItem(ItemWrapper)method toAdvancedGuiwhich allows updating an item in the GUI. - Fixed
[actionbar]action. - Added replacements in actions, usage example:
ActionExecute.run(ActionContext.of(player)
.replace("{player}", "MrJetby"), "[message] Hello {player}");Commands:
- Full documentation here: wiki.jetby.space
- Convenient registration of any command as well as easy sub-command creation.
Usage example:
public class TestCommand extends AdvancedCommand {
public TestCommand(JavaPlugin plugin) {
super("test_command", plugin);
}
@Override
public boolean onExecute(CommandSender sender, Command command, String label, String[] args) {
sender.sendMessage("Success");
return true;
}
@Override
public List<String> onTab(CommandSender sender, Command command, String label, String[] args) {
return List.of("help");
}
@SubCommand("test")
@PlayerOnly
public void test(Player player) {
player.sendMessage("Test argument successfully works");
}
}Usage example (sub-command):
@SubCommand("reload")
@Permission("libb.command.reload")
public void reload(CommandSender sender) {
try {
long start = System.currentTimeMillis();
plugin.guisConfiguration.unregisterGuiCommands();
plugin.guisConfiguration.load();
for (Player p : Bukkit.getOnlinePlayers()) {
Inventory topInventory = p.getOpenInventory().getTopInventory();
if (!(topInventory instanceof AdvancedGui)) continue;
p.closeInventory();
}
sender.sendMessage(Libb.MINI_MESSAGE.deserialize("<green>Libb reloaded in "+(System.currentTimeMillis()-start)+" ms."));
} catch (Exception e) {
sender.sendMessage(Libb.MINI_MESSAGE.deserialize("<red>Reload error, check the console."));
e.printStackTrace();
}
}Command registration (example):
new LibbCommand(this).register();