Wooden Grate are un-Hittable from certain Angles
RlonRyan opened this issue ยท 17 comments
I decided to fix the RayTracing issue now, it would have bothered me if I didn't, I'll optimise tomorrow and I'll put in your optimisations as well.
Odd... that is still persisting...
I would be wary of overriding the collisionRayTrace() method, for mod support reasons. You never know who will query the bounds instead of the collisionRayTrace() method.
If you look at the commit, I didn't need to change the raytracing methods, I just needed to change the methods checkign if a vector is inside the Block's bounds, but those are private, so I had to override and change those methods. Functionality is exactly the same as Vanilla, except that it uses the bounds of the TIleEntity instead of the Block.
Anyways while we are talking about the GrateBlock class, I recommend that we move the classes like ItemBlockGate to their own classes.
I have this fixed, I believe.
The problem was that the bounding boxes had the x and y dimension switched it appears.
The x and y dimensions are fine I think, there's something derpy going on though.
It's because the bounds of the block get updated based upon what block you're colliding with/looking at.
So if you are in a blockspace with one grate, and looking at another it will have the box for the one you're colliding with.
You can't see it in the picture but the selection bounds are actually on a block behind the grate.
71cf5fa Still doesn't fix the problem all the way, as now the fences register as a whole block for the hitbox.
I see what you mean, the raytracing doesn't go trough the block, however the selection boxes and hitboxes are on the correct spots though, so I don't see what is going wrong. Can you remake your PR on the Grate branch please?
I'm sorry, but It's still persisting :/
http://puu.sh/k4Nrt/d80ec34313.png
I think it's better to leave the block bounds to a full block, and instead override th collisionRayTrace(World world, int x, int y, int z, Vec3 vec1, Vec3 vec2) method, I'll play around with that tomorrow, because now I'm too tired. Thanks for your input.