Lamp

A modern annotations-driven commands framework for Java and Kotlin

MIT License

Stars
197
Committers
16

Bot releases are hidden (Show)

Lamp - Lamp v3.1.8

Published by Revxrsal 11 months ago

  • Fixed a bug in commands that contain :.
  • OfflinePlayer will automatically get the online players for completions

Full Changelog: https://github.com/Revxrsal/Lamp/compare/3.1.7...3.1.8

Lamp - Lamp v3.1.7

Published by Revxrsal about 1 year ago

  • Support for Kotlin's default arguments 🎉 (they must use @Optional)
  • @DefaultFor now accepts a ~ for parent paths
  • Removed @Optional#def()
  • @Optional is now allowed on primitive types, in which case they will use the default primitive value (zero for numbers, false for booleans, etc.)

Full Changelog: https://github.com/Revxrsal/Lamp/compare/3.1.6...3.1.7

Lamp - Lamp v3.1.6

Published by Revxrsal about 1 year ago

  • Fixed Brigadier numerical and boolean arguments not working
  • Fixed Brigadier commands showing the Unknow command message when they are missing an argument
  • Fixed the EntitySelector not showing suggestions
  • Fixed parameters sometimes getting null when they aren't optional
  • JDA slash commands by @bivashy 🎉
  • Sponge 8 by @creatorfromhell 🎉
  • OfflinePlayer fixes

What's Changed

New Contributors

Full Changelog: https://github.com/Revxrsal/Lamp/compare/3.1.5...3.1.6

Lamp - Lamp v3.1.5

Published by Revxrsal over 1 year ago

  • Allow commands to be defined and customized in the plugin.yml
  • New API: ParameterNamingStrategy
  • Add AutoCompleter#filterToClosestInput(boolean) to customize whether inputs are filtered to match the closest input by default or not
  • Fix a small issue in commodore classloading
Lamp - Lamp v3.1.4

Published by Revxrsal over 1 year ago

  • Scheduled removal of the ArgumentParser API
  • Scheduled removal of the ArgumentStack#copy methods
  • @Default functionality has been reduced to default parameters only, and is no longer applicable on methods. Use @DefaultFor instead
  • Added CommandActor#dispatch(...) methods
  • Code cleanups

Migrating

@Default has been replaced by @DefaultFor, which requires explicitly supplying the path to be the default action for. For example:

@Command("foo")
public class FooCommand {

    @Subcommand("help") // The main path is /foo help <page> 
    @DefaultFor("foo")  // <--- We can run /foo <page> and /foo help <page> and 
                        //      get the same result
    public void help(CommandActor actor, @Default("1") int page) {
        ...
    }
}
Lamp - Lamp v3.1.3

Published by Revxrsal over 1 year ago

  • Fix a few bugs in @DefaultFor annotation
  • Added ExecutableCommand#execute methods
  • Categories will now throw exceptions if they have more than one default action
  • Minor improvements and cleanups
Lamp - Lamp v3.1.2

Published by Revxrsal almost 2 years ago

  1. Introduce DefaultFor to better express and control the default action logic
  2. Optional now takes a def() property for the default value, as a full replacement to @Default.
  3. @NotSender will automatically be inferred on arguments that have certain annotations which explicitly imply that the argument is not a sender (for example, @Optional Player, or @Switch("p") Player clearly mean this is a parameter and not a sender).
  4. ArgumentParser has been deprecated, and scheduled for removal in v3.1.4
  5. commandHandler#parseArguments() and commandHandler#parseArgumentsForCompletion() have been deprecated, and are scheduled for removal in v3.1.4. As a replacement, use ArgumentStack#parse() and ArgumentStack#parseForAutoCompletion() respectively.
  6. Consecutive spaces will not be ignored, and will be parsed just like normal arguments. This is to get functionality as similar to Brigadier as possible, and adhere to the common standards in command execution frameworks.
  7. Added functionality to @GuildOnly annotation in JDA
  8. Documented annotations in JDA
Lamp - Flag parameter fixes, player completion fixed, Italian translations

Published by Revxrsal almost 2 years ago

  • Fixed flag parameters getting incorrect type in Brigadier
  • Fixed player suggestions being half-broken when Brigadier is supported
  • Added BukkitBrigadier#disableNativePlayerCompletion() to disable native player completions on Brigadier
  • Italian translation by @HornMCPE
  • Minor optimizations to Brigadier node parser

Full Changelog: https://github.com/Revxrsal/Lamp/compare/3.1.0...3.1.1

Lamp - Full Brigadier implementation on 1.19+, new Either type, bug fixes

Published by Revxrsal about 2 years ago

This version implements native Brigadier support on Minecraft 1.19+.

  • Players can't see commands they don't have access to
  • Certain parameter errors (such as ranges) that are handled by Brigadier will receive Brigadier errors, just like normal Minecraft commands
    image
  • Commands are handled entirely by brigadier now. So unknown subcommands will receive Brigadier errors.
  • ArgumentTypeResolvers are no longer bound to types
  • New Either type 🎉
  • Code cleanups
  • Brigadier cleanup
Lamp - Brigadier on 1.19.1+, minor fixes

Published by Revxrsal about 2 years ago

  • Adds support to Brigadier on Minecraft 1.19.1+ (Paper only)
  • Minor permission fixes with auto-completion
Lamp - Update category permissions

Published by Revxrsal over 2 years ago

  • Fix a small issue in category permissions
Lamp - Replace ArgumentTypes with MinecraftArgumentType enum

Published by Revxrsal over 2 years ago

  • Remove ArgumentTypes utility for 1.19 support
  • Added MinecraftArgumentType enum for accessing and creating Minecraft's argument types
  • Replaced brigadier.bind(Class, String) with brigadier.bind(Class, MinecraftArgumentType)
Lamp - Lamp 3.0.6

Published by Revxrsal over 2 years ago

  • Remove ktx module and migrate it to common
  • Add adventure APIs to Bukkit
    • BukkitCommandHandler#enableAdventure() and BukkitCommandHandler#enableAdventure(BukkitAudiences)
    • BukkitCommandActor#audience()
    • BukkitCommandActor#reply(ComponentLike)
    • Use Audience as a sender in commands
    • Returning Components from methods will be sent to the command actor
  • Add Kotlin extensions to Bukkit
    • bukkitCommandHandler {} DSL
    • brigadier {} DSL
    • CommandActor.sender: CommandSender
    • CommandActor.player: Player
    • CommandActor.playerOrNull: Player?
    • brigadier.bind<Type>(argumentType)
    • brigadier.bind<Type>(argumentTypeResolver)
    • brigadier.bind<Type>(String)
Lamp - Lamp 3.0.6-SNAPSHOT

Published by Revxrsal over 2 years ago

Lamp - Lamp 3.0.5

Published by Revxrsal over 2 years ago

  • minor "no-subcommand-specified" translation fix by @alisson0022 in https://github.com/Revxrsal/Lamp/pull/22
  • Lamp is now truly 100% dependency-less
  • bukkit's module no longer depends on commodore and instead embeds a stripped-down version of it (to change certain behaviour in it as well)
  • bukkit's module also no longer depends on the brigadier module for Brigadier support
  • Introduced new Brigadier API for Bukkit, allowing to register custom argument types for parameters
  • Fixed Brigadier's usage not displaying
  • Player arguments on 1.13.2+ will now be auto-completed by vanilla, allowing selectors to be used on them directly
  • ArgumentStack can be used as a parameter type to access the command input
  • Added SelfHandlingException interface for exceptions that wish to immediately handle themselves
  • General code cleanups
Lamp - Lamp 3.0.4

Published by Revxrsal over 2 years ago

  • Help entries will now include all sibling commands and children of siblings
  • ExecutableCommand and CommandCategory now implement Comparable, to allow them to be sorted according to the alphabetical order
  • Help entries will automatically be sorted in alphabetical order
Lamp - Lamp 3.0.3

Published by Revxrsal over 2 years ago

Warning: This release introduces breaking changes to ArgumentStack.

  • French translation by @SkytAsul
  • Fix MissingArgumentException was not thrown with a missing flag value (#20)
  • Fixed annotation priorities when an annotation is present on both the class and method
  • Added CommandHandler.unregisterAllCommands()
  • @AutoComplete annotations can now accept * for a parameter to reference the default auto-completer
  • Use a supplier for Bukkit's config to avoid loading it (which would throw an error if the config had any problems)
  • Fixed flags not working correctly with Brigadier
  • Fixed flag completion being semi-broken
  • Introduced the ArgumentParser API
  • Added CommandHandler.getArgumentParser(), CommandHandler.setArgumentParser(ArgumentParser), CommandHandler.parseArguments(String...) and CommandHandler.parseArgumentsForCompletion(String...)
  • Fixed Brigadier commands being registered on the minecraft: namespace
  • Improved Brigadier support

ArgumentStack changes:

  • Removed ArgumentStack#of(String...)
  • Removed ArgumentStack#of(Collection<String>)
  • Removed ArgumentStack#forAutoCompletion(String...)
  • Removed ArgumentStack#fromString(String)
  • Renamed ArgumentStack#exactly(Collection<String> to #copy(Collection<String>)
  • Added ArgumentStack#copy(String...)
Lamp - Fix some issues with Jitpack

Published by Revxrsal over 2 years ago

Fix Jitpack issues

Lamp - 3.0.1

Published by Revxrsal over 2 years ago

What's Changed

Full Changelog: https://github.com/Revxrsal/Lamp/compare/3.0.0...3.0.1