
Draconwolver
Members-
Posts
41 -
Joined
-
Last visited
Converted
-
Gender
Male
-
URL
https://syncmc.github.io/
Draconwolver's Achievements

Tree Puncher (2/8)
0
Reputation
-
[1.11.2] [UNSOLVED] Cancel Render of Player's Nametag
Draconwolver replied to Draconwolver's topic in Modder Support
Thanks, that was helpful. When I listen to the RenderLivingEvent.Specials.Pre event, should I suppress the raw type warning, or use something like RenderLivingEvent.Specials.Pre<? extends EntityLivingBase>? -
[1.11.2] [UNSOLVED] Cancel Render of Player's Nametag
Draconwolver replied to Draconwolver's topic in Modder Support
Okay, now I have a couple of (probably simple) questions. Why does cancelling RenderLivingEvent.Specials.Pre<AbstractClientPlayer> prevent all nametags from showing, rather than just players? What role does RenderPlayer::renderEntityName have in rendering player names? It seems to handle scores displayed under the player's name and then call Render::renderEntityName, which is also called by RenderLivingBase::renderName. So when a player's nametag needs to be rendered, which is called, RenderPlayer::renderEntityName or RenderLivingBase::renderName? RenderPlayer::renderEntityName RenderLivingBase::renderName Render::renderEntityName Render::renderLivingLabel -
I'd like to modify how player nametags are rendered, so I've started with the goal of cancelling their render in the first place. I'd like to do this by extending RenderPlayer, but I cannot seem to get it working. I've overridden RenderPlayer::renderEntityName to simply return without doing anything, but player nametags continue to render. Is this the wrong method to override? I don't see any calls to it in the source code, but I also don't see anything about rendering nametags in RenderPlayer::doRender.
-
[1.11.2] [SOLVED] WorldClient Player Type
Draconwolver replied to Draconwolver's topic in Modder Support
Whoops, I should've looked at the type hierarchy... Thank you. -
I know that WorldClient is client-side only, so I'm assuming that all the entities in WorldClient::getLoadedEntityList are client-side only. Does this mean that I can cast player entities in WorldClient::getLoadedEntityList to EntityPlayerSPs, the client-side player type? (EntityPlayer is what I am casting to at the moment, but I am wondering if there is something more specific I can use.)
-
[1.11.2] [SOLVED] Cancel Render of EntityItems
Draconwolver replied to Draconwolver's topic in Modder Support
Just to reiterate my last question, is there a way to toggle this rendering while in-game? -
[1.11.2] [SOLVED] Cancel Render of EntityItems
Draconwolver replied to Draconwolver's topic in Modder Support
Oh, of course! I don't have access to my workspace right now, but I understand. Thanks! EDIT: Alrighty, I got it. Here's my FMLPreInitializationEvent handler: @EventHandler public void preInit(FMLPreInitializationEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntityItem.class, new DiamondRenderFactory()); } And my DiamondRenderFactory class: public class DiamondRenderFactory implements IRenderFactory<EntityItem> { @Override public Render<? super EntityItem> createRenderFor(RenderManager manager) { return new RenderDiamond(manager, Minecraft.getMinecraft().getRenderItem()); } } And finally my RenderDiamond class: public class RenderDiamond extends RenderEntityItem { public RenderDiamond(RenderManager renderManagerIn, RenderItem p_i46167_2_) { super(renderManagerIn, p_i46167_2_); } @Override public void doRender(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks) { if (entity.getEntityItem().getItem() != Items.DIAMOND) { super.doRender(entity, x, y, z, entityYaw, partialTicks); } } } -
[1.11.2] [SOLVED] Cancel Render of EntityItems
Draconwolver replied to Draconwolver's topic in Modder Support
Thanks, I got it working by simply returning in the RenderEntityItem::doRender method that I overrode. However, what if I wanted to only hide specific kinds of EntityItems? If I copy the whole code for the RenderEntityItem::doRender method and paste it in my method override, there are some private fields that I do not have access to. Should I copy those in my class, too? EDIT: I was able to cancel the rendering of only one kind of item (e.g., diamonds) by copying and pasting like I explained above. Continuing with the additional complexity theme, is there a way to make this rendering toggleable through a KeyBinding or whatnot, or is this way of rendering permanent once the game loads? -
[1.11.2] [SOLVED] Cancel Render of EntityItems
Draconwolver replied to Draconwolver's topic in Modder Support
Please excuse me for needing guidance. Here is what I have in my FMLPreInitializationEvent handler: @EventHandler public void preInit(FMLPreInitializationEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntityItem.class, new RenderItemFactory()); } My RenderItemFactory class: public class RenderItemFactory implements IRenderFactory<EntityItem> { @Override public Render<? super EntityItem> createRenderFor(RenderManager manager) { return new RenderEntityItem(manager, new RenderAnItem(/* What arguments do I use? */)); } } My RenderAnItem class: public class RenderAnItem extends RenderItem { public RenderAnItem(TextureManager textureManager, ModelManager modelManager, ItemColors itemColors) { super(textureManager, modelManager, itemColors); /* What goes here? */ } } Have I approached this wrong, or am I on the right track? Thanks. -
[1.11.2] [SOLVED] Cancel Render of EntityItems
Draconwolver replied to Draconwolver's topic in Modder Support
Bump; does anyone know how to cancel EntityItem rendering? -
[1.11.2] [SOLVED] Do Something After Event
Draconwolver replied to Draconwolver's topic in Modder Support
I thought I did, and thank you. I'm surprised I didn't discover this method on my own before posting here... -
[1.11.2] [SOLVED] Do Something After Event
Draconwolver replied to Draconwolver's topic in Modder Support
It's a a ClientChatReceivedEvent (so running client-side) and I'm using EntityPlayerSP#addMessage to print a message to the player when a certain message is received. I want the message I print to be printed after the message from the event shows up in chat, not before. -
[1.11.2] [SOLVED] Do Something After Event
Draconwolver replied to Draconwolver's topic in Modder Support
Yes, it's my actual problem. -
[1.11.2] [SOLVED] Do Something After Event
Draconwolver replied to Draconwolver's topic in Modder Support
By "resolves" I mean "finishes", as in event listeners no longer detect that the event is taking place. I need to do something after an event, as opposed to altering it or doing something before the event finishes. If it's some chat event, for instance, and I log a message to the player in my event listener, that message will be logged before my screen displays the original chat. Given this scenario, I'd like to log the message after I receive the chat. -
To my knowledge, an event resolves immediately after everything is done in its event handler. Is there a way to do something immediately after a specific event is over?