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

Posted

Hi there!

Just wanna ask you some help. I'd like to draw a red point (a small red circle) in the middle of a block face. I've been reading about quads, textures, and all that stuff, but I'm sure there must be an easy and quick way of doing what I want. Is it?

Thanks! :D

  • Author

I have this. Now just trying to render a simple line xD. Anyone can help? Am I in the good way? Help!

Quote

public void render(Minecraft minecraft) {

        if (PyroCapability.PYRO.isRegistered()) {
            MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
            PlayerList players = server.getPlayerList();
            String[] names = server.getPlayerNames();

            RenderSystem.enableDepthTest();
            RenderSystem.setShader(GameRenderer::getPositionColorShader);

            RenderSystem.disableTexture();
            RenderSystem.disableBlend();

            for (String name : names) {
                Player player = players.getPlayerByName(name);
                PyroCapabilityInterface pyro = player.getCapability(PyroCapability.PYRO).orElse(null);
                if (pyro != null) {

                    ArrayList<Objectiu> objectius = pyro.getObjectius();
                    if (objectius != null) {

                        if (!objectius.isEmpty()) {
                            for (Objectiu obj : objectius) {
                                Tesselator tesselator = Tesselator.getInstance();
                                BufferBuilder bufferbuilder = tesselator.getBuilder();

                                BlockPos pos = obj.getPos();
                                RenderSystem.lineWidth(5.0F);
                                
                                double p1x = (double) pos.getX();
                                double p1y = (double) pos.getY();
                                double p1z = (double) pos.getZ();
                                
                                double p2x = (double) p1x;
                                double p2y = (double) p1y+10;
                                double p2z = (double) p1z;


                                bufferbuilder.begin(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION);

                                bufferbuilder.vertex(p1x, p1y, p1z)
                                        .color(1.0f, 1.0f, 0, 0).normal(0,0,0).endVertex();
                                bufferbuilder.vertex(p2x, p2y, p2z)
                                        .color(1.0f, 1.0f, 0, 0).normal(0,0,0).endVertex();

                                tesselator.end();
                                RenderSystem.lineWidth(1.0F);
                                RenderSystem.enableBlend();
                                RenderSystem.enableTexture();

                            }
                        }
                    }
                }
            }
        }
    }

 

Edited by baku

  • Author

OK. Starting from 0 again. It can't be so difficult xD

Edited by baku

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.