• Recently Browsing

    No registered users viewing this page.

  • Posts

    • You should maybe take a look on these links:   https://mcforge.readthedocs.io/en/1.15.x/ #Forge Docs https://github.com/TheGreyGhost/MinecraftByExample #Code Examples https://www.youtube.com/playlist?list=PLmaTwVFUUXiBKYYSyrv_uPPoPZtEsCBVJ #Youtube Tutorials   I hope those links help you to gain knowledge about forge.
    • Thank you so much! I thought the installer was only for windows! It works perfectly now!
    • For anyone who is looking for the same as me:   Industrial-Foregoing has a pretty readable code. Take a look here: Industrial-Foregoing, Titanium
    • \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:17: error: variable buffer is already defined in class AudioStreamBuffer private int buffer; ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:42: error: incompatible types: int cannot be converted to ByteBuffer this.buffer = aint[0]; ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:47: error: incompatible types: ByteBuffer cannot be converted to int return OptionalInt.of(this.buffer); ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:52: error: incompatible types: ByteBuffer cannot be converted to int AL10.alDeleteBuffers(new int[]{this.buffer}); These is are the first few messages.   And the Exception is:   Any ideas how to fix that? 
    • Okay, I did some poking around with AtlasTexture, and I think I figured out how to do what I need to. I'm going to record it here for future generations, and as a second post because it just doesn't make sense to me to combine this with the above, since they're mostly unrelated (and the separation will help identify this as me explaining what I think I need to do).   AtlasTexture texture = new AtlasTexture(new ResourceLocation(MODID, "atlas")); Stream<ResourceLocation> stream = list.stream(); //We get a stream of all of the textures we want, probably using Collection#stream() SheetData data = texture.func_229220_a_((IResourceManager) Minecraft.getInstance().getTextureManager(), stream, Minecraft.getInstance().getProfiler(), 0); //Last argument is mipmap level, we use 0 map.upload(data); So, first I must actually create a new AtlasTexture, passing in a ResourceLocation which will act as a registry name. Then, to actually generate the stitched texture, I must call AtlasTexture#func229220_a_. It seems I should pass in Minecraft.getInstance().getTextureManager() (which I can do because I'm specifically doing this on Dist.CLIENT) for the first argument, a Stream containing the ResourceLocation's of all of the textures I want to stitch (so this will be done after all of the nodes are registered, no surprise there), an IProfiler (whatever that is, it seems to be used to track the progress of the texture stitching), and an integer mipmapping level (I would assume I'd use either 0 or 1, since I won't need mipmapping for a GUI I don't think). I would capture the output of this and pass it to AtlasTexture#upload, which would actually create the texture information I would then use for drawing. At this point, the AtlasTexture is ready for use.   if (!RenderSystem.isOnRenderThread()) { RenderSystem.recordRenderCall(() -> { manager.func_229263_a(texture.func_229223_g_(), texture); texture.func_229148_d_(); }); } else { textureManager.func_229263_a(texture.func_229223_g_(), texture); texture.func_229148_d(); } When we first start drawing, we have to bind the texture. First, we must ensure we are actually on the rendering thread, and ask the rendering thread to do it if we aren't. Then we call TextureManager#func_229263_a, which takes two arguments, a ResourceLocation we want to use as a key for our AtlasTexture and the AtlasTexture itself.  We can cheat the first argument here by calling AtlasTexture#func_229223_g_, which is essentially getRegistryName. This will set up our texture so it's ready to be bound to OpenGL (the above is ripped directly from TextureManager#bindTexture). We then call Texture#func229148_d, which actually binds the texture.   ((I would provide a code example, except that Screen doesn't seem to provide any way to draw textures using UV coordinates which is all TextureAtlasSprite provides, and directly drawing via OpenGL requires calling Tessellator to get a BufferBuilder, and none of the methods in BufferBuilder (or, for that matter, Screen) have been deobfuscated yet.))   Now, in order to draw a texture from the Atlas onto the GUI, we call AtlasTexture#getSprite and pass in the key for the particular texture we want. That returns a TextureAtlasSprite, which contains the coordinates of our texture on the Atlas in absolute pixels as well as the relative min/max UV coordinates of our texture. Asking OpenGL to draw the part of the texture from min UV to max UV will draw our chosen texture and only that texture.
  • Topics

  • Who's Online (See full list)