Skip to content

Commit

Permalink
final touchups for release
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Jun 1, 2023
1 parent 22fa038 commit d96cba8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ dependencies {
exclude group: 'io.netty'
}

implementation('com.fasterxml.jackson.core:jackson-annotations:2.15.1')
implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.1')
implementation('com.fasterxml.jackson.core:jackson-core:2.15.1')
api('com.fasterxml.jackson.core:jackson-annotations:2.14.2')
api('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.2')
api('com.fasterxml.jackson.core:jackson-core:2.14.2')
}

jar {
archiveFileName = 'MagicMenu-unshaded-1.0.jar'

archiveClassifier.set("unshaded")
}

// Output to build/libs/shadow.jar
Expand All @@ -52,6 +51,7 @@ shadowJar {
archiveClassifier.set('')

relocate('com.fasterxml.jackson', 'net.onebeastchris.extension.magicmenu.jackson')
relocate('org.yaml', 'net.onebeastchris.extension.magicmenu.yaml')
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import static net.onebeastchris.extension.magicmenu.util.PlayerMenuHandler.hasPerms;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private static void sendCommand(GeyserConnection connection, String command) {

MagicMenu.debug("Sending command: " + command);
if (session.getGeyser().getPlatformType() == PlatformType.STANDALONE &&
session.getGeyser().commandManager().runCommand(session, command.substring(0))) {
session.getGeyser().commandManager().runCommand(session, command)) {
return;
}
session.sendCommand(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private void handle(Object object, GeyserConnection connection) {
}

if (object instanceof Config.Form form) {
MagicMenu.getLogger().error("Adding form: " + form.title() + " to stack.");
MagicMenu.debug("Adding form: " + form.title() + " to stack.");
stack.add(form);
// checking for buttons, or back.
MenuHandler.sendForm(connection, form).whenCompleteAsync((button, throwable) -> {
Expand Down Expand Up @@ -94,7 +94,7 @@ private void handle(Object object, GeyserConnection connection) {
MagicMenu.debug("No command or form found for button: " + button.name() + " and player: " + username + ".");
}
if (object instanceof Config.CommandHolder commandHolder) {
MagicMenu.getLogger().error("Adding command: " + commandHolder.command() + " to stack.");
MagicMenu.debug("Adding command: " + commandHolder.command() + " to stack.");
stack.add(commandHolder);
MenuHandler.executeCommand(connection, commandHolder).whenCompleteAsync((resultType, throwable) -> {
if (throwable != null) {
Expand Down Expand Up @@ -144,14 +144,14 @@ private boolean checkForCommand(GeyserConnection connection, Object object) {
}

public void goBack(GeyserConnection connection) {
MagicMenu.getLogger().debug("Going back? " + MagicMenu.getConfig().goBackOnClosed() + " stack size: " + stack.size());
MagicMenu.debug("Going back? " + MagicMenu.getConfig().goBackOnClosed() + " stack size: " + stack.size());
if (MagicMenu.getConfig().goBackOnClosed()) {
var ignored = stack.pop(); // last element is what we were on.
MagicMenu.getLogger().debug("Current: " + ignored.getClass().getName());
MagicMenu.debug("Current: " + ignored.getClass().getName());

if (!stack.isEmpty()) {
handle(stack.pop(), connection);
MagicMenu.getLogger().debug("NEW Stack size: " + stack.size());
MagicMenu.debug("NEW Stack size: " + stack.size());
} else {
MagicMenu.debug("Stack is empty.");
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ menus:
# Enter the allowed users here. If you want to allow all users, remove "allowed-users" entirely
# if someone isn't allowed to use this menu, they will just emote normally.
allowed-users:
- onebeastchris
- onebeastofchris
- someotheraccount
# Enter the title/description of the menu here; description is optional.
Expand Down Expand Up @@ -117,11 +116,10 @@ menus:
- command-name: "gamemode"
run: "gamemode !%dropdown:Choose a gamemode, creative, creative, survival, adventure, spectator%"
allowed-users:
- onebeastchris
- onebeastofchris
- someotheraccount

# As the command below is only accessible to onebeastchris, onebeastofchris and someotheraccount, the command above will only run for them.
# As the command above is only accessible to onebeastofchris and someotheraccount, the command above will only run for them.
# The command below has no set allowed users, therefore, it will run for everyone else.
# One button cannot run multiple commands.
- command-name: "say"
Expand Down

0 comments on commit d96cba8

Please sign in to comment.