<commit_before>package notjoe.pointersmod.api.actions;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import notjoe.pointersmod.api.BlockInWorld;
import notjoe.pointersmod.api.PointerAction;
import notjoe.pointersmod.api.helpers.NbtHelper;
import notjoe.pointersmod.common.Config;

public class PointerActionTeleport extends PointerAction {
    @Override
    public boolean setPointerTarget(ItemStack stack, BlockInWorld blockInWorld, World world) {
        NbtHelper.initNbtTagForStack(stack);
        BlockInWorld blockUp =
            new BlockInWorld(blockInWorld.pos.offset(blockInWorld.facing), blockInWorld.dimension,
                blockInWorld.facing);
        blockUp.serializeNbt(stack.getTagCompound());
        return true;
    }

    @Override public boolean pointerActivated(ItemStack stack, World world, EntityPlayer player) {
        if (hasTarget(stack) && isTargetAccessible(stack, world, player)) {
            BlockInWorld blockInWorld = new BlockInWorld(stack.getTagCompound());
            player.setPosition(blockInWorld.pos.getX() + 0.5, blockInWorld.pos.getY() + 0.5,
                blockInWorld.pos.getZ() + 0.5);
            return true;
        }
        return false;
    }

    @Override public long getTeslaPerUse() {
        return Config.teleportTpu;
    }
}
<commit_msg>Particles for Positional Pointer teleports<commit_after>package notjoe.pointersmod.api.actions;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import notjoe.pointersmod.api.BlockInWorld;
import notjoe.pointersmod.api.PointerAction;
import notjoe.pointersmod.api.helpers.NbtHelper;
import notjoe.pointersmod.common.Config;

import java.util.Random;

public class PointerActionTeleport extends PointerAction {
    private static Random random = new Random();
    @Override
    public boolean setPointerTarget(ItemStack stack, BlockInWorld blockInWorld, World world) {
        NbtHelper.initNbtTagForStack(stack);
        BlockInWorld blockUp =
            new BlockInWorld(blockInWorld.pos.offset(blockInWorld.facing), blockInWorld.dimension,
                blockInWorld.facing);
        blockUp.serializeNbt(stack.getTagCompound());
        return true;
    }

    @Override public boolean pointerActivated(ItemStack stack, World world, EntityPlayer player) {
        if (hasTarget(stack) && isTargetAccessible(stack, world, player)) {
            BlockInWorld blockInWorld = new BlockInWorld(stack.getTagCompound());
            player.setPosition(blockInWorld.pos.getX() + 0.5, blockInWorld.pos.getY() + 0.5,
                blockInWorld.pos.getZ() + 0.5);
            for(int i = 0; i < 20; i++) {
                world.spawnParticle(EnumParticleTypes.REDSTONE,
                    player.posX + random.nextGaussian(),
                    player.posY,
                    player.posZ + random.nextGaussian(),
                    random.nextGaussian(),
                    random.nextGaussian(),
                    random.nextGaussian());
            }
            return true;
        }
        return false;
    }

    @Override public long getTeslaPerUse() {
        return Config.teleportTpu;
    }
}

{'fraction_non_alphanumeric': 0.094316807738815, 'fraction_numerical': 0.004534461910519952, 'mean_word_length': 2.934601664684899, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4671601', 'n_tokens_mistral': 968, 'n_tokens_neox': 941, 'n_words': 177}