-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from SpaceServerUniverse/dev/in-ammo-menu
feat: 弾薬メニューをメニューから開けるように
- Loading branch information
Showing
7 changed files
with
104 additions
and
29 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
33 changes: 33 additions & 0 deletions
33
src/main/java/space/yurisi/universecorev2/menu/menu_item/main_menu/LaunchNavigationItem.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,33 @@ | ||
package space.yurisi.universecorev2.menu.menu_item.main_menu; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.inventory.ClickType; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
import space.yurisi.universecorev2.menu.MainMenu; | ||
import xyz.xenondevs.invui.item.ItemProvider; | ||
import xyz.xenondevs.invui.item.builder.ItemBuilder; | ||
import xyz.xenondevs.invui.item.impl.AbstractItem; | ||
|
||
import java.util.List; | ||
|
||
public class LaunchNavigationItem extends AbstractItem { | ||
|
||
@Override | ||
public ItemProvider getItemProvider() { | ||
return new ItemBuilder(Material.MAP) | ||
.setDisplayName("関連リンク") | ||
.setLegacyLore(List.of("§6関連リンクを表示します")); | ||
} | ||
|
||
@Override | ||
public void handleClick(@NotNull ClickType clickType, @NotNull Player player, @NotNull InventoryClickEvent inventoryClickEvent) { | ||
Bukkit.getServer().dispatchCommand(player, "web"); | ||
Bukkit.getServer().dispatchCommand(player, "wiki"); | ||
Bukkit.getServer().dispatchCommand(player, "discord"); | ||
// メニューを閉じる | ||
player.closeInventory(); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/space/yurisi/universecorev2/subplugins/universeguns/core/GunCommand.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,32 @@ | ||
package space.yurisi.universecorev2.subplugins.universeguns.core; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import space.yurisi.universecorev2.subplugins.universeguns.connector.UniverseCoreAPIConnector; | ||
import space.yurisi.universecorev2.subplugins.universeguns.menu.AmmoManagerInventoryMenu; | ||
import space.yurisi.universecorev2.utils.Message; | ||
|
||
public class GunCommand implements CommandExecutor { | ||
|
||
private final UniverseCoreAPIConnector connector; | ||
|
||
public GunCommand(UniverseCoreAPIConnector connector) { | ||
this.connector = connector; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) { | ||
if (!(sender instanceof Player player)) { | ||
return false; | ||
} | ||
|
||
AmmoManagerInventoryMenu ammoManagerInventoryMenu = new AmmoManagerInventoryMenu(connector); | ||
ammoManagerInventoryMenu.sendMenu(player); | ||
|
||
Message.sendSuccessMessage(player, "[武器AI]", "弾薬管理メニューを開きました"); | ||
return true; | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
src/main/java/space/yurisi/universecorev2/utils/time_type/TimeType.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package space.yurisi.universecorev2.utils.time_type; | ||
|
||
public enum TimeType { | ||
LATE_NIGHT, | ||
EARLY_MORNING, | ||
MORNING, | ||
AFTERNOON, | ||
EVENING | ||
EVENING, | ||
NIGHT | ||
} |
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