Add partialTicks to RenderNameplateEvent (#7277)
This commit is contained in:
parent
a477671c03
commit
bd5e107628
2 changed files with 14 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
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 (this.func_177070_b(p_225623_1_)) {
|
||||
- this.func_225629_a_(p_225623_1_, p_225623_1_.func_145748_c_(), p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_(), this, p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
+ net.minecraftforge.client.event.RenderNameplateEvent renderNameplateEvent = new net.minecraftforge.client.event.RenderNameplateEvent(p_225623_1_, p_225623_1_.func_145748_c_(), this, p_225623_4_, p_225623_5_, p_225623_6_, p_225623_3_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(renderNameplateEvent);
|
||||
+ if (renderNameplateEvent.getResult() != net.minecraftforge.eventbus.api.Event.Result.DENY && (renderNameplateEvent.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || this.func_177070_b(p_225623_1_))) {
|
||||
+ this.func_225629_a_(p_225623_1_, renderNameplateEvent.getContent(), p_225623_4_, p_225623_5_, p_225623_6_);
|
||||
|
|
|
@ -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;
|
||||
private final float partialTicks;
|
||||
|
||||
public RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue