Posted April 12, 20178 yr I have a block of type BlockWire (which inherits from BlockHideable) that has a tile entity of type TileEntityWire (which in turn inherits from TileEntityHideable). The block mostly works like redstone, and should therefore be able to power redstone. My problem is that the wire doesn't update blocks properly. Redstone can only be turned on, while other wire blocks don't update at all. Also, if I click on the bottom on the block, it becomes visible (even though it shouldn't). I'm suspecting it is because BlockHideable sets the bounding box to AxisAligned(0, 0, 0, 0, 0, 0) instead of NULL_AABB, but if I return that the game crashes with a NullPointerException.
April 12, 20178 yr 4 minutes ago, That_Martin_Guy said: but if I return that the game crashes with a NullPointerException. > No crash posted Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
April 12, 20178 yr Author 11 minutes ago, Draco18s said: > No crash posted Didn't think it would matter, but here it is anyway.
April 21, 20178 yr Author Sorry for reviving this thread, but I really have no clue how to fix this. I've tried multiple variations of the code, but I'm just stuck.
April 21, 20178 yr Author 6 minutes ago, diesieben07 said: Put a breakpoint where it crashes and check what is null, and why. @Override public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) { return state.getValue(HIDDEN) ? NULL_AABB : FULL_BLOCK_AABB; } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return state.getValue(HIDDEN) ? NULL_AABB : FULL_BLOCK_AABB; } If I have a new AxisAlignedBB with 0 as all of its parameters instead of NULL_AABB it works. EDIT: I had initally thought this made a problem where the block became visible when right clicked, but later realised it couldn't be because of this since it also becomes visible when receiving a block update. Edited April 21, 20178 yr by That_Martin_Guy
April 21, 20178 yr Author 9 minutes ago, diesieben07 said: So the code on your Github is not up to date... How are we supposed to help you then? getBoundingBox must not return null. It is up to date. I mentioned in the post an experiment I made where I returned NULL_AABB in those methods, instead of a new AxisAlignedBB with 0 as all of its parameters, which resulted in a NullPointerException. I did this experiment because I thought having this empty object had an unintended side effect where the block became visible when right clicked. I realize now, however, that it can't be because of that since it also becomes visible when receiving any block update (from a lever, for example). I thought I could "fix" this by making the hitbox null, but again, the hitbox is most likely not the problem. EDIT: Sorry for being unclear and editing my posts a lot, but I was pretty excited that someone would be able to help me (hopefully) Edited April 21, 20178 yr by That_Martin_Guy
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.