mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
Fixes brush perms check #610
This commit is contained in:
parent
b49a0a35af
commit
0cf77c3cbc
@ -234,10 +234,11 @@ public class BrushSettings {
|
||||
}
|
||||
|
||||
public boolean canUse(Actor actor) {
|
||||
for (String perm : getPermissions()) {
|
||||
Set<String> perms = getPermissions();
|
||||
for (String perm : perms) {
|
||||
if (actor.hasPermission(perm)) return true;
|
||||
}
|
||||
return false;
|
||||
return perms.isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
|
||||
private TargetMode targetMode = TargetMode.TARGET_BLOCK_RANGE;
|
||||
private Mask targetMask = null;
|
||||
|
||||
private transient BrushSettings context = new BrushSettings();
|
||||
private transient BrushSettings primary = context;
|
||||
private transient BrushSettings primary = new BrushSettings();
|
||||
private transient BrushSettings secondary = new BrushSettings();
|
||||
private transient BrushSettings context = primary;
|
||||
|
||||
private transient VisualExtent visualExtent;
|
||||
private transient Lock lock = new ReentrantLock();
|
||||
@ -392,13 +392,11 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
|
||||
setContext(primary);
|
||||
break;
|
||||
case SECONDARY:
|
||||
if (primary == secondary) {
|
||||
return false;
|
||||
}
|
||||
setContext(secondary);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
BrushSettings current = getContext();
|
||||
Brush brush = current.getBrush();
|
||||
if (brush == null) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user