FirEmerald / AdditionalPlacements

Vertical Slabs and Stairs framework and implementation
MIT License
6 stars 4 forks source link

Respect special pressure plates triggers #62

Closed LeoBeliik closed 9 months ago

LeoBeliik commented 10 months ago

This PR makes vertical and ceiling pressure plates to respect the parent conditions for activation.

Whilst this also fixes a crash with quark because they set the sensibility to null it also makes it respect the rule of activation from mods like player pressure plates, since as for now, mobs can activate their pressure plates placed vertically for example.

FirEmerald commented 9 months ago

While the intention is noble, this will not work. Note the portion of code that references TOUCH_AABBS: AABB aabb = TOUCH_AABBS[level.getBlockState(pos).getValue(AdditionalBasePressurePlateBlock.PLACING).ordinal() - 1].move(pos); The existing code in the pressure plate classes use AABB's that match the upwards facing plate only.

LeoBeliik commented 9 months ago

The only reason I removed that code instead of just adding an extra check it's because it was not necessary, vertical and upside-down pressure plates work normally without it, as in, if the entity is not touching it, it won't trigger. Unless I'm misunderstanding the point

2024-02-27_13 42 14 2024-02-27_13 40 51 2024-02-27_13 40 17

FirEmerald commented 9 months ago

It may look like it's working properly for you, but if you actually look at the code, as I stated before the pressure plate is only checking an area that's appropriate for a floor-mounted plate.

FirEmerald commented 9 months ago

To further clarify, this is the bounding box which is being checked: new AABB(0.125, 0.0, 0.125, 0.875, 0.25, 0.875); which has a margin of 2 pixels around it, and goes from the ground to 4 pixels high.