Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/cam72cam/prospectus/ItemProspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
Expand Down Expand Up @@ -70,8 +72,10 @@ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos
if(accuracy < Math.random() * 100)
continue;

RayTraceResult rayTrace = new RayTraceResult(new Vec3d(hitX, hitY, hitZ), facing, pos);

IBlockState state = world.getBlockState(pos.add(x,y,z));
ItemStack stack = state.getBlock().getPickBlock(state, null, world, pos.add(x, y, z), null);
ItemStack stack = state.getBlock().getPickBlock(state, rayTrace, world, pos.add(x, y, z), player);
String name = stack.getDisplayName();
if (Prospectus.isStackWhitelisted(stack)) {
if (!counts.containsKey(name)) {
Expand Down