Fix minor brush persistence issue

This commit is contained in:
Jesse Boyd 2017-08-31 16:36:19 +10:00
parent 880b054957
commit 1dad7a6cce
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,7 @@ public class BrushBoundBaseBlock extends BaseBlock implements BrushHolder {
try {
this.tool = BrushTool.fromString(player, session, json);
this.tool.setHolder(this);
brushCache.put(getKey(item), tool);
} catch (Throwable ignore) {
ignore.printStackTrace();
}

View File

@ -72,6 +72,7 @@ public class BrushSettings {
String args = constructor.substring(constructor.indexOf(' ') + 1);
String[] parentArgs = new String[]{"brush", split[0]};
BrushSettings bs = (BrushSettings) sphereCommand.call(args, locals, parentArgs);
bs.constructor.put(SettingType.BRUSH, constructor);
if (settings.containsKey(SettingType.PERMISSIONS.name())) {
bs.permissions.addAll((Collection<? extends String>) settings.get(SettingType.PERMISSIONS.name()));
}

View File

@ -297,6 +297,7 @@ public class BrushTool implements DoubleActionTraceTool, ScrollTool, MovableTool
current.clearPerms();
current.setBrush(brush);
current.addPermission(permission);
update();
}
/**