Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. @Override
  2. public void onGloveActivated(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
  3. RayTraceResult lookingAt = playerIn.rayTrace(10, 2.0F);
  4. BlockPos newPos = new BlockPos(lookingAt.getBlockPos());
  5. System.out.println(Blocks.COAL_ORE.getRegistryName().toString());
  6. for (int i = 0; i < validBlocks.size(); i++) {
  7. if ((worldIn.getBlockState(newPos).getBlock() == Blocks.COAL_ORE)
  8. || (worldIn.getBlockState(newPos).getBlock() == Blocks.IRON_ORE)
  9. || (worldIn.getBlockState(newPos).getBlock() == Blocks.REDSTONE_ORE)
  10. || (worldIn.getBlockState(newPos).getBlock() == Blocks.LAPIS_ORE)
  11. || (worldIn.getBlockState(newPos).getBlock() == Blocks.DIAMOND_ORE)
  12. || (worldIn.getBlockState(newPos).getBlock() == Blocks.EMERALD_ORE)) {
  13. System.out.println(validBlocks.get(i));
  14. worldIn.setBlockState(newPos, Blocks.GOLD_ORE.getDefaultState());
  15. System.out.println(newPos.getX() + " " + newPos.getY() + " " + newPos.getZ());
  16. for (int j = 0; j < 20; j++)
  17. AlchemyMod.network.sendTo(
  18. new ParticlePacket(EnumParticleTypes.SPELL_WITCH.getParticleID(), newPos.getX() + 0.5,
  19. newPos.getY() + 0.4, newPos.getZ() + 0.5, 3, 0, 3, 1, 200, 1),
  20. (EntityPlayerMP) playerIn);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement