Add partialTicks to RenderNameplateEvent (#7277)

This commit is contained in:
Tschipp authored and GitHub committed 2020-09-08 13:24:02 -07:00
1 parent a477671c03
commit bd5e107628
2 files changed
+14 -3

No files matched your search

@@ -41,6 +41,7 @@ import net.minecraftforge.eventbus.api.Event;
* {@link #renderTypeBuffer} contains the render type buffer instance involved in rendering the name plate/tag.
* This cannot be changed by mods.<br>
* {@link #packedLight} contains the sky and block light values used in rendering the name plate/tag.<br>
* {@link #partialTicks} contains the partial ticks used in rendering the name plate/tag. This cannot be changed by mods.<br>
* <br>
* This event has a result. {@link HasResult}. <br>
* ALLOW will force-render name plate/tag, DEFAULT will ignore the hook and continue using the vanilla check
@@ -58,8 +59,9 @@ public class RenderNameplateEvent extends EntityEvent
private final MatrixStack matrixStack;
private final IRenderTypeBuffer renderTypeBuffer;
private final int packedLight;
public RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight)
private final float partialTicks;
public RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight, float partialTicks)
{
super(entity);
this.originalContent = content;
@@ -68,6 +70,7 @@ public class RenderNameplateEvent extends EntityEvent
this.matrixStack = matrixStack;
this.renderTypeBuffer = renderTypeBuffer;
this.packedLight = packedLight;
this.partialTicks = partialTicks;
}
/**
@@ -125,4 +128,12 @@ public class RenderNameplateEvent extends EntityEvent
{
return this.packedLight;
}
/**
* The partial ticks used during the rendering of the name plate/tag
*/
public float getPartialTicks()
{
return this.partialTicks;
}
}