chameleonframework / chameleon Goto Github PK
View Code? Open in Web Editor NEWCross-platform Minecraft plugin framework
License: MIT License
Cross-platform Minecraft plugin framework
License: MIT License
The proxy switch event in the Velocity support passes null
into the #wrap
method, which requires it to be not null
.
Possible fix is to allow nullable servers to be passed into the event.
A Forge implementation of Chameleon would be nice to have.
When canceling the UserConnectEvent, with orn without a reason, the user is not being kicked.
(Also i saw that the implementation of minestom, the events, are using EventBuilder#ignoredIfCancelled(false);, which devers the purpose of the EventSubscriber#acceptCancelled(true) )
Kicked/Denied the connection/player with a reason.
public class PlayerLoginEvent implements EventSubscriber<UserConnectEvent> {
public PlayerLoginEvent(ChameleonPlugin pl) {
pl.getChameleon().getEventbus().subscribe(this);
}
public void on(UserConnectEvent event) throws Exception {
event.cancel(true);
}
@Override
public boolean acceptCancelled() {
//Gets ingored in the Minestom Impl
return true;
}
}
There is no exception.
Operating System: Windows 11 & Windows 10
Platform(s): Minestom (Latest Release)
None
The current chameleon-annotations
module has a lot of problems, however the major ones are:
It would be helpful if we could completely revamp the chameleon-annotations
module to:
No response
The current design of Chameleon extensions is rather over complicated, hard to work with, and has many features overlooked.
It would be helpful to replace the current Extension system with a new one, that is thoroughly tested and easier to implement.
No response
Due to its artifact management, Minestom has been a pain to upkeep. In addition to this, it is very unlikely that someone is to use Chameleon for a Minestom extension - especially with the recent move to minestom-ce, which doesn't have extensions.
We should remove Minestom support altogether as it is unlikely to be used and no longer matches the purpose of Chameleon.
No response
The dev.hypera.chameleon.platform
package in the api
module currently contains a few classes for platform implementations (e.g. PlatformChameleon
). In the future, other features will require more abstract classes and interfaces for Platforms to use (e.g. #216), making this package quite large.
I think it would be helpful if we added a separate platform-api
module to Chameleon.
This module would contain APIs specifically used by platform implementations, and not needed by end-users (although potentially accessible).
This module could also allow us to make implementing Chameleon platforms easier as we could share more code between platforms without making the main module too large.
I would highly appreciate any feedback on this idea
An exception occurred applying plugin request [id: 'net.kyori.blossom']
> Failed to apply plugin 'net.kyori.blossom'.
> The plugin in class class net.kyori.blossom.Blossom has not been updatedto override the non-Convention apply method in ProjectPlugin!
Blossom should work as expected.
N/A
N/A
N/A
A pull request was merged to resolve this issue: KyoriPowered/blossom#22
However a release has not been made since this pull request was merged
The Adventure mappers currently use Reflection to invoke "platform Adventure" methods.
Reflection is known to be slow, and this can have an impact on performance on platforms where this is required.
MethodHandles
provide an alternative way to invoke methods, whilst being faster than Reflection. However, they are a little bit more complicated and harder to use than Reflection. Additionally, MethodHandles are typed.
If done correctly, I believe moving to MethodHandles would greatly improve the performance of the Adventure mappers, and may allow us to improve the mappers at the same time. Additionally, given MethodHandles are typed, we may be able to catch more issues at compile-time.
No response
It would be helpful to have a mock Chameleon implementation for use in tests.
This would also allow us to write unit tests for Chameleon which would be extremely helpful in the long term.
void myMethod(User user) {
MyUser myUser = userService.getUser(user.getId());
Group group = groupService.getGroup(myUser.getId());
// todo something with group
}
The current implementation of the framework requires multiple service calls to retrieve a user's group information, which can be inefficient and result in unnecessary database queries..
I suggest implementing a metadata system that allows developers to attach custom metadata to a user object, which can be retrieved in a single service call. This would allow for more efficient and streamlined access to user group information.
Code after the sugestion:
public static final MetadataKey<Integer> USER_ID = MetadataKey.of("user_id", Integer.class);
void myMethod(User user) {
Group group = groupService.getGroup(user.getMetadata(USER_ID));
// todo something with group
}
The suggested metadata system could be implemented using a key-value store, similar to the example provided in the code snippet.
Chameleon#getDataFolder()
was renamed to #getDataDirectory()
to align with the majority of platforms.
PlatformPlugin
was missed in this change, and still contains the method #getDataFolder()
.
PlatformPlugin#getDataDirectory()
N/A
N/A
N/A
No response
Gradle is only publishing releases to Maven Central, and is not publishing them to https://repo.hypera.dev/releases/
.
Gradle should have published to both repositories.
`./gradlew publish closeAndReleaseSonatypeStagingRepository`
Release action logs: https://github.com/ChameleonFramework/Chameleon/actions/runs/6161985517/job/16722475885
N/A
N/A
No response
N/A
I think it would be helpful if Chameleon submitted our Dependency Graph to GitHub during the snapshot workflow.
This is now supported by the Gradle Build Action: https://github.com/gradle/gradle-build-action?tab=readme-ov-file#github-dependency-graph-support
No response
Chameleon currently creates a new instance of the ChameleonPlugin
class via reflection.
This does not allow for any custom creation logic, and could cause instantiation issues to go undetected until runtime.
We could add a ChameleonPluginBootstrap
interface that could be used instead of providing a ChameleonPlugin
class.
Paper provides a similar functionality: https://docs.papermc.io/paper/dev/getting-started/paper-plugins#bootstrapper
No response
Gradle has started releasing release candidates for v8.
When a stable Gradle 8 release is made, we should update the project to build with it.
Gradle 8 removes a lot of deprecated features, however when testing Chameleon with Gradle 8, only one change needs to be made to have the project build successfully.
No response
When using the Bukkit scheduler on Folia, an UnsupportedOperationException
is thrown.
Scheduled a task without throwing.
Use the Bukkit Scheduler
java.lang.UnsupportedOperationException: null
at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.handle(CraftScheduler.java:536) ~[folia-1.19.4.jar:git-Folia-"5b74945"]
at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:260) ~[folia-1.19.4.jar:git-Folia-"5b74945"]
at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:247) ~[folia-1.19.4.jar:git-Folia-"5b74945"]
at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:192) ~[folia-1.19.4.jar:git-Folia-"5b74945"]
at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:161) ~[folia-1.19.4.jar:git-Folia-"5b74945"]
Operating System: Windows 10
Platform(s): git-Folia-"5b74945" (MC: 1.19.4)
No response
I think it would be a good idea to remove the feature-configuration
module from Chameleon.
SpongePowered/Configurate is a lot higher quality and more advanced and should be preferred over feature-configuration
.
We currently build and test Chameleon with Java 11 and 17.
Java 21 is the latest released LTS, so we should be testing with it.
However, currently Kotlin does not support Java 21 (therefore nor does Gradle).
As soon as Kotlin and Gradle fully support Java 21:
gradle.yml
, release.yml
and snapshot.yml
to use Java 21chameleon.base.gradle.kts
to test with Java 21 (This can be done before Gradle supports running with Java 21)No response
A more advanced command system should be put in place that allows for less checks to be done inside the command. Some of these ideas include:
A Fabric implementation of Chameleon would be nice to have.
Our current implementation of tab completion works, however there are better ways of handling it that should be considered.
Running the Chameleon example on the Minestom demo server fails with an error.
No error message and the successful loading of the example extension.
1. Build the Chameleon example
2. Copy the `example/build/libs/chameleon-example-0.15.0-SNAPSHOT.jar` into the Minestom servers `extension` folder
3. Run the Minestom server
[main] [11:39:44] (ExtensionManager.loadExtension) - ERROR - While instantiating the main class 'dev.hypera.chameleon.example.platform.minestom.ChameleonExampleMinestom' in 'ChameleonExample' an exception was thrown.: java.lang.NoSuchMethodError: 'dev.hypera.chameleon.example.lib.kyori.adventure.text.logger.slf4j.ComponentLogger net.minestom.server.extensions.Extension.getLogger()'
at Ext_ChameleonExample//dev.hypera.chameleon.platform.minestom.MinestomChameleonBootstrap.<init>(MinestomChameleonBootstrap.java:47)
at Ext_ChameleonExample//dev.hypera.chameleon.platform.minestom.MinestomChameleon.create(MinestomChameleon.java:92)
at Ext_ChameleonExample//dev.hypera.chameleon.example.platform.minestom.ChameleonExampleMinestom.<init>(ChameleonExampleMinestom.java:18)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at net.minestom.server.extensions.ExtensionManager.loadExtension(ExtensionManager.java:305)
at net.minestom.server.extensions.ExtensionManager.loadExtensions(ExtensionManager.java:237)
at net.minestom.server.extensions.ExtensionManager.start(ExtensionManager.java:111)
at net.minestom.server.ServerProcessImpl.start(ServerProcessImpl.java:211)
at net.minestom.server.MinecraftServer.start(MinecraftServer.java:322)
at net.minestom.server.MinecraftServer.start(MinecraftServer.java:327)
at net.minestom.demo.Main.main(Main.java:111)
Operating System: Ubuntu 22.04.2
Platform(s): Minestom (built from latest master but also on release 8ad2c7701f)
The chameleon example has some classes of the Kyori Adventure API in its jar.
Minestom provides them too.
This can potentially cause problems.
I think it is necessary to have a way to get data about the plugin and platform that the plugin is running on.
This data should include:
The current README file does not mention that Chameleon now requires Java 11, or Folia support.
I think it would be a good idea to update the README.md file to mention the Java 11 requirement and the new Folia platform added by @LooFifteen in #217
No response
A Sponge implementation of Chameleon would be nice to have.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
com.google.errorprone:error_prone_annotations
, com.google.errorprone:error_prone_core
).github/workflows/gradle.yml
HyperaDev/actions main
.github/workflows/release.yml
HyperaDev/actions main
.github/workflows/snapshot.yml
HyperaDev/actions main
gradle.properties
settings.gradle.kts
org.gradle.toolchains.foojay-resolver-convention 0.8.0
build.gradle.kts
annotations/build.gradle.kts
api/build.gradle.kts
bom/build.gradle.kts
build-logic/settings.gradle.kts
build-logic/build.gradle.kts
build-logic/src/main/kotlin/chameleon.base.gradle.kts
build-logic/src/main/kotlin/chameleon.common.gradle.kts
build-logic/src/main/kotlin/chameleon.publishing.gradle.kts
example/build.gradle.kts
gradle/libs.versions.toml
net.kyori:adventure-api 4.17.0
net.kyori:adventure-text-serializer-legacy 4.17.0
net.kyori:adventure-text-serializer-gson 4.17.0
net.kyori:adventure-platform-api 4.3.3
net.kyori:adventure-platform-bukkit 4.3.3
net.kyori:adventure-platform-bungeecord 4.3.3
io.papermc.paper:paper-api 1.20.2-R0.1-SNAPSHOT
net.md-5:bungeecord-api 1.20-R0.3-SNAPSHOT
cn.nukkit:nukkit 1.0-SNAPSHOT
org.spongepowered:spongeapi 10.0.0
com.velocitypowered:velocity-api 3.2.0-SNAPSHOT
com.google.code.gson:gson 2.11.0
org.yaml:snakeyaml 2.2
com.squareup:javapoet 1.13.0
org.slf4j:slf4j-api 2.0.13
org.apache.logging.log4j:log4j-api 2.23.1
org.jetbrains:annotations 24.1.0
net.kyori:indra-common 3.1.3
net.kyori:indra-publishing-gradle-plugin 3.1.3
net.kyori:indra-licenser-spotless 3.1.3
com.adarshr:gradle-test-logger-plugin 4.0.0
net.ltgt.gradle:gradle-errorprone-plugin 4.0.1
com.google.errorprone:error_prone_core 2.28.0
com.google.errorprone:error_prone_annotations 2.28.0
net.ltgt.gradle:gradle-nullaway-plugin 2.0.0
com.uber.nullaway:nullaway 0.11.0
com.puppycrawl.tools:checkstyle 10.17.0
org.junit:junit-bom 5.10.3
com.google.truth:truth 1.4.3
com.google.guava:guava-testlib 33.2.1-jre
org.mockito:mockito-bom 5.12.0
net.kyori.indra.publishing.sonatype 3.1.3
io.github.gradle-nexus.publish-plugin 2.0.0
io.github.goooler.shadow 8.1.8
platform-api/build.gradle.kts
platform-bukkit/build.gradle.kts
platform-bungeecord/build.gradle.kts
platform-nukkit/build.gradle.kts
platform-sponge/build.gradle.kts
platform-velocity/build.gradle.kts
gradle/wrapper/gradle-wrapper.properties
gradle 8.8
I think it would be a good idea to move to using Java NIO, as it is newer and faster.
Easy to use and reliable debugging utils would be helpful for creating and maintaining chameleon plugins, these debug utils should include:
Mockito v5 has dropped support for Java 8. This means updating would require us to do the same.
We should completely remove support for Java 8 as it is no longer a good version of Java to use. At the time of writing, only 15 servers are running UltraStaffChatPro v2 on Java 8. The other 251 are using Java 11 or above.
Disclaimer: This is out of all servers with bStats enabled, which is most.
Out of the 15 servers:
These statistics technically mean that all servers that currently run on Java 8 can also be updated to Java 16.
No response
A easy to use error management system should be implemented, the features of this error management system should include:
The PaperMC "Folia Support" documentation recommends checking for the io.papermc.paper.threadedregions.RegionizedServer
class to detect Folia.
N/A
N/A
Operating System: N/A
Platform(s): Folia
No response
There is currently no way to tell how performant our Adventure mappers are.
I think it would be helpful if we added benchmarks for the Adventure mappers using JMH.
No response
Sponge seems to consistently and completely break their API between each version.
We currently only support Sponge v8, and even support for that is problematic and somewhat broken.
E.g. #118
It might work to create several separate modules for sponge; e.g. platform-sponge7
, platform-sponge8
, platform-sponge9
, however this is rather impractical and would take a lot of time and effort to maintain.
We could support only the latest version of Sponge, however that could cause problems for some developers.
If possible, we need to figure out a better solution or drop Sponge support entirely.
No response
ServerUser should be filled with common methods from the Minestom Player and Spigot Player.
The list goes on...
The current GitHub issue templates require fields that should not be required, and format most fields as markdown inside code blocks.
We should improve the GitHub issue templates, making it easier to report bugs and suggest ideas.
No response
Currently, Chameleon requires that plugins provide a ChameleonPluginData
object during bootstrap creation.
This data is stored in Chameleon, however as Chameleon doesn't do anything with it, I don't see the reason for it being required, or existing in the first place.
I do not remember why this was originally introduced.
N/A
N/A
N/A
N/A
No response
I think it would be a good idea to rename the core
module to api
and the package dev.hypera.chameleon.core
to dev.hypera.chameleon
. The name api
makes more sense as the core
module is mostly just abstract classes and interfaces that are implemented by each platform and the package dev.hypera.chameleon
generally looks cleaner.
It would be helpful to have Brigadier command support with Chameleon.
This should be fairly easy to do as platforms like Velocity and Minestom have native support for Brigadier.
To make Chameleon easier to use, I think a documentation site made with Vitepress would probably be best.
This could be done in either a docs/
directory in this repository or in a separate repository.
Currently, when creating support for a Bukkit-based platform, BukkitChameleon must be extended to grant access to Bukkit's manager classes. If these managers begin to use the abstracted classes rather than the internals where possible, it'll be less hacky when adding a platform like this to Chameleon.
Prefer abstract classes over internal implementation in managers.
No response
Map and forward events from the platform to the Chameleon plugin.
To do
Events
Chameleon does not currently have a server list ping event.
It would be helpful if Chameleon added a server list ping event.
This event could be used to create cross-platform MOTD plugins, or any other plugin that modifies the server list ping response.
I suggest a ServerPingEvent
(feedback on name would be appreciated!) be added to the dev.hypera.chameleon.event.common
package.
Platform events:
ServerListPingEvent
ProxyPingEvent
ClientPingServerEvent
ProxyPingEvent
This event would also need a representation of a server list ping response.
No response
It would be nice to have a section towards the bottom of the README.md
file that allows people to show off plugins that they've made that use Chameleon. We would probably have to have some rules for what is allowed so it isn't just used for promotion, however.
Add methods from Spigot's CommandSender, Minestom's CommandSender, BungeeCord's CommandSender and Velocity's CommandSource to ChatUser.
ProxyUser should be filled with common methods from the BungeeCord Player and Velocity Player
When instantiating BungeeCord support, an exception is thrown.
Not throw an error.
`BungeeCordChameleon chameleon = BungeeCordChameleon.create(...);`
java.lang.NullPointerException: Cannot invoke "dev.hypera.chameleon.adventure.ChameleonAudienceProvider.console()" because the return value of "dev.hypera.chameleon.Chameleon.getAdventure()" is null
at dev.hypera.chameleon.platform.bungeecord.user.BungeeCordConsoleUser.<init>(BungeeCordConsoleUser.java:49) ~[?:?]
at dev.hypera.chameleon.platform.bungeecord.user.BungeeCordUserManager.<init>(BungeeCordUserManager.java:59) ~[?:?]
at dev.hypera.chameleon.platform.bungeecord.BungeeCordChameleon.<init>(BungeeCordChameleon.java:61) ~[?:?]
at dev.hypera.chameleon.platform.bungeecord.BungeeCordChameleonBootstrap.loadInternal(BungeeCordChameleonBootstrap.java:58) ~[?:?]
at dev.hypera.chameleon.platform.bungeecord.BungeeCordChameleonBootstrap.loadInternal(BungeeCordChameleonBootstrap.java:42) ~[?:?]
at dev.hypera.chameleon.ChameleonBootstrap.load(ChameleonBootstrap.java:118) ~[?:?]
Operating System: Windows 10
Platform(s): BungeeCord 1.19
No response
The current Adventure mappers do not support the latest version and should be generally improved.
The existing mappers should be completely replaced with a new, more efficient, and non-static system.
No response
PlatformTarget
is missing a static method for creating a Folia platform target.
PlatformTarget#folia()
should exist.
N/A
N/A
N/A
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.