-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
172 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...fnilite/ip/events/BlockGenerateEvent.java → ...ite/ip/api/events/BlockGenerateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../java/dev/efnilite/ip/events/Handler.java → ...a/dev/efnilite/ip/api/events/Handler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...v/efnilite/ip/events/PlayerFallEvent.java → ...nilite/ip/api/events/PlayerFallEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../efnilite/ip/events/PlayerScoreEvent.java → ...ilite/ip/api/events/PlayerScoreEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...dev/efnilite/ip/menu/LeaderboardMenu.java → ...te/ip/menu/community/LeaderboardMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
witp/src/main/java/dev/efnilite/ip/menu/play/PlayMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package dev.efnilite.ip.menu.play; | ||
|
||
import dev.efnilite.ip.IP; | ||
import dev.efnilite.ip.ParkourOption; | ||
import dev.efnilite.ip.menu.DynamicMenu; | ||
import dev.efnilite.vilib.inventory.Menu; | ||
import dev.efnilite.vilib.inventory.animation.SplitMiddleOutAnimation; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
|
||
/** | ||
* Class for the main menu, accessed on executing /parkour | ||
*/ | ||
public class PlayMenu extends DynamicMenu { | ||
|
||
public static final PlayMenu INSTANCE = new PlayMenu(); | ||
|
||
public PlayMenu() { | ||
// Singleplayer if player is not found | ||
registerMainItem(1, 0, | ||
user -> IP.getConfiguration().getFromItemData(user, "main.singleplayer").click( | ||
event -> SingleplayerMenu.open(event.getPlayer())), | ||
ParkourOption.JOIN::check); | ||
|
||
registerMainItem(1, 2, | ||
user -> IP.getConfiguration().getFromItemData(user, "main.spectator").click( | ||
event -> SpectatorMenu.open(event.getPlayer())), | ||
// display spectator if the player isn't already one | ||
ParkourOption.JOIN::check); | ||
|
||
// Always allow closing of the menu | ||
registerMainItem(3, 10, | ||
user -> IP.getConfiguration().getFromItemData(user, "general.close") | ||
.click(event -> event.getPlayer().closeInventory()), | ||
player -> true); | ||
} | ||
|
||
/** | ||
* Opens the main menu. | ||
* | ||
* @param player | ||
* The player to open the menu to | ||
*/ | ||
public void open(Player player) { | ||
Menu menu = new Menu(4, "<white>Play") | ||
.fillBackground(Material.GRAY_STAINED_GLASS_PANE) | ||
.animation(new SplitMiddleOutAnimation()) | ||
.distributeRowEvenly(0, 1, 2, 3); | ||
|
||
display(player, menu); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...ev/efnilite/ip/menu/SingleplayerMenu.java → ...nilite/ip/menu/play/SingleplayerMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...a/dev/efnilite/ip/menu/SpectatorMenu.java → .../efnilite/ip/menu/play/SpectatorMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.