3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00
Dieser Commit ist enthalten in:
MattBDev 2020-02-17 17:19:14 -05:00
Ursprung 98bd93c752
Commit 3e718e2e0b

Datei anzeigen

@ -85,40 +85,6 @@ public final class BrushCache {
brushCache.remove(getKey(item));
CompoundTag display = (CompoundTag) map.get("display");
Map<String, Tag> displayMap;
if (tool != null) {
String json = tool.toString(gson);
map.put("weBrushJson", new StringTag(json));
if (display == null) {
map.put("display", new CompoundTag(displayMap = new HashMap<>()));
} else {
displayMap = ReflectionUtils.getMap(display.getValue());
}
displayMap.put("Lore", FaweCache.IMP.asTag(json.split("\\r?\\n")));
String primary = (String) tool.getPrimary().getSettings().get(BrushSettings.SettingType.BRUSH);
String secondary = (String) tool.getSecondary().getSettings().get(BrushSettings.SettingType.BRUSH);
if (primary == null) primary = secondary;
if (secondary == null) secondary = primary;
if (primary != null) {
String name = primary == secondary ? primary.split(" ")[0] : primary.split(" ")[0] + " / " + secondary.split(" ")[0];
displayMap.put("Name", new StringTag("{\"text\":\"" + name + "\"}"));
}
} else if (map.containsKey("weBrushJson")) {
map.remove("weBrushJson");
if (display != null) {
displayMap = ReflectionUtils.getMap(display.getValue());
displayMap.remove("Lore");
displayMap.remove("Name");
if (displayMap.isEmpty()) {
map.remove("display");
}
}
} else {
return tool;
}
item.setNbtData(nbt);
if (tool != null) {
brushCache.put(getKey(item), tool);
}
return tool;
}
}