Conversation
… plugin without having access to internals.
…onfig to allow for standalone server.
…eparate and runs after the main network checks.
- When teleporting the region switch didn't activate due to an inverted if-statement. - Region inactivity was not working correctly due to a invalid config reference. - Certain gui's would break when switching server failed (for example if the server is offline), the gui is now always closed when switching server, even on fail.
…er had a plot verified.
…e Network plugin, allowing standalone mode to use features such as Discord and Tab. Removed the static socket handler. Split the chat listener, sending and other chat features to prevent circular references. No longer needs workarounds for standalone mode for joining. Discord can be used in standalone mode. Tab can be used in standalone mode. Focus can be used in standalone mode. Moderation can be used in standalone mode. Nick can be used in standalone mode. Staff chat can be used in standalone mode.
# Conflicts: # Network-API/src/main/java/net/bteuk/network/api/PlotAPI.java # Plugin/src/main/java/net/bteuk/network/Network.java # Plugin/src/main/java/net/bteuk/network/api/impl/PlotAPIImpl.java # Plugin/src/main/java/net/bteuk/network/commands/Where.java # Plugin/src/main/java/net/bteuk/network/utils/SwitchServer.java # Regions/src/main/java/net/bteuk/network/regions/RegionUser.java # Regions/src/main/java/net/bteuk/network/regions/listener/AbstractMoveListener.java # Regions/src/main/java/net/bteuk/network/regions/listener/RegionMoveListener.java # Regions/src/main/java/net/bteuk/network/regions/listener/RegionTeleportListener.java
…e when clicking options
# Conflicts: # Core/pom.xml # Network-API/pom.xml # PaperCore/pom.xml # Plugin/pom.xml # Plugin/src/main/java/net/bteuk/network/Network.java # Plugin/src/main/java/net/bteuk/network/sql/GlobalSQL.java # Regions/pom.xml # Regions/src/main/java/net/bteuk/network/regions/listener/RegionMoveListener.java # Regions/src/main/java/net/bteuk/network/regions/listener/RegionTeleportListener.java # pom.xml
# Conflicts: # Core/pom.xml # Network-API/pom.xml # PaperCore/pom.xml # Plugin/pom.xml # Regions/pom.xml # pom.xml
| if (args.length == 0) { | ||
| SurveyBook.openSurvey(user, globalSQL); | ||
| } else if (args.length == 1) { | ||
| if (args[0].equalsIgnoreCase("save")) { |
There was a problem hiding this comment.
This if could be combined in the above else if.
| if (surveyBook == null) | ||
| return; | ||
|
|
||
| SurveyBook.AnswerOption answerOption = SurveyBook.AnswerOption.valueOf(args[0].toUpperCase()); |
There was a problem hiding this comment.
This will throw an exception if a wrong value is used, given that this command can be run by a player this is a realistic scenario.
| case Q3_YOUTUBE_LONG -> surveyBook.getSurvey().setBSocialsYoutubeLongform(bYes); | ||
| case Q3_INSTAGRAM -> surveyBook.getSurvey().setBSocialsInstagram(bYes); | ||
| case CHANGE_PAGE -> { | ||
| int toPage = Integer.parseInt(args[1]); |
There was a problem hiding this comment.
This could also throw an exception if the command is manually entered.
| */ | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor | ||
| public class Survey { |
| .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, "/survey " + option.name() + " Y")); | ||
| if (bYSelected) | ||
| component = component.append(Y.decorate(TextDecoration.BOLD).decorate(TextDecoration.UNDERLINED)); | ||
| else |
There was a problem hiding this comment.
I'd prefer if curly braces were used in cases such as this given that there are multiple lines of code under the else, while only the first is in the 'block', this can be confusing and isn't ideal for reading. There are a few other locations where this has been done.
For the if block it's less of an issue since the else is a good divider, although I'd still advise against it.
| user.sendMessage(ChatUtils.success("Thank you! Survey has been saved!")); | ||
| } | ||
|
|
||
| public enum AnswerOption { |
There was a problem hiding this comment.
Given that this enum is used outside of the file it is in it would be good practice to create a separate file for it, although in that case with a more descriptive name.
| user.player.openBook(books[iCurrentPage]); | ||
| } | ||
|
|
||
| public void unregister() { |
There was a problem hiding this comment.
This method is never called, I'd assume it should be when the user disconnects from the server.
Added a survey