Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Changed classes:
- net.minecraft.world.level.block.piston.PistonMath
- net.minecraft.world.level.block.piston.PistonBaseBlock
- +++ Changes in PistonMath (Entities stick to the side of honey blocks, Credits: EDDxample):
- public static List<AABB> getEntityMovementAreas(boolean isHoney, AABB aabb, Direction direction, double d) {
- ArrayList arrayList = Lists.newArrayList((Object[])new AABB[]{PistonMath.getEntityMovementAreaInFront(aabb, direction, d)});
- - if (isHoney && direction.getAxis().isHorizontal()) {
- - arrayList.add(PistonMath.getEntityMovementAreaOnTop(aabb));
- + if (isHoney) {
- + arrayList.add(aabb.inflate(0.1));
- }
- return arrayList;
- }
- +++ Changes in PistonBaseBlock (Honey won't stick to slime and vice versa, Credits: Gnembon):
- public static boolean isPushable(BlockState state, Level level, BlockPos pos, Direction dir1, boolean bl, Direction dir2) {
- Block block = state.getBlock();
- + if (dir1 != dir2 && (block == Blocks.SLIME_BLOCK || block == Blocks.HONEY_BLOCK)) {
- + Block prevBlock = level.getBlockState(pos.relative(dir2.getOpposite(), 1)).getBlock();
- + if ((prevBlock == Blocks.SLIME_BLOCK || prevBlock == Blocks.HONEY_BLOCK) && block != prevBlock) {
- + return false;
- + }
- + }
- if (block == Blocks.OBSIDIAN) {
- return false;
- }
- if (!level.getWorldBorder().isWithinBounds(pos)) {
- return false;
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment