
Share to
Potential Concurrent crashes
Tamaized opened this issue ยท 0 comments
Voidscape/src/main/java/tamaized/voidscape/client/ModelBakeListener.java
Lines 122 to 159 in 4ce6667
overlayList.forEach(mrl -> { | |
final BakedModel model = event.getModelRegistry().get(mrl); | |
if (model != null) | |
event.getModelRegistry().put(mrl, new FullBrightModel(model) { | |
@Nonnull | |
@Override | |
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand) { | |
return cachedQuads.computeIfAbsent(side, (face) -> { | |
List<BakedQuad> quads = model.getQuads(state, side, rand); | |
for (BakedQuad quad : quads) | |
if (quads.indexOf(quad) == 1) | |
LightUtil.setLightData(quad, 0xF000F0); | |
return quads; | |
}); | |
} | |
}); | |
else | |
Voidscape.LOGGER.error("Null Model! " + mrl); | |
}); | |
itemOverlayList.forEach(mrl -> { | |
final BakedModel model = event.getModelRegistry().get(mrl); | |
if (model != null) | |
event.getModelRegistry().put(mrl, new FullBrightModel(model) { | |
@Nonnull | |
@Override | |
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand) { | |
return cachedQuads.computeIfAbsent(side, (face) -> { | |
List<BakedQuad> quads = model.getQuads(state, side, rand); | |
for (BakedQuad quad : quads) | |
if (quad.getSprite().getName().getPath().contains("_overlay")) | |
LightUtil.setLightData(quad, 0xF000F0); | |
return quads; | |
}); | |
} | |
}); | |
else | |
Voidscape.LOGGER.error("Null Model! " + mrl); | |
}); |