Posted March 9, 20223 yr 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!
March 9, 20223 yr 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 March 9, 20223 yr by baku
March 9, 20223 yr Author OK. Starting from 0 again. It can't be so difficult Edited March 10, 20223 yr 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.