mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Add a method to render a spell using the dispatcher
This commit is contained in:
parent
3827deb235
commit
e09ade57b1
2 changed files with 9 additions and 8 deletions
|
@ -72,10 +72,7 @@ public class PlacedSpellRenderer implements SpellRenderer<PlaceableSpell> {
|
||||||
|
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
|
|
||||||
var renderer = SpellEffectsRenderDispatcher.INSTANCE.getRenderer(delegate);
|
SpellEffectsRenderDispatcher.INSTANCE.render(matrices, vertices, delegate, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
|
||||||
if (renderer != null) {
|
|
||||||
renderer.render(matrices, vertices, spell, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,12 +64,16 @@ public class SpellEffectsRenderDispatcher implements SynchronousResourceReloader
|
||||||
return (SpellRenderer<S>)renderers.get(spell.getType());
|
return (SpellRenderer<S>)renderers.get(spell.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void render(MatrixStack matrices, VertexConsumerProvider vertices, Spell spell, Caster<?> caster, int light, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||||
|
var renderer = getRenderer(spell);
|
||||||
|
if (renderer != null) {
|
||||||
|
renderer.render(matrices, vertices, spell, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void render(MatrixStack matrices, VertexConsumerProvider vertices, int light, Caster<?> caster, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
public void render(MatrixStack matrices, VertexConsumerProvider vertices, int light, Caster<?> caster, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||||
caster.getSpellSlot().forEach(spell -> {
|
caster.getSpellSlot().forEach(spell -> {
|
||||||
var renderer = getRenderer(spell);
|
render(matrices, vertices, spell, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
|
||||||
if (renderer != null) {
|
|
||||||
renderer.render(matrices, vertices, spell, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch);
|
|
||||||
}
|
|
||||||
return Operation.SKIP;
|
return Operation.SKIP;
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue