Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Author
35 minutes ago, diesieben07 said:

Why are you calling this method? What is your goal?

I am trying to make my mod support Armourers-Workshop's  skin (.armourer).

package moe.plushie.armourers_workshop.client.render;

import java.util.concurrent.atomic.AtomicInteger;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.renderer.GLAllocation;

public class DisplayList {
    
    private static AtomicInteger LIST_COUNT = new AtomicInteger(0);
    private int list; 
    private boolean compiled = false;
    
    public static int getListCount() {
        return LIST_COUNT.get();
    }
    
    public void begin() {
        if (compiled) {
            cleanup();
        }
        list = GLAllocation.generateDisplayLists(1);//TODO ?
        LIST_COUNT.incrementAndGet();
        GL11.glNewList(list, GL11.GL_COMPILE);
    }
    
    public boolean isCompiled() {
        return compiled;
    }
    
    public void end() {
        GL11.glEndList();
        compiled = true;
    }
    
    public void render() {
        if (compiled) {
            GL11.glCallList(list);
        }
    }
    
    public void cleanup() {
        GLAllocation.deleteDisplayLists(list);//TODO ?
        LIST_COUNT.decrementAndGet();
        compiled = false;
    }
    
    @Override
    protected void finalize() throws Throwable {
        if (compiled) {
            cleanup();
        }
        super.finalize();
    }
}

 

Edited by byxiaobai_

  • Author
4 minutes ago, diesieben07 said:

Display lists are old and obsolete OpenGL technology, which Minecraft no longer uses in 1.16. As such its GLAllocation class is gone. You should move on to modern rendering techniques as well. If you do not want to (which will probably make your things incompatible with much of Minecraft's rendering, especially on 1.17, but I don't know much about that), use the native methods from LWJGL.

Is there any tutorial on modern rendering techniques?

  • Author

 

9 hours ago, diesieben07 said:

It probably does not exist anymore in that form. Much of the rendering was rewritten between 1.12 and 1.16.

It's so difficult for me.😁

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.