CraftBook 3

CraftBook 3

139k Downloads

IllegalArgumentException caused by CartMechanismBlocks.findByRail

kikelkik opened this issue · 15 comments

commented

The following error appears apparently in the server log. It should have got something to do with Minecarts.

Error: https://pastebin.com/STtJN6um

mechanisms.yml: mechanisms.txt
CraftBook version: 3.10.2-SNAPSHOT;4586-0c3ad1c
Server version: git-Paper-240 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)

commented

That looks like a Spigot bug? We're calling the API and for some reason it's looking up a null property

commented

You mean because test.getOppositeFace() and vine can never be null (if it's the case..) ?

commented

The error is occurring inside the vine.hasFace call, if vine was null the error would be different and test.getOppositeFace() cannot be null

commented
commented

Black Hole commented the ticket:

Vine extends MultipleFacing. That interface declares a method getAllowedFaces to check if a face is supported. Vine supports all faces except DOWN.

So this:

for(BlockFace test : LocationUtil.getDirectFaces()) {

should be instead:
for(BlockFace test : vine.getAllowedFaces()) {

Could you change it?

One could also consider to replace that util method at all places with this one, it's not used that often.

commented

That method in Spigot must’ve changed then. It used to return false for down rather than erroring.

Realistically the error is still a spigot bug, but I’ll fix it within CraftBook when I get a chance

commented

Fixed

commented

I cannot reproduce this issue, it's working fine for me - and I can't seem to setup a circumstance where Spigot says that a ladder does not have a direction, that's the main reason I was asking about ingame setup.

What direction are those ladders facing?

commented

Oh you`re right, it's about directions. It only happens with ladders facing north, all other directions work :)

commented

I couldn't reproduce it, so I updated to the latest Paper version. Now ladders facing north have no direction according to the Spigot API 😦

I'll look into if this is able to be worked around from within CraftBook, but if not it'll need to be reported to Spigot to see if they fix it. Tbh either way it should be reported, but I'll try finding a workaround anyway.

commented

btw: the paper API doc has been updated with the fact that vines cannot face downwards.
solved in https://hub.spigotmc.org/jira/browse/SPIGOT-5716

if you give us an exact description where in the spigot api ladders have no facing north direction (classname, method, (line)), we could forward that request to spigot.
But of course you can also write that ticket there :)

commented

I've just pushed a change that makes CraftBook use the reversed facing direction, rather than the direction that the ladder is attached to. This doesn't appear to have the same north = null bug.

I haven't looked deep into Spigot to find where it's broken, so I can't easily link code etc.

As for the previous issue, yeah I saw that Spigot have added a better error message. They should've done that when they changed behaviour in the first place ;)

commented

The system is still not working. As soon as you drive a minecart into a ladder, an error in the log occurs and nothing happens.
Error: https://pastebin.com/pTiYr3DN
CraftBook version 3.10.2-SNAPSHOT;4597-90668cb
WorldGuard version 7.0.3-SNAPSHOT;2036-47cd96a
Paper 1.15.2 - 264

commented

What is the setup of that ingame? That error indicates that for some reason a ladder doesn’t have a direction, which should never be possible

commented

The setup looks like this:
2020-05-09_10 34 43
I have also manually updated the ladders. It worked in version 1.13 using a
older Craftbook version. Since the update to the latest Paper and Craftbook version it does not work anymore. So the ingame setup itself should not be the problem.