Dieser Commit ist enthalten in:
Ursprung
5b3cfefaaf
Commit
4462c95607
@ -1 +1 @@
|
||||
Subproject commit 211f6258b5bd5a50253a21bd82804edb12f34e3e
|
||||
Subproject commit 1dea71993d897354d3f52a705f6e0e1e0c8ec580
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.command;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
public class CaseInsensitiveCommandsListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||
String[] strings = event.getMessage().split(" ");
|
||||
strings[0] = strings[0].toLowerCase();
|
||||
event.setMessage(String.join(" ", strings));
|
||||
}
|
||||
}
|
@ -102,7 +102,7 @@ public class SWCommand extends AbstractSWCommand<CommandSender> {
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
private void internalHelp(Player p, String... args) {
|
||||
public void internalHelp(Player p, String... args) {
|
||||
if (message == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -20,10 +20,7 @@
|
||||
package de.steamwar.core;
|
||||
|
||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||
import de.steamwar.command.SWCommandUtils;
|
||||
import de.steamwar.command.SWTypeMapperCreator;
|
||||
import de.steamwar.command.TabCompletionCache;
|
||||
import de.steamwar.command.TypeMapper;
|
||||
import de.steamwar.command.*;
|
||||
import de.steamwar.core.authlib.AuthlibInjector;
|
||||
import de.steamwar.core.events.ChattingEvent;
|
||||
import de.steamwar.core.events.PartialChunkFixer;
|
||||
@ -118,6 +115,7 @@ public class Core extends JavaPlugin{
|
||||
}
|
||||
});
|
||||
Bukkit.getScheduler().runTaskTimer(this, TabCompletionCache::invalidateOldEntries, 20, 20);
|
||||
Bukkit.getPluginManager().registerEvents(new CaseInsensitiveCommandsListener(), this);
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new PlayerJoinedEvent(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new ChattingEvent(), this);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren