aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/mixins/blocksize/MixinCrops.java
blob: 217672ab20532b4faaaefce911d3ac94ada35545 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package rosegoldaddons.mixins.blocksize;

import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockCrops;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(BlockCrops.class)
public class MixinCrops extends BlockBush {

    @Override
    public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) {
        worldIn.getBlockState(pos).getBlock().setBlockBounds(0, 0, 0, 1, 1, 1);
        return super.getSelectedBoundingBox(worldIn, pos);
    }

    @Override
    public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) {
        worldIn.getBlockState(pos).getBlock().setBlockBounds(0, 0, 0, 1, 1, 1);
        return super.collisionRayTrace(worldIn, pos, start, end);
    }
}