Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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)

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

 

 

  • 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

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

 

 

 

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.