Skip to content

Commit

Permalink
Fix a few editor bugs and other misc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Aug 3, 2024
1 parent cbc07c0 commit e3e9dd3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void load() {
this.battleArena.arenas.put(arena.getName(), arena);

// Register command
PluginCommand command = this.battleArena.getCommand(arena.getName().toUpperCase(Locale.ROOT));
PluginCommand command = this.battleArena.getCommand(arena.getName().toLowerCase(Locale.ROOT));

ArenaCommandExecutor executor = arena.createCommandExecutor();
ArenaCreateExecutorEvent event = new ArenaCreateExecutorEvent(arena, executor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ private void loadArenaLoaders(Path path) {
Configuration configuration = YamlConfiguration.loadConfiguration(Files.newBufferedReader(arenaPath));
String name = configuration.getString("name");
if (name == null) {
this.info("Arena {} does not have a name!", arenaPath.getFileName());
this.warn("Arena {} does not have a name!", arenaPath.getFileName());
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public void openSingleWizardStage(Player player, Arena arena, WizardStage<E> sta
});

stage.enter(context);

player.setMetadata(EDITOR_META_KEY, new FixedMetadataValue(this.plugin, context));
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.bukkit.entity.Player;

import java.util.List;
import java.util.Locale;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down Expand Up @@ -79,7 +80,7 @@ public void onChatInput(String input) {

List<String> teamNames = context.getArena().getTeams().getAvailableTeams()
.stream()
.map(ArenaTeam::getName)
.map(team -> team.getName().toLowerCase(Locale.ROOT))
.toList();

Component teamsList = Component.join(JoinConfiguration.commas(true), validTeamNames);
Expand All @@ -105,7 +106,7 @@ public void onChatInput(String input) {

@Override
public boolean isValidChatInput(String input) {
return super.isValidChatInput(input) && (!input.startsWith("/") && teamNames.contains(input));
return super.isValidChatInput(input) && (!input.startsWith("/") && teamNames.contains(input.toLowerCase(Locale.ROOT)));
}
}.bind(context);
}
Expand All @@ -116,4 +117,4 @@ public boolean isValidChatInput(String input) {
}
}.bind(context);
}
}
}

0 comments on commit e3e9dd3

Please sign in to comment.