Giter VIP home page Giter VIP logo

chimera's Introduction

Just your friendly neighbourhood software engineer πŸ‘€

I'm one of the co-founders of Forus Labs, having previously created & worked on TimeBloc until the application's acquisition, and Essential. I'm also currently studying at NTU.

Open Source Projects:

  • Sugar, an extension to Dart's standard library, including datetimes & timezones.
  • Chimera, a static code generation tool for generating commands in Spigot plugins.
  • Elementary, JUnit 5 extensions for testing annotation processors.
  • Readling List, a curated list of blogs/articles/papers.

I also occasionally write articles on Medium.

Pante's stats

chimera's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar pante avatar profluz avatar renovate[bot] avatar skytasul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chimera's Issues

Command description

Is your feature request related to a problem? Please describe.
There is no way to put a command description when registering a command through chimera. When using /help, the command appears with no description.

Describe the solution you'd like
A way to register a command description.

Command never gets executed

I am experiencing a problem that sounds very similar to #253, in fact, I originally did have the commands declared in my plugin.yml. I then removed them, but I still have the same problem.

Basically, the code looks like this:

// in onEnable
val test = Literal.of("test").executes { source, _ ->
     source.sendMessage("Hello, World!")
}.build()

dispatcher.root.addChild(test)
dispatcher.update()

The command is, in a way, registered, because it shows up in completion. However when I try to execute it, nothing happens. Log statements and debugging also confirmed that the executes lambda never gets executed. I've seen in other support questions (like #253) that people are also using annotation-based command registration. However, I'm trying to accomplish this with the plain brigadier / chimera builders only. Do I still need some basic annotation for it to work?

Version Data:

  • Paper 1.19.2 (API version 1.19)
  • OpenJDK 17 (compiled with target version 11)
  • karuslabs commons 5.4.1
  • brigadier 1.0.18
  • Kotlin/JVM 1.7.10

1.17 support?

Is your feature request related to a problem? Please describe.
Currently chimera commons do not support 1.17 as it uses hardcoded NMS.

Describe the solution you'd like
I'd like a 1.17 support.

Could not GET dependency metadata.xml

I'm using Gradle in my project, and when attempting to build I'm getting:

org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://repo.karuslabs.com/repository/lingua-franca-releases/com/comphenix/executors/BukkitExecutors/1.1-SNAPSHOT/maven-metadata.xml'. Received status code 400 from server: Repository version policy: RELEASE does not allow metadata in path: com/comphenix/executors/BukkitExecutors/1.1-SNAPSHOT/maven-metadata.xml

From my build.gradle

repositories {
    maven { url 'https://repo.karuslabs.com/repository/chimera-releases/' }
    maven { url 'https://repo.karuslabs.com/repository/lingua-franca-releases/' }
}

dependencies {
    compile group: 'com.karuslabs', name: 'commons', version: '4.2.0'
}

I found the lingua-franca repo on your server, which fixed the issue that it was unable to retrieve the dependency in the first place, however this issue still remains.

[BUG] Suggestions not suggested after reload

Describe the bug
Seems like the behaviour of either ServerLoadEvent or Player.updateCommands() has changed. Players no longer receive the updated suggestions after a reload. Logging back in seems to fix the issue.

Environment (please complete the following information):

  • Java Version 16
  • Spigot
  • 1.17
  • 5.0.0-SNAPSHOT

[BUG] WordType.word() not compatible with non-ASCII characters

Describe the bug
Non-ASCII commands are no longer working after the 1.19 commits. For example, the Swedish letters "Γ₯", "Γ€", and "ΓΆ" are no longer working with the WordType.word() argument type.

To Reproduce
Steps to reproduce the behavior:

  1. Type a command containing a letter such as "ΓΆ" (WordType.word()).
  2. Screenshot of the error.

Expected behavior
The command should be executed as usual since it is supported by greedy strings.
See code here.

Environment (please complete the following information):

  • Java Version [17]
  • Platform [PaperMC]
  • Platform Version [1.19.2]
  • Chimera Version [5.4.2]

[Enhancement] Support repeating command sequences

Is your feature request related to a problem? Please describe.
At present, adding a repeating sequence of command is more painful than necessary as it is not supported directly by Chimera. Developers wishing to add a repeating sequence need to manually iterate over each sequence and append it to the leaf of the previous sequence.

For example:

var builder = Argument.of("borderSize", IntegerArgumentType.integer(1)).then(Argument.of("borderShrinkTime", LongArgumentType.longArg(1)));
var command = builder.build();
var root = command;

for (var i = 0; i < 10; i++) {
  var child = builder.build();
  command.addChild(child);
  command = child;
}

This is both unwieldy since it needs to be manually re-coded for each repeating sequences and error-prone since iteratively adding sequences requires juggling multiple conditions and variables.

Describe the solution you'd like
We propose adding a repeating(int times) method to Literal and Argument, and their respective builders to facilitate adding repeating sequences.

Additional context
This issue was first raised by MrLn on Discord.

[BUG] Registered commands do not work

Describe the bug
When trying to register a command other than the "tell" command in 1.16.4, it will not execute. I tried every possible variant, but every time the "syntax" message or no message if syntax was not defined gets displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Defined command with Scribe (yml generates correctly; checked it)
@Command(
    name = "testcommand",
    aliases = ["tcmd"]
)
  1. Register command
val dispatcher = Dispatcher.of(this)
dispatcher.root.addChild(
    Literal.of("testcommand").then(Argument.of("?", IntegerArgumentType.integer(30, 43))
        .suggests { context, builder ->
            builder.suggest(42, LiteralMessage("The answer to life the universe and everything")).buildFuture()
        }).build())
dispatcher.update()

or

val dispatcher = Dispatcher.of(this)
dispatcher.root.addChild(
    Literal.of("testcommand").executes { command ->
        command.source.sendMessage("ok")
        return@executes 1
    }
dispatcher.update()
  1. Execute command /testcommand or /tcmd
  2. Nothing happens (no suggestion or execution) - when using "tell" as the command name, the examples work

Expected behavior
The command should execute instead of doing nothing

Screenshots
-

Environment (please complete the following information):

  • Kotlin 1.4 (compiling to Java 11)
  • PaperSpigot (running on Java 13)
  • 1.16.4
  • 4.9.0-SNAPSHOT

Additional context
-

[BUG] ClassNotFoundException, it tried to find obc.v1_19_R1, but the package in server is obc.v1_19_R2.

Describe the bug
It caused a no classdef error.
When I use chimera on paper 1.19.3, it tried to find obc.v1_19_R1, but the package in server is obc.v1_19_R2.
In the latest 5.4.2-SNAPSHOT of chimera, it still can be reproduced.

To Reproduce

  1. Follow the wiki, I wrote some code.
  2. Use papermake plugin to run a paper server.
  3. Dispatcher.of(JavaPlugin) got ClassNotFoundException.

Expected behavior
It should run correctly.

Environment (please complete the following information):

  • Java Version: 17
  • Platform: Paper
  • Platform Version: 1.19.3 build 426
  • Chimera Version: 5.4.2-SNAPSHOT

Additional context
Some logs:

[08:01:08 ERROR]: Error occurred while enabling AlchemyIO v1.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_19_R1/CraftServer
	at libs.com.karuslabs.commons.command.dispatcher.Dispatcher.of(Dispatcher.java:77) ~[_papermake_hooked_JtFUwtSJVIRD5jjJeIoV9vizPkRRJqtH.jar:?]
	at io.github.alchemy_io.alchemyio.commands.AIOCommands.registerCommands(AIOCommands.java:9) ~[_papermake_hooked_JtFUwtSJVIRD5jjJeIoV9vizPkRRJqtH.jar:?]
	at io.github.alchemy_io.alchemyio.AlchemyIO.onEnable(AlchemyIO.java:37) ~[_papermake_hooked_JtFUwtSJVIRD5jjJeIoV9vizPkRRJqtH.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.3.jar:git-Paper-426]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.3.jar:git-Paper-426]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:561) ~[paper-1.19.3.jar:git-Paper-426]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:472) ~[paper-1.19.3.jar:git-Paper-426]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:274) ~[paper-1.19.3.jar:git-Paper-426]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.19.3.jar:git-Paper-426]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-426]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_19_R1.CraftServer
	at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:181) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:148) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
	... 13 more

[BUG] `StringArgumentType.word()` does not support non-ASCII characters

Describe the bug
failed building project with error "could not find...". more info in screenshots

To Reproduce
Steps to reproduce the behavior:

  1. try to build project with chimera
  2. see error

Expected behavior
successful build

Screenshots
image

Environment (please complete the following information):

  • Java Version -16
  • Platform - Paper
  • Platform Version - 1.1.12
  • Chimera Version - 5.0.0

Additional context
tried to downloads two files: satisfactory and utilitary

when clicking on any link, a 404 error is returned

[Enhancement] Command block support

Is your feature request related to a problem? Please describe.
Currently, executing commands registered via Chimera from command blocks do not do anything.

Describe the solution you'd like
A way to execute Chimera commands from command blocks.

[BUG] After reparsing CommandContext arguments are empty

Describe the bug
After reparsing CommandContext in SpigotMapper arguments become empty

To Reproduce
Steps to reproduce the behavior:

        var second = Argument.of("second", StringArgumentType.word())
                .suggests((context, builder) -> {
                    context.getArgument("first", String.class); // No such argument 'first' exists on this command
                    return builder.buildFuture();
                });

        var first = Argument.of("first", StringArgumentType.word());

        Literal.of("test").then(first.then(second));

Expected behavior
context.getArgument("first", String.class) returns true value

Screenshots
https://i.imgur.com/dWvrnjo.png

Environment (please complete the following information):

  • Java Version - OpenJDK 64-Bit Server VM 14.0.1+7
  • Platform - git-Paper-87
  • Platform Version - 1.16.1
  • Chimera Version - 4.7.0

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/update_schedule' value "live" did not match one of the following values: daily, weekly, monthly

Please update the config file to conform with Dependabot's specification using our docs and online validator.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Retry-After: unexpected status code 521

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency com.puppycrawl.tools:checkstyle to v10.17.0
  • Update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.4.0
  • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.13.0
  • Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.6.0
  • Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0
  • Update dependency org.checkerframework:checker-qual to v3.44.0
  • Update dependency org.mockito:mockito-junit-jupiter to v5.12.0
  • Update dependency com.karuslabs:elementary to v3
  • Update dependency com.karuslabs:utilitary to v3
  • πŸ” Create all rate-limited PRs at once πŸ”

Warning

Renovate failed to look up the following dependencies: Failed to look up maven package com.karuslabs:chimera, Failed to look up maven package org.spigotmc:spigot, Failed to look up maven package com.karuslabs:satisfactory.

Files affected: annotations/pom.xml, commons/pom.xml, typist-example-plugin/pom.xml, typist/pom.xml


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/nightly.yml
  • styfle/cancel-workflow-action 0.12.1
  • actions/checkout v4
  • actions/setup-java v4
.github/workflows/pr.yml
  • styfle/cancel-workflow-action 0.12.1
  • actions/checkout v4
  • actions/setup-java v4
.github/workflows/release.yml
  • styfle/cancel-workflow-action 0.12.1
  • actions/checkout v4
  • actions/setup-java v4
maven
annotations/pom.xml
  • com.karuslabs:chimera 5.5.0
  • org.apache.maven.plugins:maven-shade-plugin 3.5.3
commons/pom.xml
  • com.karuslabs:chimera 5.5.0
  • org.spigotmc:spigot 1.19.3-R0.1-SNAPSHOT
  • com.mojang:brigadier 1.0.18
  • org.apache.maven.plugins:maven-compiler-plugin 3.11.0
  • net.md-5:specialsource-maven-plugin 2.0.3
  • org.apache.maven.plugins:maven-shade-plugin 3.5.3
pom.xml
  • org.checkerframework:checker-qual 3.42.0
  • org.junit.jupiter:junit-jupiter-api 5.10.0
  • org.junit.jupiter:junit-jupiter-engine 5.10.0
  • org.junit.jupiter:junit-jupiter-params 5.10.0
  • org.mockito:mockito-core 5.6.0
  • org.mockito:mockito-junit-jupiter 5.11.0
  • org.apache.maven.plugins:maven-compiler-plugin 3.11.0
  • org.apache.maven.plugins:maven-surefire-plugin 3.2.5
  • org.apache.maven.plugins:maven-checkstyle-plugin 3.3.1
  • com.puppycrawl.tools:checkstyle 10.16.0
  • org.jacoco:jacoco-maven-plugin 0.8.11
  • org.apache.maven.plugins:maven-source-plugin 3.3.0
  • org.apache.maven.plugins:maven-javadoc-plugin 3.6.0
  • org.apache.maven.plugins:maven-deploy-plugin 3.1.2
  • org.apache.maven.plugins:maven-site-plugin 3.12.1
  • org.apache.maven.wagon:wagon-webdav-jackrabbit 3.5.3
typist-example-plugin/pom.xml
  • com.karuslabs:chimera 5.5.0
  • org.spigotmc:spigot 1.19.3-R0.1-SNAPSHOT
  • com.mojang:brigadier 1.0.18
  • org.spigotmc:spigot-api 1.19.3-R0.1-SNAPSHOT
  • org.apache.maven.plugins:maven-compiler-plugin 3.11.0
  • org.apache.maven.plugins:maven-shade-plugin 3.5.3
typist/pom.xml
  • com.karuslabs:chimera 5.5.0
  • com.karuslabs:satisfactory 1.1.2
  • com.karuslabs:utilitary 2.0.0
  • org.apache.commons:commons-text 1.11.0
  • com.google.auto.service:auto-service-annotations 1.1.1
  • org.spigotmc:spigot-api 1.19.3-R0.1-SNAPSHOT
  • com.mojang:brigadier 1.0.17
  • com.karuslabs:elementary 2.0.0
  • org.apache.maven.plugins:maven-compiler-plugin 3.11.0
  • com.google.auto.service:auto-service 1.1.1
  • org.apache.maven.plugins:maven-shade-plugin 3.5.3
  • org.apache.maven.plugins:maven-resources-plugin 3.3.1

  • Check this box to trigger a request for Renovate to run again on this repository

[BUG] Bad service configuration file, or exception thrown while constructing Processor object: com/karuslabs/utilitary/AnnotationProcessor

Describe the bug
When building, it says Bad service configuration file, or exception thrown while constructing Processor object: com/karuslabs/utilitary/AnnotationProcessor

To Reproduce
Steps to reproduce the behavior:

  1. Build with typist
  2. See error

Expected behavior
I expected it to build, since there are no errors on my IDE.

Environment (please complete the following information):

  • Java Version: 17
  • Platform: Paper
  • Platform Version: 1.18.2
  • Chimera Version: 5.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.