Update TraceCommand to new CommandFramework stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
b8e2dd2250
Commit
8d63bea4a3
@ -38,7 +38,6 @@ import de.steamwar.command.SWCommand;
|
|||||||
import de.steamwar.command.SWCommandUtils;
|
import de.steamwar.command.SWCommandUtils;
|
||||||
import de.steamwar.command.TypeMapper;
|
import de.steamwar.command.TypeMapper;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.NonNull;
|
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
@ -298,33 +297,16 @@ public class TraceCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register({"show"})
|
@Register({"show"})
|
||||||
public void showCommand(Player p) {
|
public void showCommand(Player p, @OptionalValue("entity") ShowModeType showModeType, ShowModeParameterType... showModeParameterTypes) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
TraceShowManager.show(p, new TraceEntityShowMode(p, new ShowModeParameter()));
|
ShowModeParameter showModeParameter = new ShowModeParameter();
|
||||||
|
for (ShowModeParameterType showModeParameterType : showModeParameterTypes) {
|
||||||
|
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
|
||||||
|
}
|
||||||
|
TraceShowManager.show(p, showModeType.showModeBiFunction.apply(p, showModeParameter));
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", p);
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"show"})
|
|
||||||
@Register({"show", "entity"})
|
|
||||||
public void showEntityCommand(Player p, ShowModeParameterType... showModeParameterTypes) {
|
|
||||||
internalShow(p, ShowModeType.ENTITY, showModeParameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register({"show", "block"})
|
|
||||||
public void showBlockCommand(Player p, ShowModeParameterType... showModeParameterTypes) {
|
|
||||||
internalShow(p, ShowModeType.BLOCK, showModeParameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register({"show", "particle"})
|
|
||||||
public void showParticleCommand(Player p, ShowModeParameterType... showModeParameterTypes) {
|
|
||||||
internalShow(p, ShowModeType.PARTICLE, showModeParameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register({"show", "raw"})
|
|
||||||
public void rawShowEntityCommand(Player p, ShowModeParameterType... showModeParameterTypes) {
|
|
||||||
internalShow(p, ShowModeType.RAW, showModeParameterTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
private enum ShowModeType {
|
private enum ShowModeType {
|
||||||
ENTITY(TraceEntityShowMode::new),
|
ENTITY(TraceEntityShowMode::new),
|
||||||
@ -335,16 +317,6 @@ public class TraceCommand extends SWCommand {
|
|||||||
private BiFunction<Player, ShowModeParameter, ShowMode<TNTPosition>> showModeBiFunction;
|
private BiFunction<Player, ShowModeParameter, ShowMode<TNTPosition>> showModeBiFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void internalShow(Player p, @NonNull ShowModeType showModeType, ShowModeParameterType... showModeParameterTypes) {
|
|
||||||
if (!permissionCheck(p)) return;
|
|
||||||
ShowModeParameter showModeParameter = new ShowModeParameter();
|
|
||||||
for (ShowModeParameterType showModeParameterType : showModeParameterTypes) {
|
|
||||||
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
|
|
||||||
}
|
|
||||||
TraceShowManager.show(p, showModeType.showModeBiFunction.apply(p, showModeParameter));
|
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", p);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register({"show", "gui"})
|
@Register({"show", "gui"})
|
||||||
public void showGuiCommand(Player p) {
|
public void showGuiCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren