Posted February 9, 201510 yr I have my TESR's rendering axises, which extend out of the block. This is the code i use for a single axis: https://github.com/Wuerfel21/The-Derpy-Shiz-Mod/blob/master/src/main/java/net/wuerfel21/derpyshiz/entity/tile/AbstractGearbox.java#L41-L59 Now i tried adapting it for 2 axises: https://github.com/Wuerfel21/The-Derpy-Shiz-Mod/blob/master/src/main/java/net/wuerfel21/derpyshiz/entity/tile/TileEntityGearboxSplitting.java#L145-L181 but it seems to cover only the block itself...
February 9, 201510 yr Author There isnt much to show, it just has the default render bounding box, e.g. when the actual block is offscreen, all stuff extending from it isnt rendered... (BTW the first method works, but the lower one(which is for 2 axises) shows the above symptoms)
February 9, 201510 yr Hi Try this TileEntity:: /** Return an appropriate bounding box enclosing the TESR * This method is used to control whether the TESR should be rendered or not, depending on where the player is looking. * The default is the AABB for the parent block, which might be too small if the TESR renders outside the borders of the * parent block. * If you get the boundary too small, the TESR may disappear when you aren't looking directly at it. * @return an appropriately size AABB for the TileEntity */ @SideOnly(Side.CLIENT) @Override public AxisAlignedBB getRenderBoundingBox() { // if your render should always be performed regardless of where the player is looking, use infinite AxisAlignedBB infiniteExample = INFINITE_EXTENT_AABB; // our gem will stay above the block, up to 1 block higher, so our bounding box is from [x,y,z] to [x+1, y+2, z+1] AxisAlignedBB aabb = new AxisAlignedBB(getPos(), getPos().add(1, 2, 1)); return aabb; } (What I mean is - try it with an infinite box. If that fixes your problem, your bounding box is wrong - try setting a breakpoint or System.out.println in there to see why) This link might also be of interest https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe21_tileentityspecialrenderer -TGG
February 10, 201510 yr Author I already knew it was the bounding box, it was the only thing i changed. So, again: First metod works perfectly, but only accounts for 1 axis Second method should do for 2 axises, but does only have the block itself in the bounding box, which is the problem
February 10, 201510 yr I already knew it was the bounding box, it was the only thing i changed. So, again: First metod works perfectly, but only accounts for 1 axis Second method should do for 2 axises, but does only have the block itself in the bounding box, which is the problem > try setting a breakpoint or System.out.println in there to see why) I guess you didn't try this suggestion? eg System.out.println("b1: " + b1); System.out.println("b2:" + b2); AxisAlignedBB retval = b1.func_111270_a(b2); System.out.println("b1xb2:" + retval); return b1.func_111270_a(b2); If you do this, you'll find out pretty quickly that your switches are busted. -TGG
February 10, 201510 yr wow, im an idiot... Well if it makes you feel any better, I've made this bug at least a dozen times over the years... -TGG
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.