Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/16/20 in all areas

  1. You can check ForgeInGameGui/InGameGui, there are a lot of similar rendering going on there.
    2 points
  2. Armor with custom armor models are an absolute pain to correctly implement with no understanding. So, to counteract that, I have decided to write a detailed account of how to create your armor and your model correctly. Please note: I will not go over the specifics of any particular modeling software or anything that should already be known about items. I expect that you have made at least one item before and know how to register it. Here is the link if you would like to take a read. Please let me know if there is anything I need to correct or update. This thread is old and outdated, please do not refer to this anymore.
    1 point
  3. 1 point
  4. Look at how vanilla makes models, or use a model creator like Blockbench. Remember that your model won't render if you don't override createSpawnPacket and return NetworksHooks.getEntitySpawningPacket(this).
    1 point
  5. It appears that this requires both `RenderSystem.disableDepthTest()` and `RenderSystem.depthMask(false)`.
    1 point
  6. You should, but just in case you need some vanilla assets, you can use a ResourceLocation with "minecraft" as the first parameter, than the path of the asset.
    1 point
  7. Here You are: https://youtu.be/gZ-8F94UT7k he uses BufferBuilder for rendering TE, but same can be done anywhere, you only need to accuire a correct BufferBuilder. Of course, it's not complete guide, and someone may propose better one, would be gracefull, too.
    1 point
  8. I think, this is rendered as gui. So probably you need to subscribe on RenderGameOverlayEvent, but instead use Pre subclass, if you need to be behind the actual gui (not sure). Here is my code example: @SubscribeEvent public static void drawManaBar(RenderGameOverlayEvent.Post event) { if (event.getType().equals(ElementType.HEALTH)) { if (minecraft == null) { minecraft = Minecraft.getInstance(); } if (!Minecraft.isGuiEnabled()) { return; } if (minecraft.world == null) { return; } minecraft.getTextureManager().bindTexture(TestMod.MANA_BAR); RenderSystem.pushTextureAttributes(); RenderSystem.enableAlphaTest(); //I experimented with these a lot, not sure it works now as intended. fullPartial = getCurrentMana()/getMaxMana(); //Not sure this works well, but it's the main idea. bufferbuilder = Tessellator.getInstance().getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); //Here is actual render code: //Rendering empty part bufferbuilder.pos(80f, 20f, 0).tex(0f, 0f).endVertex(); bufferbuilder.pos(120f, 20f, 0).tex(0.5f, 0f).endVertex(); bufferbuilder.pos(120f, 20f + (1-fullPartial) * 80f, 0).tex(0.5f, 1-fullPartial).endVertex(); bufferbuilder.pos(80f, 20f + (1-fullPartial) * 80f, 0).tex(0f, 1-fullPartial).endVertex(); //Rendering full part bufferbuilder.pos(80f, 20f + (1-fullPartial) * 80f, 0).tex(0.5f, 1-fullPartial).endVertex(); bufferbuilder.pos(120f, 20f + (1-fullPartial) * 80f, 0).tex(1f, 1-fullPartial).endVertex(); bufferbuilder.pos(120f, 100f, 0).tex(1f, 1).endVertex(); bufferbuilder.pos(80f, 100f, 0).tex(0.5f, 1).endVertex(); bufferbuilder.finishDrawing(); WorldVertexBufferUploader.draw(bufferbuilder); RenderSystem.disableAlphaTest(); RenderSystem.popAttributes(); minecraft.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); //I'm using .Post event, but anyway gui breaks, if you won's do that. } } Also you may look at other ElementType instances and find HELMET one there. I suspect, that's what you need. You won't find any mention about rendering at pumpkin Block/Item instance, because, I believe, render is made through subscribing to event, so actual render code can be anywhere.
    1 point
  9. Please read the Logs section of my signature below and provide the appropriate log in the appropriate manner.
    1 point
  10. It's a pretty complicated system to set up a custom village, but definitely do-able. The current Minecraft villages are created using a "Jigsaw" system. In order to do anything with custom villages, you need to understand how these function. This video is a really good explanation of the system, make sure to watch the whole thing. It's from 1.14, but for the most part the Jigsaw system hasn't changed much since then. The 1.15.2 mod "The Farlanders", which creates custom villages, has all of their code available on Github, so if you were to use that code as well as vanilla village files as reference, then you'd be in a pretty good spot. Not much more documentation exists out there regarding doing something like this, so past everything I've given you, there isn't much else available that can guide you in the process.
    1 point
  11. No, You should NEVER be using these annotations. Not even for your rendering code. Not even if the overridden method has it. NEVER. If you run into sided issues, bypass it using proper side checks. If you never call the client side code, on the dedicated server, it doesn't matter if the classes are in your jar. If some other mod/code reflectively access your class in the one specific case where you have a method with a sided class in your signature. Then there can be issues. However those issues are on the side of whomever is reflecting into you unnecessarily.
    1 point
  12. shit minemaarten is right, forgot about that part (and also about how stupid vanilla code is )
    0 points
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.