Fix persistent brushes

This commit is contained in:
Jesse Boyd
2018-08-24 07:18:14 +10:00
parent dbd31ea347
commit c3db5c0cf1
10 changed files with 34 additions and 15 deletions

View File

@ -957,7 +957,7 @@ public class LocalSession implements TextureHolder {
}
public Tool getTool(BaseItem item, Player player) {
if (item.getNativeItem() != null && Settings.IMP.EXPERIMENTAL.PERSISTENT_BRUSHES) {
if (Settings.IMP.EXPERIMENTAL.PERSISTENT_BRUSHES && item.getNativeItem() != null) {
BrushTool tool = BrushCache.getTool(player, this, item);
if (tool != null) return tool;
}
@ -1034,7 +1034,7 @@ public class LocalSession implements TextureHolder {
throw new InvalidToolBindException(type, "Already used for the navigation wand");
}
Tool previous;
if (player != null && (tool instanceof BrushTool || tool == null) && item.getNativeItem() != null && Settings.IMP.EXPERIMENTAL.PERSISTENT_BRUSHES) {
if (player != null && (tool instanceof BrushTool || tool == null) && Settings.IMP.EXPERIMENTAL.PERSISTENT_BRUSHES && item.getNativeItem() != null) {
previous = BrushCache.getCachedTool(item);
if (tool != null) {
BrushCache.setTool(item, (BrushTool) tool);