Jump to content

Xcisso

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Xcisso

  1. Hello! I am trying to render a 3d object 50 units in front of the player. I have created my custom renderer that is running from the RenderWorldLast event. The rendering and everything else is working as intended, except for the positioning. When the player looks completely up in the sky, or completely down on the ground, the cube is centered infront of the player. But when i look forward, the position of the cube gets off-set. I am getting the forward direction of the player camera, and multiply that with 50 to get a position that is 50 units in front of the player. So in theory, it should always be perfectly in front of the camera. As you can see in the screenshots, it works perfectly when looking up and down. Does anyone know whats going on here? It seems like the camera forward direction is not the centre of the screen all the time?
  2. oh, im sorry! I read your answer on my mobile, and didnt see you mentioning the TextureMap.LOCATION. Thank you very much, this was a bit of a pain to figure out! Its been 4 years since i touched minecraft modding, so it takes a bit of trying and failing to get back into it. Also, thanks for the quick reply, this has caused me a bit of a headache today
  3. Yea, and how would I access that texture? ?
  4. Any. I want to be able to get access to the block's textures And choose the one I want. If you look at my example with the sprite.getIconName(), I end up with a string "minecraft:blocks/sandstone_top", (or _side) If I try to use that string in a new resourcelocation, and bind it, I get a file not found exception.
  5. Hello! Im trying to get a texture from a block, and use a Render class to render a quad in the world with that texture on it. I have everything except how to actually find a block in the world, and get its texture to use in the render class. this is what ive got so far, i need the resourcelocation from the blocks model texture. And i cant for the life of me figure out how to get it.. //IBakedModel bakedModel = mc.getRenderItem().getItemModelWithOverrides(stack, entity.world, mc.player); IBakedModel bakedModel = mc.getBlockRendererDispatcher().getModelForState(waypoint.blockType.getDefaultState()); TextureAtlasSprite sprite = bakedModel.getQuads(waypoint.blockState, EnumFacing.EAST, 0).get(0).getSprite(); this.bindTexture(new ResourceLocation(sprite.getIconName())); //This is where i need the resource location.. I already got a block and //blockstate and everything else imaginable, except for the resource location. So far ive tried to create a new ResourceLocation with the name of the blocks texture, but i get a FileNotFound exception, and a black and pink square as shown in the screenshot. Im not sure if i should create a new ResourceLocation, or get one from the blocks model? Also not that everything works exactly like i want it with text and textures that i create. Just not when i try to grab a texture from a block.
×
×
  • Create New...

Important Information

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