QOL #203
@ -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);
|
||||||
|
@ -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