fix: fix property register

This commit is contained in:
zimzaza4
2024-09-08 14:19:13 +08:00
parent f5063bf955
commit 4b1ddc2bb9

View File

@@ -124,8 +124,8 @@ public class GeyserUtils implements Extension {
pairs.forEach(p -> { pairs.forEach(p -> {
// only bool, float and int support for now // only bool, float and int support for now
if (p.getValue() == Boolean.class) builder.addBoolean(p.getKey()); if (p.getValue() == Boolean.class) builder.addBoolean(p.getKey());
else if (p.getValue() == Float.class) builder.addBoolean(p.getKey()); else if (p.getValue() == Float.class) builder.addFloat(p.getKey());
else if (p.getValue() == Integer.class) builder.addBoolean(p.getKey()); else if (p.getValue() == Integer.class) builder.addInt(p.getKey());
else instance.logger().info("Found unknown property: " + p.getKey()); else instance.logger().info("Found unknown property: " + p.getKey());
}); });
@@ -209,19 +209,7 @@ public class GeyserUtils implements Extension {
@Subscribe @Subscribe
public void onLoadCommand(GeyserDefineCommandsEvent event) { public void onLoadCommand(GeyserDefineCommandsEvent event) {
event.register(Command.builder(this)
.name("reloadskin")
.source(GeyserConnection.class)
.aliases(List.of("grs"))
.description("Reload GeyserUtils skin.")
.executableOnConsole(true)
.bedrockOnly(false)
.suggestedOpOnly(true)
.permission("geyserutils.skin.reload")
.executor((source, command, args) -> {
loadSkins();
source.sendMessage("Loaded");
}).build());
} }
public void loadSkins() { public void loadSkins() {