• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I just have this left to do to fix Client-Side Only issues i think. I've directly created the KeyBinding object inside the register method in the client event, also removing the static init I had, but now I cannot access the key from outside to check for example, if that key is being pressed.     Is there a way to check that key status? or a better way to register the key without violating the Client-Side Only code thing, and being able to access it by other methods?
    • So i've managed to get it working (partially). I've attached an image of it. Essentially it kinda works. It renders properly but say if another render event happens during when I place the markers down, this line gets broken. It also produces a random pattern when logging back in and out. This is acctually kinda cool and i'm guessing is because the render world last event is essentially pretty much random.   static void drawTileToTile(TileEntity tileStart, TileEntity tileEnd, ClientPlayerEntity player, MatrixStack matrixStack){ IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); IVertexBuilder lineBuilder = buffer.getBuffer(CustomRenderTypes.THICK_LINES); BlockPos tileStartPos = tileStart.getPos(); BlockPos tileEndPos = tileEnd.getPos(); float[] lineColour = getLineColour(tileStart.getBlockState().getBlock()); drawLine(lineBuilder, generateProjectedMatrix(matrixStack),tileStartPos.getX() + 0.5f,tileStartPos.getY() + 0.6f,tileStartPos.getZ() + 0.5f, tileEndPos.getX() + 0.5f, tileEndPos.getY() + 0.5f, tileEndPos.getZ() + 0.5f, lineColour); matrixStack.pop(); buffer.finish(CustomRenderTypes.THICK_LINES); } Modified code for drawing between tiles. I included
    • So basically, I'm trying to install Forge. Well, I used google chrome first, and it did download, however when I tried to open it (There was the little box at the bottom of the screen that shows my installs/downloads, and I clicked on it to open it), It basically just downloaded again. Everytime I try to open it, it downloads a duplicate. I then tried Internet Explorer, and it just brought me back to google chrome and did that again. I then went to my files and tried to  open it from there, but it brought me back, yet again, to Google chrome and downloaded a copy. What's happening? 
    • Hello, how can I write VoxelShape inside TileEntity-CompoundNBT tag? Or if its not possible or not-effective, how do I fire event when Client player connects to the server?
    • I'm wondering how I can render fixed lines between tile entities in a simular way to buildcraft markers or immersive engineering wires. The actual rendering and render types i've figured out and I have it rendering from a single tile to a player mostly using mcjtys tutorial https://wiki.mcjty.eu/modding/index.php?title=Tut15_Ep15 for tile entity rendering. the issue is that I essentially have a kind of linked list of a bunch of points that are all linked together using real world positions but to draw this on the clientside relative to the player seems incredibly difficult since the only event I can think of is the client tick events and then I don't know how I would grab the matrix stack equivalent positions relative to the player from the actual positions within the world. I'm not sure if thats even possible.   The vast majority of the code is essentially very simular to mcjtys tutorial code with a few very minor edits so for a better reference: https://wiki.mcjty.eu/modding/index.php?title=Tut15_Ep15 for tile entity rendering. Tile > player method (currently works) static void drawTileToPlayer(TileEntity tile, ClientPlayerEntity player, MatrixStack matrixStack){ IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); IVertexBuilder lineBuilder = buffer.getBuffer(CustomRenderTypes.THICK_LINES); BlockPos playerPos = player.getPosition(); BlockPos tilePos = tile.getPos(); int px = playerPos.getX(); int py = playerPos.getY(); int pz = playerPos.getZ(); float[] lineColour = getLineColour(tile.getBlockState().getBlock()); drawLine(lineBuilder, generateProjectedMatrix(matrixStack),tilePos.getX() + 0.5f,tilePos.getY() + 0.6f,tilePos.getZ() + 0.5f, px + 0.5f, py + 0.5f, pz + 0.5f, lineColour); matrixStack.pop(); buffer.finish(CustomRenderTypes.THICK_LINES); } This draws a line from the tile to the player position using a matrix stack from the renderworldlastevent event. Generate projected matrix private static Matrix4f generateProjectedMatrix(MatrixStack matrixStack){ // Begin pushing to the matrix stack. matrixStack.push(); // Get actual position of player and translate back to the actual location. E.g. blockpos is discrete integers. projected view isn't. Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo().getProjectedView(); matrixStack.translate(-projectedView.x, -projectedView.y, -projectedView.z); return matrixStack.getLast().getMatrix(); }   Drawline method private static void drawLine(IVertexBuilder builder, Matrix4f posMatrix, float x1, float y1, float z1, float x2, float y2, float z2, float[] colour){ builder.pos(posMatrix, x1, y1, z1) .color(colour[0], colour[1], colour[2], colour[3]) .endVertex(); builder.pos(posMatrix, x2, y2, z2) .color(colour[0], colour[1], colour[2], colour[3]) .endVertex(); } I did think of using blocks simular to string that would generate between the marker points as they are placed but unlike buildcraft i'm fixing where you can place the markers in the X & Z planes but not in the Y plane so that wont work.  
  • Topics

  • Who's Online (See full list)