Add -water as for /trace show in WarShip regions
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
8217e9645b
Commit
1a93f2fc41
@ -156,10 +156,18 @@ 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) {
|
||||||
|
if (showModeParameterType == ShowModeParameterType.WATER && region.getWaterLevel() != 0) {
|
||||||
|
showModeParameter.disableWater();
|
||||||
|
} else {
|
||||||
showModeParameterType.getShowModeParameterConsumer().accept(showModeParameter);
|
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);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,10 @@ public class ShowModeParameter {
|
|||||||
this.water = true;
|
this.water = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void disableWater() {
|
||||||
|
this.water = false;
|
||||||
|
}
|
||||||
|
|
||||||
public void enableInterpolateY() {
|
public void enableInterpolateY() {
|
||||||
this.interpolateY = true;
|
this.interpolateY = true;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren