Fix material key in doc mat loader
This commit is contained in:
parent
829109ee2d
commit
4e45a194e2
@ -19,7 +19,7 @@ public class DocumentMaterialHandler extends AbstractElementHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ElementHandler openElement(String element, HashMap<String, String> attributes, WarningSet warnings) throws SAXException {
|
public ElementHandler openElement(String element, HashMap<String, String> attributes, WarningSet warnings) throws SAXException {
|
||||||
if (element.equals("mat")) {
|
if (element.equals("material")) {
|
||||||
return PlainTextHandler.INSTANCE;
|
return PlainTextHandler.INSTANCE;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -27,10 +27,10 @@ public class DocumentMaterialHandler extends AbstractElementHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeElement(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
|
public void closeElement(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
|
||||||
if ("mat".equals(element)) {
|
if ("material".equals(element)) {
|
||||||
Material mat = Material.fromStorableString(content, true);
|
Material mat = Material.fromStorableString(content, true);
|
||||||
mat.setDocumentMaterial(true);
|
mat.setDocumentMaterial(true);
|
||||||
document.getDocumentPreferences().getDatabase(mat.getType()).add(mat);
|
document.getDocumentPreferences().addMaterial(mat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user