1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 16:47:56 +00:00

Redo turtle move checks

Oh, this is so broken, and really has been since the 1.13 update, if not
earlier.

 - Fix call to isUnobstructed using the bounding box of the
   *destination* block rather than the turtle. This is almost always
   air, so the box is empty.

 - Because the above check has been wrong for so many years, we now
   significantly relax the "can push" checks for entities. We now allow
   pushing entities in any direction.

   We also remove the "isUnobstructed" check for the destination entity
   pos. This causes problems (if two entities are standing on a turtle,
   they'll obstruct each other), and given pistons don't perform such a
   check, I don't think we need it.

 - Also do a bit of cleanup around air/liquid checks. We often ended up
   reading the block state multiple times, which is a little ugly.
This commit is contained in:
Jonathan Coates
2025-01-27 22:43:29 +00:00
parent 7d8f609c49
commit b69a44a927
11 changed files with 215 additions and 56 deletions

View File

@@ -408,8 +408,9 @@ public class PlatformHelperImpl implements PlatformHelper {
}
}
private record WrappedMenuProvider(Component title, MenuConstructor menu,
ContainerData data) implements ExtendedScreenHandlerFactory {
private record WrappedMenuProvider(
Component title, MenuConstructor menu, ContainerData data
) implements ExtendedScreenHandlerFactory {
@Nullable
@Override
public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) {