Jump to content

[1.7.10] ISBRH RenderBlocks issue with blocks extending out of block bounds


Recommended Posts

Posted

Hello all.

 

I'm trying to make some new blocks, and I'm using the RenderBlocks renderStandardBlock method for doing so.

 

However, it's treating textures oddly, and I can't figure out why. I've stripped my class right down to bare basics, trying to emulate this guide:

http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html

 

In that article, you can see the textures get truncated, so they render as if a full block, but only actually show the relevant part of it.

 

In my case, this happens (as I want it to) on the top and bottom textures. However, the side textures are all showing the full size texture scaled down:

5652326f48da0.jpg

 

Has anyone got any idea why this might be happening? I'm guessing I've just missed something minor, but I can't seem to find any other examples that are any different to mine...

 

Render class:

package co.uk.silvania.cities.core.client.renders;

import org.lwjgl.opengl.GL11;

import co.uk.silvania.cities.core.blocks.BlockWalkway;
import co.uk.silvania.cities.core.client.ClientProxy;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;

public class WalkwayRenderer implements ISimpleBlockRenderingHandler {

@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	renderBlock(0.25D, 0.9D, 0.25D, 0.75D, 1.4D, 0.75D, true, renderer, block, x, y, z, 0);
	return true;
}

@Override
public boolean shouldRender3DInInventory(int modelId) {
	return false;
}

@Override
public int getRenderId() {
	return ClientProxy.walkwayRenderID;
}

public void renderBlock(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, boolean existsInWorld, RenderBlocks renderer, Block block, int x, int y, int z, int meta) {
	renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ);
	renderer.renderStandardBlock(block, x, y, z);
}
}

 

As for getting the texture, in my Block's class:

@Override
public IIcon getIcon(int side, int metadata) {
	return Blocks.planks.getIcon(0, textureMeta);
}

 

Any help much appreciated :)

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

I've figured out the CAUSE of the issue, but still need a solution.

 

My rendered block is ever so slightly larger than a standard block - stretching 1/16th to 1/8th outside its ordinary bounds.

Now, I CAN remodel it and fit it within the block, but doing so just makes it appear a little bit too small IMO, so I'd rather find a solution.

 

Anyone got any ideas?

 

(Photo examples)

 

Bad one (Block Y is 0.8-1.3, giving an 0.5x0.5x0.5 block)

Note how the texture is 8 wide as it should be, but is a full 16 high.

565360781b86c.jpg

 

Good one (Y is 0.5-1.0, same size block)

Here the texture is correct, rendering 8 pixels on each axis:

565360884bf96.jpg

 

And an example with both. Lower is 0.3-0.8, upper is 0.9-1.4

5653623b5c13f.jpg

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • The game crashed whilst unexpected error Error: net.minecraftforge.fml.ModLoadingException: Advanced Mining Dimension (mining_dimension) encountered an error during the done event phase
    • Here is the end of the log. it was way too big to put in pastebin, but I started from when I was online and everything was fine. Error should be in here: https://pastebin.com/Sdhdq593
    • Update: I stand corrected as I was able to dig up a relevant log from my earlier testing which highlights the overall issue but does not explain how to solve it. See, Diagnostic Logs for pack.mcmeta not found: https://pastebin.com/LXS8Rtna
    • Which mod was this? What are all the mods that were in use? It will help if enough information to replicate the problem is available.
    • I have been attempting to create a supplementary resource pack with Patchouli in order to add back the guidebook for Better End but unfortunately in every prototype I have made pack.mcmeta and my resource pack are not recognized. I have tested both zipped and unzipped and either way curseforge does not recognize my resource pack as existing. For testing I stripped my pack down to just the pack.mcmeta file and two empty folders labelled data and assets and I know the data folder is not the problem as firstly my first attempts just had an assets folder following Patchouli instructions and data came later in my flailing attempts to make anything in my pack work. The mcmeta file is not recognized whether or not I use this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } "language": { "en_US": { "name": "English", "region": "United States" } } } ,or this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } } I have made sure to only use lowercase and the pack folder is named better-end-guide. Is this some magic nonsense from me doing this manually instead of using an IDE or similar tool? Could it be because my files are by default in UTF-8 even though ANSI gives the same results? Is there a specific community secret tool I am supposed to use for zipping or specific settings? I am pulling my hair in distress. Unfortunately as there are no errors involved I lack logs to offer, if that disqualifies this thread please do not be harsh and instead if you can then please direct me to a forum with different rules and sufficiently respectful but knowledgeable as to be of assistance. Most of my experience with the programming community has been poor and so naturally I find myself wary.
  • Topics

×
×
  • Create New...

Important Information

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