Advertisement
EDDxample

honeystone.diff

Oct 10th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.53 KB | None | 0 0
  1. Changed classes:
  2.     net.minecraft.world.level.block.piston.PistonMath
  3.     net.minecraft.world.level.block.piston.PistonBaseBlock
  4.  
  5.  
  6.  
  7. +++ Changes in PistonMath (Entities stick to the side of honey blocks, Credits: EDDxample):
  8.  
  9.     public static List<AABB> getEntityMovementAreas(boolean isHoney, AABB aabb, Direction direction, double d) {
  10.         ArrayList arrayList = Lists.newArrayList((Object[])new AABB[]{PistonMath.getEntityMovementAreaInFront(aabb, direction, d)});
  11. -       if (isHoney && direction.getAxis().isHorizontal()) {
  12. -           arrayList.add(PistonMath.getEntityMovementAreaOnTop(aabb));
  13. +       if (isHoney) {
  14. +           arrayList.add(aabb.inflate(0.1));
  15.         }
  16.         return arrayList;
  17.     }
  18.  
  19.  
  20.  
  21. +++ Changes in PistonBaseBlock (Honey won't stick to slime and vice versa, Credits: Gnembon):
  22.  
  23.     public static boolean isPushable(BlockState state, Level level, BlockPos pos, Direction dir1, boolean bl, Direction dir2) {
  24.         Block block = state.getBlock();
  25. +       if (dir1 != dir2 && (block == Blocks.SLIME_BLOCK || block == Blocks.HONEY_BLOCK)) {
  26. +           Block prevBlock = level.getBlockState(pos.relative(dir2.getOpposite(), 1)).getBlock();
  27. +           if ((prevBlock == Blocks.SLIME_BLOCK || prevBlock == Blocks.HONEY_BLOCK) && block != prevBlock) {
  28. +               return false;
  29. +           }
  30. +       }
  31.         if (block == Blocks.OBSIDIAN) {
  32.             return false;
  33.         }
  34.         if (!level.getWorldBorder().isWithinBounds(pos)) {
  35.             return false;
  36.         }
  37.         ...
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement