AntiRix
Members-
Posts
69 -
Joined
-
Last visited
Everything posted by AntiRix
-
Hi, I'm trying to create a mod which is able to create both 2D and 3D tiled maps of a minecraft world by rendering the actual blocks. I believe the best approach would be to mod the camera to have orthographic and isometric projection, have it take a screenshot at position 1, then teleport to position 2 and take another screenshot, etc, creating overlapping images which I'll somehow have to stitch together and then divide into tiles. So what I'd like to know is: • Is that the best approach or is there a better way? • How can I alter the camera's projection? I can't seem to find anything relating to perspective in the player object.
-
You're asking a question about Bungeecord on a Forge forum.
-
Ok, so will the purpose of doing that with the lightmap be to make the cubes render properly with shaders?
-
I mean how can I tell if the lightmap changes work or not? I don't know what a lightmap visually does to the scene.
-
Amazingly, disabling shaders solves all of those issues: 1. The boxes render regardless of distance 2. The colour is as specified in the code and doesn't change 3. The boxes always render and don't randomly disappear The intention was indeed to have boxes for the time being, and I'll likely change it to a wireframe later on. So to interpolate the bounding box position, here's what I'm thinking: • The bounding box location is updated every tick • I'm rendering every frame, so it's rendering multiple times per tick, but is still laggy-looking because it's rendering multiple 'old' frames, ie. where it was last tick. So surely there's no way to render the box in the correct position, because I can't predict where it's going to be next tick. Also, I'm not sure what you mean by lightmap issues; what does it look like compared to how it should look? This is the code: @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { if (mc.player != null) ((ModuleSkullFind)main.get_module(EnumModModule.SKULLFIND)).render(event.getPartialTicks()); } public void render(float partial_ticks) { Entity viewing_from = mc.getRenderViewEntity(); double x_fix = viewing_from.lastTickPosX + ((viewing_from.posX - viewing_from.lastTickPosX) * partial_ticks); double y_fix = viewing_from.lastTickPosY + ((viewing_from.posY - viewing_from.lastTickPosY) * partial_ticks); double z_fix = viewing_from.lastTickPosZ + ((viewing_from.posZ - viewing_from.lastTickPosZ) * partial_ticks); GlStateManager.pushMatrix(); GlStateManager.translate(-x_fix, -y_fix, -z_fix); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableTexture2D(); for (EntityPlayer p : mc.world.playerEntities) { AxisAlignedBB pos = p.getRenderBoundingBox(); GlStateManager.color(1F, 1F, 1F, 1F); box(pos); } GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); }
-
And that's what I need help with - I don't understand how the whole translation system works and why, when telling the renderer to render a cube at a certain position, that it refuses to do so. I also find that I have to be close to the players for the boxes to render, and the direction I look in affects whether they render or not. The boxes also change colour so I have no clue what's going on. https://youtu.be/1Uu1VcYNF-w
-
I found that using that, the boxes weren't updated in realtime.
-
Encapsulating, to mean every part of the player's body, whether their arm is swinging, head rotated etc, is inside a tightly-bound box. Every pixel making up that player entity is inside that cube. At least if I can get some sort of box drawn for now, I can work on getting it the right size later.
-
I want to draw the render bounding box, which encapsulates every part of the player. F3+B just displays the hitbox
-
Right-click the project, Build Path -> Configure Build Path. Then click Libraries and Add External JARs to add a dependency.
-
Hi, I'm having an issue drawing player render bounding boxes with my mod. It's drawing them in the top left corner, tiny, and it's causing issues with other UI element rendering @SubscribeEvent public void render(RenderGameOverlayEvent event) { if (event.getType() != ElementType.TEXT) return; if (mc.player != null) render(event.getPartialTicks()); } public void render(float partial_ticks) { Entity viewing_from = mc.getRenderViewEntity(); double x_fix = viewing_from.lastTickPosX + ((viewing_from.posX - viewing_from.lastTickPosX) * partial_ticks); double y_fix = viewing_from.lastTickPosY + ((viewing_from.posY - viewing_from.lastTickPosY) * partial_ticks); double z_fix = viewing_from.lastTickPosZ + ((viewing_from.posZ - viewing_from.lastTickPosZ) * partial_ticks); GlStateManager.pushMatrix(); GlStateManager.translate(-x_fix, -y_fix, -z_fix); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableTexture2D(); for (EntityPlayer p : mc.world.playerEntities) { AxisAlignedBB pos = p.getRenderBoundingBox(); GlStateManager.color(0.5F, 0F, 1F, 0.5F); box(pos); } GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.popMatrix(); } private void box(AxisAlignedBB aabb) { Tessellator tessellator = Tessellator.getInstance(); BufferBuilder worldrenderer = tessellator.getBuffer(); worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); // top worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); // bottom worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); // north worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); // south worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); // west worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); // east worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); tessellator.draw(); }
-
Line 89 in the file MoCEntityTameableAquatic.java is trying to cast an integer to a boolean which it cannot do, probably because the integer is neither 1 nor 0. It's a bug and needs to be fixed by the developer.
-
It depends on the intensity of the mods. You could have 10 mods which are really light which require less RAM than one intensive mod. I'd say allocate 512MB, and increase it if the server's struggling. Allow it a bit of buffer above what it absolutely requires and it'll be fine.
-
Doesn't appear to be the case here. There's some NBT data I can use from the skull to identify it, but I'm having trouble getting that string out. skull.serializeNBT().getCompoundTag("Owner").getCompoundTag("Properties").toString() returns {textures:[...]} However when then calling .getCompoundTag("textures").toString()on the properties tag, it returns {}. There doesn't appear to be a method related to arrays of NBT tags. One example of the nonexistent UUIDs is 7b549249-f265-2edc-a205-1c592c6ddc1b.
-
That yields type 3 which is a player head. The playerprofile's uuid is random and none of them are real accounts according to multiple name lookup tools.
-
I mean it's a skull which has been placed on a server and appears to be doing something magical with it not actually being owned by a real player. I'm trying to get something to identify it by, so I can find all others with the same skin.
-
Hi, I'm trying to collect a list of all skulls with a certain skin. The problem is that the TileEntitySkull#getPlayerProfile() UUID is randomised every time and so is the display name. All it seems I have to go by is by somehow getting the skin itself as an image and comparing it pixel-by-pixel with another. Is there a way to do this?
-
Ah, a silly mistake with how I was storing the block positions to be rendered. BlockPos.getAllInBoxMutable(centre.add(-radius, -radius, -radius), centre.add(radius, radius, radius)).forEach(pos -> { Block block = world.getBlockState(pos).getBlock(); String material = block.getLocalizedName(); if (!material.startsWith("tile.skull")) return; //TileEntitySkull skull = (TileEntitySkull)world.getTileEntity(pos); blocks.add(pos); mc.player.sendMessage(new TextComponentString(pos.toString())); }); Changing the method to getAllInBox fixed it. I have no clue why because the output in chat was the same for both. That means the position in the list was being altered by the time the cube was rendered. After a bit of trial and error, I've also managed to make that other code efficient and it's working nicely now
-
Isn't that already what the code is doing?
-
Hi, I'm trying to draw a cube in the world. It's being rendered, but in the wrong position. When the player moves, so does the cube, even if the translation part of the following code is commented out. There must be an offset I'm missing to get the positioning correct. @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { double x_fix = mc.player.lastTickPosX + (mc.player.posX - mc.player.lastTickPosX) * event.getPartialTicks(); double y_fix = mc.player.lastTickPosY + (mc.player.posY - mc.player.lastTickPosY) * event.getPartialTicks(); double z_fix = mc.player.lastTickPosZ + (mc.player.posZ - mc.player.lastTickPosZ) * event.getPartialTicks(); GL11.glPushMatrix(); GL11.glTranslated(-x_fix, -y_fix, -z_fix); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); for (BlockPos pos : blocks) { int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); box(new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)); //GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); //lines(new AxisAlignedBB(x, z, y, x + 1, z + 1, y + 1)); GL11.glColor4f(1F, 1F, 1F, 1F); } GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); } public void box(AxisAlignedBB aabb) { Tessellator tessellator = Tessellator.getInstance(); BufferBuilder worldrenderer = tessellator.getBuffer(); // top worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); tessellator.draw(); // bottom worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); tessellator.draw(); // north worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); tessellator.draw(); // south worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); tessellator.draw(); // west worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); tessellator.draw(); // east worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); worldrenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); tessellator.draw(); }
-
It's still not working for me. onInputUpdate is being fired and sneak = true, but the sneaking isn't working. @SubscribeEvent public void onChatMessageReceived(ClientChatReceivedEvent event) { String message = event.getMessage().getFormattedText().replaceAll("\u00a7.", ""); if (message.equals("You are AFK. Move around to return from AFK.")) { event.setCanceled(true); if (anti_afk) { sneak = true; } else { mc.player.sendMessage(new TextComponentString("")); mc.player.sendMessage(new TextComponentString("\u00a7c[HypixelAFK] You're AFK!")); mc.player.sendMessage(new TextComponentString("")); } return; } } @SubscribeEvent public void onInputUpdate(InputUpdateEvent event) { if (!sneak) return; event.getMovementInput().sneak = true; sneak = false; }
-
"when the client detects an AFK message in chat" ClientChatReceivedEvent If the message equals something, do either of the two code blocks, neither of which works. I know the code is running, because otherwise I'd fix that before posting here. "On the other hand what you posted isn't what diesieben said to do." That is my updated code. I can't go any further.
-
It's literally what I put in the original post. Neither works.
-
I'm trying to make the player sneak when the client detects an AFK message in chat as an anti-afk mechanism. When the message is detected, the sneaking doesn't work so the player isn't taken out of AFK mode
-
Hi, I've tried several methods to get the player to sneak, including: mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SNEAKING)); and mc.player.setSneaking(true); mc.player.onUpdate(); Neither seem to work. Am I missing something? It's not registering the sneaking on either the client or the server side.