Skip to content

Commit

Permalink
Fix StackOverflowException and release hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Efnilite committed Apr 23, 2022
1 parent 0e44807 commit 6f2f9c4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>dev.efnilite</groupId>
<artifactId>WITP</artifactId>
<packaging>pom</packaging>
<version>3.2.3</version>
<version>3.2.4</version>
<modules>
<module>witp</module>
</modules>
Expand Down
6 changes: 3 additions & 3 deletions witp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<artifactId>WITP</artifactId>
<groupId>dev.efnilite</groupId>
<version>3.2.3</version>
<version>3.2.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>witp</artifactId>
<version>3.2.3</version>
<version>3.2.4</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -143,7 +143,7 @@
<dependency>
<groupId>com.github.ViStudios</groupId>
<artifactId>vilib</artifactId>
<version>e3fd4c381b</version>
<version>04af827647</version>
<scope>compile</scope>
</dependency>

Expand Down
13 changes: 7 additions & 6 deletions witp/src/main/java/dev/efnilite/ip/ParkourCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dev.efnilite.ip.menu.GamemodeMenu;
import dev.efnilite.ip.menu.LeaderboardMenu;
import dev.efnilite.ip.menu.MainMenu;
import dev.efnilite.ip.player.ParkourPlayer;
import dev.efnilite.ip.player.ParkourUser;
import dev.efnilite.ip.player.data.InventoryData;
Expand Down Expand Up @@ -55,11 +54,13 @@ public boolean execute(CommandSender sender, String[] args) {

if (args.length == 0) {
// Main menu
if (player == null) {
sendHelpMessages(sender);
} else if (ParkourOption.MENU.check(player)) {
MainMenu.open(player);
}
sendHelpMessages(sender);

// if (player == null) {
// sendHelpMessages(sender);
// } else if (ParkourOption.MENU.check(player)) {
// MainMenu.open(player);
// }
return true;
} else if (args.length == 1) {
switch (args[0].toLowerCase()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev.efnilite.ip.generator;

import dev.efnilite.ip.IP;
import dev.efnilite.ip.menu.SettingsMenu;
import dev.efnilite.ip.events.BlockGenerateEvent;
import dev.efnilite.ip.events.PlayerFallEvent;
import dev.efnilite.ip.events.PlayerScoreEvent;
import dev.efnilite.ip.generator.base.DefaultGeneratorBase;
import dev.efnilite.ip.generator.base.GeneratorOption;
import dev.efnilite.ip.menu.SettingsMenu;
import dev.efnilite.ip.player.ParkourPlayer;
import dev.efnilite.ip.reward.RewardReader;
import dev.efnilite.ip.reward.RewardString;
Expand Down
51 changes: 26 additions & 25 deletions witp/src/main/java/dev/efnilite/ip/menu/SettingsMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dev.efnilite.ip.ParkourOption;
import dev.efnilite.ip.api.StyleType;
import dev.efnilite.ip.player.ParkourPlayer;
import dev.efnilite.ip.player.ParkourUser;
import dev.efnilite.ip.util.Util;
import dev.efnilite.ip.util.config.Configuration;
import dev.efnilite.ip.util.config.Option;
Expand Down Expand Up @@ -259,31 +260,31 @@ public static void open(ParkourPlayer user, ParkourOption... disabledOptions) {
}));
}

// if (checkOptions(player, ParkourOption.GAMEMODE, disabledOptions)) {
// Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.GAMEMODE.getName());
//
// main.item(19, item.click(event -> GamemodeMenu.open(user)));
// }
//
// if (checkOptions(player, ParkourOption.LEADERBOARD, disabledOptions)) {
// Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.LEADERBOARD.getName())
// .modifyLore(line -> // #%n (%s)
// line.replace("%s", "#" + ParkourUser.getRank(user.getUUID()) + " (" +
// user.highScore.toString()) + ")");
//
// main.item(20, item.click(event -> {
// player.closeInventory();
// LeaderboardMenu.open(player);
// }));
// }
//
// if (checkOptions(player, ParkourOption.LANGUAGE, disabledOptions)) {
// Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.LANGUAGE.getName())
// .modifyLore(line ->
// line.replace("%s", user.getLocale()));
//
// main.item(21, item.click(event -> LangMenu.open(user, disabledOptions)));
// } todo remove/transfer
if (checkOptions(player, ParkourOption.GAMEMODE, disabledOptions)) {
Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.GAMEMODE.getName());

main.item(19, item.click(event -> GamemodeMenu.open(user)));
}

if (checkOptions(player, ParkourOption.LEADERBOARD, disabledOptions)) {
Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.LEADERBOARD.getName())
.modifyLore(line -> // #%n (%s)
line.replace("%s", "#" + ParkourUser.getRank(user.getUUID()) + " (" +
user.highScore.toString()) + ")");

main.item(20, item.click(event -> {
player.closeInventory();
LeaderboardMenu.open(player);
}));
}

if (checkOptions(player, ParkourOption.LANGUAGE, disabledOptions)) {
Item item = config.getFromItemData(user.getLocale(), "options." + ParkourOption.LANGUAGE.getName())
.modifyLore(line ->
line.replace("%s", user.getLocale()));

main.item(21, item.click(event -> LangMenu.open(user, disabledOptions)));
}

// opens the menu
main
Expand Down
2 changes: 1 addition & 1 deletion witp/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'WITP'
description: 'Infinitely automatically generating parkour plugin.'
author: Efnilite, Ice_Pancake
version: 3.2.3
version: 3.2.4
api-version: 1.16
main: dev.efnilite.ip.IP
softdepend: [Vault, PlaceholderAPI, ProtocolAPI, Multiverse-Core, HolographicDisplays, NoteBlockAPI, WVoidGen, VoidGen]
Expand Down

0 comments on commit 6f2f9c4

Please sign in to comment.