mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Remove stream instantiation when rendering gear
This commit is contained in:
parent
d73c6fb2e3
commit
24ed233210
1 changed files with 18 additions and 19 deletions
|
@ -62,27 +62,26 @@ public class GearFeature<T extends LivingEntity, M extends EntityModel<T> & IPon
|
||||||
|
|
||||||
final Map<BodyPart, Float> renderStackingOffsets = new HashMap<>();
|
final Map<BodyPart, Float> renderStackingOffsets = new HashMap<>();
|
||||||
|
|
||||||
randomisedGearCache.getUnchecked(entity.getUuid())
|
randomisedGearCache.getUnchecked(entity.getUuid()).forEach(entry -> {
|
||||||
.stream()
|
if (getContext().shouldRender(model, entity, entry.wearable, entry.gear)) {
|
||||||
.filter(entry -> getContext().shouldRender(model, entity, entry.wearable, entry.gear))
|
stack.push();
|
||||||
.forEach(entry -> {
|
BodyPart part = entry.gear.getGearLocation();
|
||||||
stack.push();
|
entry.gear.transform(model, stack);
|
||||||
BodyPart part = entry.gear.getGearLocation();
|
|
||||||
entry.gear.transform(model, stack);
|
|
||||||
|
|
||||||
if (entry.gear instanceof IStackable) {
|
if (entry.gear instanceof IStackable) {
|
||||||
renderStackingOffsets.compute(part, (k, v) -> {
|
renderStackingOffsets.compute(part, (k, v) -> {
|
||||||
float offset = ((IStackable)entry.gear).getStackingHeight();
|
float offset = ((IStackable)entry.gear).getStackingHeight();
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
stack.translate(0, -v, 0);
|
stack.translate(0, -v, 0);
|
||||||
offset += v;
|
offset += v;
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
renderGear(model, entity, entry.gear, stack, renderContext, lightUv, limbDistance, limbAngle, tickDelta);
|
||||||
|
stack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderGear(model, entity, entry.gear, stack, renderContext, lightUv, limbDistance, limbAngle, tickDelta);
|
|
||||||
stack.pop();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue