Skip to content

Commit

Permalink
Fix media tabcomplete for region commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Feb 21, 2024
1 parent 22cd933 commit 88527e0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions modules/vistas-server/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/bash/data.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_NUM="1386"
BUILD_NUM="1390"
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public BungeeRegionCommand() {
registerArguments(
new Argument("create <WG-region> <source> [volume]",
"Assigns a sound to a WorldGuard region by name, with optional volume")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("temp <WG-region> <source> <duration>",
"Create a temporary region with it's own synced sound")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("delete <WG-region>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.craftmend.openaudiomc.generic.user.User;

@FunctionalInterface
public interface TabCompleteProvider {

String[] getOptions(User sender);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ public RegionsSubCommand(OpenAudioMcSpigot openAudioMcSpigot) {
registerArguments(
new Argument("create <WG-region> <source> [volume]",
"Assigns a sound to a WorldGuard region by name, with optional volume")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("temp <WG-region> <source> <duration>",
"Create a temporary region with it's own synced sound")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("delete <WG-region>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.craftmend.openaudiomc.OpenAudioMc;
import com.craftmend.openaudiomc.generic.commands.interfaces.SubCommand;
import com.craftmend.openaudiomc.generic.commands.objects.Argument;
import com.craftmend.openaudiomc.generic.media.tabcomplete.MediaTabcompleteProvider;
import com.craftmend.openaudiomc.generic.node.enums.ProxiedCommand;
import com.craftmend.openaudiomc.generic.node.packets.CommandProxyPacket;
import com.craftmend.openaudiomc.generic.proxy.interfaces.UserHooks;
Expand All @@ -17,10 +18,14 @@ public VelocityRegionCommand() {
super("region");
registerArguments(
new Argument("create <WG-region> <source> [volume]",
"Assigns a sound to a WorldGuard region by name, with optional volume"),
"Assigns a sound to a WorldGuard region by name, with optional volume")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("temp <WG-region> <source> <duration>",
"Create a temporary region with it's own synced sound"),
"Create a temporary region with it's own synced sound")
.addTabCompleteProvider(1, (sender) -> new String[]{"<region-name>"})
.addTabCompleteProvider(2, MediaTabcompleteProvider.getInstance()),

new Argument("delete <WG-region>",
"Unlink the sound from a WorldGuard specific region by name"),
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/resources/data.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_NUM="1386"
BUILD_NUM="1390"
4 changes: 2 additions & 2 deletions plugin/src/main/resources/openaudiomc-build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BUILD_VERSION="1386"
BUILD_COMMIT="732bfd16a7a25b5a99d36d69d7a3962ed37e1a9c"
BUILD_VERSION="1390"
BUILD_COMMIT="22cd93317b49657bbf4ab646dd63cd09b973ce9e"
BUILD_AUTHOR="Mats"

0 comments on commit 88527e0

Please sign in to comment.