Hello! I have a couple things to share about Elevators on top of this 1.18 update
Sorry this had taken so long to get out. I had been fighting with my setup for a while to make something interesting possible. It's no secret, Elevators uses NMS. I have no issue reading, updating, and working with it whatsoever. I quite enjoy the deep dive into the backends of Minecraft. Why is this significant? Well, Minecraft updated to Java version 16 earlier this year. I will say straight up that I love the new efficiency and additions to java 16 over the older editions, but this java version difference had made keeping Elevators backwards compatible difficult. To keep Elevators working on older versions, I needed to compile with java 13... but then I would get an error from 1.17 and 1.18 classes saying that it could not be accessed due to it not being in java 16. Quite a tricky situation, but one I had found a fun backdoor workaround for.
This version of Elevators is compiled with JDK 13, so it should be able to run on older server versions more easily.
All that aside, lets get into the less frustrating changes:
This update somewhat hit me at a midpoint between a change of obstruction detection. In the last version (4.0.5), I had a fairly cringy text file containing materials that should not stop a player from teleporting. It was a straight-forward easy-to-work-with method, but very clunky and a mess to keep updated between versions. This version makes use of an API feature to check if a block is passable first, followed by a bounding-box/collision-box check.
In the above video, you can see that the player can happily go to the second floor while the trapdoor is open, but not when the trapdoor is closed. This is a result of the collision testing mentioned above. The actual collision box of the trapdoor while closed is not in the way of the player when they teleport, so it lets them through.
I still want to improve this! It works perfectly fine, but there are always ways to do better. In the first place, since this update came at a midpoint from me making this... The nonobstructivelist text file is completely useless and not read at the moment. I plan to reincorporate this, not as a list containing all the blocks that shouldn't obstruct, but as a file where server owners can specify extra materials that shouldn't count. For example: Candles. Candles have such a small height that it is a bit ridiculous that they block an elevator to begin with. This leads me into my next desire for this collision test: Checking the free space! What's my plan? Take the collision box from two blocks above the elevator, subtract the MinY from the bounding box MaxY of the block on the elevator. If there is enough room for a player to squeeze in there, lets allow them to. I hope the next update has these features instead of it just being for bug fixes, but we should be seeing these features soonish.
Oh, and there is now a %top_floor% placeholder usable in actions now that will display the floor count for an elevator X & Z.
I have not yet been able to test this out with latest releases for hooked plugins. Please report it to me if any hooked plugins cause any sort of error or unwanted behavior.
As always, thank you for supporting my plugin. Please post in the discussions, or directly message me if you notice any issues or bugs. Sorry for the tease with the floating elevators in the video as well
I do most of my testing with a different version I plan on fully releasing soon.