OpenBlocks

OpenBlocks

56M Downloads

Elevator won't go down if transparent objects in the way

wooky opened this issue ยท 8 comments

commented

If you try to go down from a floor to another and there is some non-transparent blocks, like a vine or a pressure plate, it won't allow you to descend, which it technically should. For some reason, going up a floor works, maybe because the transparent blocks are lower and are not being checked.

commented

Give me 45 minutes and I'll release a fix for this. Just have to wait until I'm home.

And the way the searching up works is that it finds an elevator block and then checks there is room enough to put a player on top. Not certain if it'll work if there is a pressure plate on top of that block.

commented

There ya go, latest build has some extra configuration options for you to play around with :)

commented

If there is more than 3 blocks in between the two elevators. It wont pass through them.
I'll make this a configuration option. I'll also make a config to ignore certain blocks.

commented

It's still not working, but I think I know why: on lines 125 and 126 of TileEntityElevator, it checks if the second- and third-last blocks are air blocks; however, if those blocks are transparent, it fails. This is probably why a player can go up but not down.

commented

There is no sure way of knowing if a block is transparent, as that is governed by it's AABB and Renderer, there is no guarantee that it sets any flags saying it's transparent. I can provide another config option for a list of ids that should be considered passable. .But I've already provided a simple way to ignore all blocks when teleporting. Give those config options a go.

If you discover or hear of a sure way to detect transparent blocks, I'll implement it, it would be knowledge to me.

commented

Here's the way I tried to do it, but I couldn't test it because I have no idea why:

From what I saw, all transparent blocks override getCollisionBoundingBoxFromPool() to always return null. Perhaps you can check if it returns null to assume it's transparent.

commented

That is normally when they also override the possibility for custom collision boxes, for example, something not-cube that rotates. But I'll tell you what, I'll make the config option to ignoreIrregularBlocks, and it'll check for that to be null :)

commented

Can't do this at the moment as I'm at work, wanna add an ignore Transparent Blocks option, @mikeemoo ? Check for the Block.blockList[id].getCollisionBoundBoxFromPool == null. In which case the elevator passes through it and also allows a user to be teleported in to that area?

I'll assign you to it, but I'll do it tonight if I have time, wont be home till 10pm however. Work -.-"