// Path: src/main/java/com/latenighters/runicarcana/common/setup/ModSetup.java
//     public class ModSetup {
// 
//     public static final ItemGroup ITEM_GROUP = new ItemGroup(RunicArcana.MODID) {
//         @Override
//         public ItemStack createIcon() {
//             return new ItemStack(Registration.CHALK.get());
//         }
//     };
// }
// 
// Path: src/main/java/com/latenighters/runicarcana/util/Util.java
// public class Util {
// 
//     public static ITextComponent loreStyle(ITextComponent textComponent){
//         return textComponent.applyTextStyle(TextFormatting.DARK_PURPLE).applyTextStyle(TextFormatting.ITALIC);
//     }
// 
//     public static ITextComponent loreStyle(String key, Object...args){
//         return loreStyle(new TranslationTextComponent(key, args));
//     }
// 
//     public static ITextComponent tooltipStyle(ITextComponent textComponent){
//         return textComponent.applyTextStyle(TextFormatting.GRAY);
//     }
// 
//     public static ITextComponent tooltipStyle(String key, Object... args){
//         return tooltipStyle(new TranslationTextComponent(key, args));
//     }
// 
//     public static void setPositionAndRotationAndUpdate(Entity entity, Double x, Double y, Double z, Float yaw, Float pitch) {
//         entity.setPositionAndUpdate(x, y, z);
//         entity.setPositionAndRotation(x, y, z, yaw, pitch);
//     }
// 
//     public static void setPositionAndRotationAndUpdate(Entity entity, Double x, Double y, Double z){
//         setPositionAndRotationAndUpdate(entity, x, y, z, entity.rotationYaw, entity.rotationPitch);
//     }
// 
//     public static boolean checkHeadspace(World world, BlockPos pos){
//         return world.isAirBlock(pos) && world.isAirBlock(pos.up());
//     }
// 
//     public static void spawnParticleGroup(World world, BasicParticleType type, LivingEntity entity) {
//         final Random rand = new Random();
//         if (world.isRemote) {
//             for (int i = 0; i < 30; ++i) {
//                 double d0 = rand.nextGaussian() * 0.02D;
//                 double d1 = rand.nextGaussian() * 0.02D;
//                 double d2 = rand.nextGaussian() * 0.02D;
//                 world.addParticle(
//                         type,
//                         entity.getPosX() + (double) (rand.nextFloat() * entity.getWidth() * 2.0F) - (double) entity.getWidth() - d0 * 10.0D,
//                         entity.getPosY() + (double) (rand.nextFloat() * entity.getHeight()) - d1 * 10.0D,
//                         entity.getPosZ() + (double) (rand.nextFloat() * entity.getWidth() * 2.0F) - (double) entity.getWidth() - d2 * 10.0D, d0, d1, d2
//                 );
//             }
// 
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/latenighters/runicarcana/util/Util.java
// public static boolean checkHeadspace(World world, BlockPos pos){
//     return world.isAirBlock(pos) && world.isAirBlock(pos.up());
// }


import com.latenighters.runicarcana.common.setup.ModSetup;
import com.latenighters.runicarcana.util.Util;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import static com.latenighters.runicarcana.util.Util.checkHeadspace;
package com.latenighters.runicarcana.common.items;




public class TransportRodItem extends Item {
    public static final float teleRange = 128.0f;
    public static final int maxBlocksSearched = 5;
    public static boolean didAltTeleport = false;

    public TransportRodItem() {
        super(new Properties()
                .maxStackSize(1)
                .group(ModSetup.ITEM_GROUP)
        );
    }

    @Override
    public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
        super.addInformation(stack, worldIn, tooltip, flagIn);
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.1"));
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.2", (int) teleRange, maxBlocksSearched));
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.3"));
        tooltip.add(Util.loreStyle("lore.runicarcana.transport_rod"));
    }

    @Override
    @Nonnull
    public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
        if (!playerIn.isSteppingCarefully() && !didAltTeleport){
            Vec3d lookVec = playerIn.getLookVec();
// Path: src/main/java/com/latenighters/runicarcana/common/setup/ModSetup.java
//     public class ModSetup {
// 
//     public static final ItemGroup ITEM_GROUP = new ItemGroup(RunicArcana.MODID) {
//         @Override
//         public ItemStack createIcon() {
//             return new ItemStack(Registration.CHALK.get());
//         }
//     };
// }
// 
// Path: src/main/java/com/latenighters/runicarcana/util/Util.java
// public class Util {
// 
//     public static ITextComponent loreStyle(ITextComponent textComponent){
//         return textComponent.applyTextStyle(TextFormatting.DARK_PURPLE).applyTextStyle(TextFormatting.ITALIC);
//     }
// 
//     public static ITextComponent loreStyle(String key, Object...args){
//         return loreStyle(new TranslationTextComponent(key, args));
//     }
// 
//     public static ITextComponent tooltipStyle(ITextComponent textComponent){
//         return textComponent.applyTextStyle(TextFormatting.GRAY);
//     }
// 
//     public static ITextComponent tooltipStyle(String key, Object... args){
//         return tooltipStyle(new TranslationTextComponent(key, args));
//     }
// 
//     public static void setPositionAndRotationAndUpdate(Entity entity, Double x, Double y, Double z, Float yaw, Float pitch) {
//         entity.setPositionAndUpdate(x, y, z);
//         entity.setPositionAndRotation(x, y, z, yaw, pitch);
//     }
// 
//     public static void setPositionAndRotationAndUpdate(Entity entity, Double x, Double y, Double z){
//         setPositionAndRotationAndUpdate(entity, x, y, z, entity.rotationYaw, entity.rotationPitch);
//     }
// 
//     public static boolean checkHeadspace(World world, BlockPos pos){
//         return world.isAirBlock(pos) && world.isAirBlock(pos.up());
//     }
// 
//     public static void spawnParticleGroup(World world, BasicParticleType type, LivingEntity entity) {
//         final Random rand = new Random();
//         if (world.isRemote) {
//             for (int i = 0; i < 30; ++i) {
//                 double d0 = rand.nextGaussian() * 0.02D;
//                 double d1 = rand.nextGaussian() * 0.02D;
//                 double d2 = rand.nextGaussian() * 0.02D;
//                 world.addParticle(
//                         type,
//                         entity.getPosX() + (double) (rand.nextFloat() * entity.getWidth() * 2.0F) - (double) entity.getWidth() - d0 * 10.0D,
//                         entity.getPosY() + (double) (rand.nextFloat() * entity.getHeight()) - d1 * 10.0D,
//                         entity.getPosZ() + (double) (rand.nextFloat() * entity.getWidth() * 2.0F) - (double) entity.getWidth() - d2 * 10.0D, d0, d1, d2
//                 );
//             }
// 
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/latenighters/runicarcana/util/Util.java
// public static boolean checkHeadspace(World world, BlockPos pos){
//     return world.isAirBlock(pos) && world.isAirBlock(pos.up());
// }


// Path: src/main/java/com/latenighters/runicarcana/common/items/TransportRodItem.java
import com.latenighters.runicarcana.common.setup.ModSetup;
import com.latenighters.runicarcana.util.Util;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import static com.latenighters.runicarcana.util.Util.checkHeadspace;

package com.latenighters.runicarcana.common.items;




public class TransportRodItem extends Item {
    public static final float teleRange = 128.0f;
    public static final int maxBlocksSearched = 5;
    public static boolean didAltTeleport = false;

    public TransportRodItem() {
        super(new Properties()
                .maxStackSize(1)
                .group(ModSetup.ITEM_GROUP)
        );
    }

    @Override
    public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
        super.addInformation(stack, worldIn, tooltip, flagIn);
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.1"));
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.2", (int) teleRange, maxBlocksSearched));
        tooltip.add(Util.tooltipStyle("tooltip.runicarcana.transport_rod.3"));
        tooltip.add(Util.loreStyle("lore.runicarcana.transport_rod"));
    }

    @Override
    @Nonnull
    public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
        if (!playerIn.isSteppingCarefully() && !didAltTeleport){
            Vec3d lookVec = playerIn.getLookVec();
            Vec3d start = new Vec3d(playerIn.getPosX(), playerIn.getPosY() + playerIn.getEyeHeight(), playerIn.getPosZ());