mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-03 06:01:28 +01:00
Fix possible NPE if BlockElement is null
This commit is contained in:
parent
8af13df3f9
commit
1f8d2464a0
@ -61,7 +61,7 @@ public synchronized void optimize(ResourcePack resourcePack) {
|
|||||||
|
|
||||||
if (this.elements != null) {
|
if (this.elements != null) {
|
||||||
for (var element : elements) {
|
for (var element : elements) {
|
||||||
element.optimize(resourcePack);
|
if (element != null) element.optimize(resourcePack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,6 +86,7 @@ public synchronized void applyParent(ResourcePack resourcePack) {
|
|||||||
if (this.elements == null && parent.elements != null) {
|
if (this.elements == null && parent.elements != null) {
|
||||||
this.elements = new Element[parent.elements.length];
|
this.elements = new Element[parent.elements.length];
|
||||||
for (int i = 0; i < this.elements.length; i++){
|
for (int i = 0; i < this.elements.length; i++){
|
||||||
|
if (parent.elements[i] == null) continue;
|
||||||
this.elements[i] = parent.elements[i].copy();
|
this.elements[i] = parent.elements[i].copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ private synchronized void applyTextureVariable(String key, TextureVariable value
|
|||||||
public synchronized void calculateProperties(ResourcePack resourcePack) {
|
public synchronized void calculateProperties(ResourcePack resourcePack) {
|
||||||
if (elements == null) return;
|
if (elements == null) return;
|
||||||
for (Element element : elements) {
|
for (Element element : elements) {
|
||||||
if (element.isFullCube()) {
|
if (element != null && element.isFullCube()) {
|
||||||
occluding = true;
|
occluding = true;
|
||||||
|
|
||||||
culling = true;
|
culling = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user