AgriCraft

AgriCraft

30M Downloads

Wooden Grate are un-Hittable from certain Angles

RlonRyan opened this issue ยท 17 comments

commented

As illustrated below.
2015-09-08_13 41 18

commented

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.

commented

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.

commented

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.

commented

That's a good idea. Hopefully that will work.

commented

Anyways while we are talking about the GrateBlock class, I recommend that we move the classes like ItemBlockGate to their own classes.

commented

I have this fixed, I believe.

The problem was that the bounding boxes had the x and y dimension switched it appears.

commented

The x and y dimensions are fine I think, there's something derpy going on though.

commented

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.

commented

You can't see it in the picture but the selection bounds are actually on a block behind the grate.

commented

71cf5fa Still doesn't fix the problem all the way, as now the fences register as a whole block for the hitbox.

commented

Try a git checkout of this pr to see the difference.

commented

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?

commented

Grate branch? Ok!

commented

I'm sorry, but It's still persisting :/
http://puu.sh/k4Nrt/d80ec34313.png

commented

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.

commented

Any particular reason?

commented

It will make the files shorter & easier to read, as well as making the items easier to find.