SteamWar/BauSystem2.0
Archiviert
12
0

Add -water as for /trace show in WarShip regions
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-10-03 11:32:20 +02:00
Ursprung 8217e9645b
Commit 1a93f2fc41
2 geänderte Dateien mit 13 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -156,9 +156,17 @@ public class TraceCommand extends SWCommand {
// /trace show raw -auto at 0 // /trace show raw -auto at 0
@Register(value = {"show"}, description = "TRACE_COMMAND_HELP_SHOW") @Register(value = {"show"}, description = "TRACE_COMMAND_HELP_SHOW")
public void showCommand(@Validator Player p, @OptionalValue("entity") ShowModeType showModeType, ShowModeParameterType... showModeParameterTypes) { public void showCommand(@Validator Player p, @OptionalValue("entity") ShowModeType showModeType, ShowModeParameterType... showModeParameterTypes) {
Region region = Region.getRegion(p.getLocation());
ShowModeParameter showModeParameter = new ShowModeParameter(); ShowModeParameter showModeParameter = new ShowModeParameter();
if (region.getWaterLevel() != 0) { // Enable Water by default for regions with WaterLevel e.g. WarShip
showModeParameter.enableWater();
}
for (ShowModeParameterType showModeParameterType : showModeParameterTypes) { for (ShowModeParameterType showModeParameterType : showModeParameterTypes) {
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter); if (showModeParameterType == ShowModeParameterType.WATER && region.getWaterLevel() != 0) {
showModeParameter.disableWater();
} else {
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
}
} }
TraceShowManager.show(p, showModeType.showModeBiFunction.apply(p, showModeParameter)); TraceShowManager.show(p, showModeType.showModeBiFunction.apply(p, showModeParameter));
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", p); BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", p);

Datei anzeigen

@ -38,6 +38,10 @@ public class ShowModeParameter {
public void enableWater() { public void enableWater() {
this.water = true; this.water = true;
} }
public void disableWater() {
this.water = false;
}
public void enableInterpolateY() { public void enableInterpolateY() {
this.interpolateY = true; this.interpolateY = true;