World checks in BrushSettings don't offer any performance benefit

Dieser Commit ist enthalten in:
MattBDev 2020-02-05 10:40:29 -05:00
Ursprung 75653087b9
Commit aa04b0c326
2 geänderte Dateien mit 1 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -51,7 +51,6 @@ public class BrushSettings {
private Expression size = DEFAULT_SIZE; private Expression size = DEFAULT_SIZE;
private Set<String> permissions; private Set<String> permissions;
private Scroll scrollAction; private Scroll scrollAction;
private String lastWorld;
public BrushSettings() { public BrushSettings() {
this.permissions = new HashSet<>(); this.permissions = new HashSet<>();
@ -213,20 +212,6 @@ public class BrushSettings {
return this; return this;
} }
/**
* Set the world the brush is being used in
* @param world
* @return true if the world differs from the last used world
*/
public boolean setWorld(String world) {
boolean result = false;
if (this.lastWorld != null && !this.lastWorld.equalsIgnoreCase(world)) {
result = true;
}
this.lastWorld = world;
return result;
}
public Brush getBrush() { public Brush getBrush() {
return brush; return brush;
} }

Datei anzeigen

@ -491,7 +491,7 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
Brush brush = current.getBrush(); Brush brush = current.getBrush();
if (brush == null) return false; if (brush == null) return false;
if (current.setWorld(player.getWorld().getName()) && !current.canUse(player)) { if (!current.canUse(player)) {
player.print(Caption.of("fawe.error.no-perm" , StringMan.join(current.getPermissions(), ","))); player.print(Caption.of("fawe.error.no-perm" , StringMan.join(current.getPermissions(), ",")));
return false; return false;
} }