diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockCloud.java b/src/main/java/com/minelittlepony/unicopia/block/BlockCloud.java index c6f077ac..7f7f1a65 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockCloud.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockCloud.java @@ -15,12 +15,15 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.NonNullList; @@ -188,6 +191,17 @@ public class BlockCloud extends Block implements ICloudBlock, ITillable { return (CloudType)blockState.getValue(VARIANT); } + @Deprecated + @Override + public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) { + if (worldIn.isRemote) { + if (!getCanInteract(blockState, Minecraft.getMinecraft().player)) { + return null; + } + } + return super.collisionRayTrace(blockState, worldIn, pos, start, end); + } + @Override public boolean canBeTilled(ItemStack hoe, EntityPlayer player, World world, IBlockState state, BlockPos pos) { return PlayerSpeciesList.instance().getPlayer(player).getPlayerSpecies().canInteractWithClouds() diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFarm.java b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFarm.java index e03fa797..0d16e39a 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFarm.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockCloudFarm.java @@ -9,12 +9,15 @@ import com.minelittlepony.unicopia.UBlocks; import net.minecraft.block.SoundType; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -99,6 +102,17 @@ public class BlockCloudFarm extends UFarmland implements ICloudBlock { return getCanInteract(state, entity) && super.canEntityDestroy(state, world, pos, entity); } + @Deprecated + @Override + public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) { + if (worldIn.isRemote) { + if (!getCanInteract(blockState, Minecraft.getMinecraft().player)) { + return null; + } + } + return super.collisionRayTrace(blockState, worldIn, pos, start, end); + } + @Deprecated public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, @Nullable Entity entity, boolean p_185477_7_) { if (getCanInteract(state, entity)) {