mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
* Delete RenderHandEvent as RenderSpecificHandEvent can do everything it does and more. Rename RenderSpecificHandEvent to RenderHandEvent as it's now the only hand rendering event. * Pass MatrixStack and IRenderTypeBuffer into the event whenever they are available. If they're available, that means we're in a batching environment and the modder should not be using the tessellator or other buffers on their own, or they risk "Already building" crashes.
40 lines
2.5 KiB
Diff
40 lines
2.5 KiB
Diff
--- a/net/minecraft/client/renderer/entity/LivingRenderer.java
|
|
+++ b/net/minecraft/client/renderer/entity/LivingRenderer.java
|
|
@@ -48,14 +48,17 @@
|
|
}
|
|
|
|
public void func_225623_a_(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) {
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_))) return;
|
|
p_225623_4_.func_227860_a_();
|
|
this.field_77045_g.field_217112_c = this.func_77040_d(p_225623_1_, p_225623_3_);
|
|
- this.field_77045_g.field_217113_d = p_225623_1_.func_184218_aH();
|
|
+
|
|
+ boolean shouldSit = p_225623_1_.func_184218_aH() && (p_225623_1_.func_184187_bx() != null && p_225623_1_.func_184187_bx().shouldRiderSit());
|
|
+ this.field_77045_g.field_217113_d = shouldSit;
|
|
this.field_77045_g.field_217114_e = p_225623_1_.func_70631_g_();
|
|
float f = MathHelper.func_219805_h(p_225623_3_, p_225623_1_.field_70760_ar, p_225623_1_.field_70761_aq);
|
|
float f1 = MathHelper.func_219805_h(p_225623_3_, p_225623_1_.field_70758_at, p_225623_1_.field_70759_as);
|
|
float f2 = f1 - f;
|
|
- if (p_225623_1_.func_184218_aH() && p_225623_1_.func_184187_bx() instanceof LivingEntity) {
|
|
+ if (shouldSit && p_225623_1_.func_184187_bx() instanceof LivingEntity) {
|
|
LivingEntity livingentity = (LivingEntity)p_225623_1_.func_184187_bx();
|
|
f = MathHelper.func_219805_h(p_225623_3_, livingentity.field_70760_ar, livingentity.field_70761_aq);
|
|
f2 = f1 - f;
|
|
@@ -92,7 +95,7 @@
|
|
p_225623_4_.func_227861_a_(0.0D, (double)-1.501F, 0.0D);
|
|
float f8 = 0.0F;
|
|
float f5 = 0.0F;
|
|
- if (!p_225623_1_.func_184218_aH() && p_225623_1_.func_70089_S()) {
|
|
+ if (!shouldSit && p_225623_1_.func_70089_S()) {
|
|
f8 = MathHelper.func_219799_g(p_225623_3_, p_225623_1_.field_184618_aE, p_225623_1_.field_70721_aZ);
|
|
f5 = p_225623_1_.field_184619_aG - p_225623_1_.field_70721_aZ * (1.0F - p_225623_3_);
|
|
if (p_225623_1_.func_70631_g_()) {
|
|
@@ -123,6 +126,7 @@
|
|
|
|
p_225623_4_.func_227865_b_();
|
|
super.func_225623_a_(p_225623_1_, p_225623_2_, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post<T, M>(p_225623_1_, this, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_));
|
|
}
|
|
|
|
@Nullable
|