<commit_before>package matt.lyoko.blocks;

import java.util.Random;

import matt.lyoko.CodeLyoko;
import matt.lyoko.entities.tileentity.TileEntityTower;
import matt.lyoko.items.ModItems;
import matt.lyoko.particles.LyokoParticleEffects;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockTower extends BlockContainer
{
    public BlockTower(int par1)
    {
        super(par1, Material.iron);
        this.setCreativeTab(CodeLyoko.LyokoTabs);
    }
    
    Icon inside;
    
    @Override
    public void registerIcons(IconRegister par1IconRegister)
    {
        this.blockIcon = par1IconRegister.registerIcon("lyoko:tower");
        inside = par1IconRegister.registerIcon("lyoko:blank");
    }

    @Override
    public TileEntity createNewTileEntity(World var1) {
        return new TileEntityTower();
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public Icon getIcon(int side, int meta)
    {
    	if(side == 2 && meta == 0)
    	{
    		return inside;
    	}
    	else if(side == 3 && meta == 2)
    	{
    		return inside;
    	}
    	else if(side == 4 && meta == 3)
    	{
    		return inside;
    	}
    	else if(side == 5 && meta == 1)
    	{
    		return inside;
    	}
    	return this.blockIcon;
    }

    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
    {
		TileEntityTower tet = (TileEntityTower) world.getBlockTileEntity(x, y, z);

		if(!world.isRemote)
		{
			if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.LaserArrow)
			{
				tet.owner = "reset";
				world.markBlockForUpdate(x, y, z);
				return true;
			}
		}
		return false;
    }

    @SideOnly(Side.CLIENT)
    public void randomDisplayTick(World world, int x, int y, int z, Random random)
    {
        TileEntityTower tet = (TileEntityTower) world.getBlockTileEntity(x, y, z);
        
        int meta = world.getBlockMetadata(x, y, z);
        
        Random var5 = world.rand;
        double var6 = 0.0625D;

        for (int var8 = 0; var8 < 6; ++var8)
        {
            double var9 = (double)((float)x + var5.nextFloat());
            double var11 = (double)((float)y + var5.nextFloat());
            double var13 = (double)((float)z + var5.nextFloat());

            if (var8 == 0 && !world.isBlockOpaqueCube(x, y + 1, z))
            {
                var11 = (double)(y + 1) + var6;
            }

            if (var8 == 1 && !world.isBlockOpaqueCube(x, y - 1, z))
            {
                var11 = (double)(y + 0) - var6;
            }

            if (var8 == 2 && !world.isBlockOpaqueCube(x, y, z + 1) && meta != 2)
            {
                var13 = (double)(z + 1) + var6;
            }

            if (var8 == 3 && !world.isBlockOpaqueCube(x, y, z - 1) && meta != 0)
            {
                var13 = (double)(z + 0) - var6;
            }

            if (var8 == 4 && !world.isBlockOpaqueCube(x + 1, y, z) && meta != 1)
            {
                var9 = (double)(x + 1) + var6;
            }

            if (var8 == 5 && !world.isBlockOpaqueCube(x - 1, y, z) && meta != 3)
            {
                var9 = (double)(x + 0) - var6;
            }

            if (var9 < (double)x || var9 > (double)(x + 1) || var11 < 0.0D || var11 > (double)(y + 1) || var13 < (double)z || var13 > (double)(z + 1))
            {
                if(tet.owner.equals("xana"))
                {
                    LyokoParticleEffects.spawnParticle("xana", var9, var11, var13, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("lyoko"))
                {
                    LyokoParticleEffects.spawnParticle("lyoko", var9, var11, var13, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("none"))
                {
                    LyokoParticleEffects.spawnParticle("deactivated", var9, var11, var13, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("developer"))
                {
                    LyokoParticleEffects.spawnParticle("dev", var9, var11, var13, 0.0D, 0.0D, 0.0D);<commit_msg>re-named variables<commit_after>package matt.lyoko.blocks;

import java.util.Random;

import matt.lyoko.CodeLyoko;
import matt.lyoko.entities.tileentity.TileEntityTower;
import matt.lyoko.items.ModItems;
import matt.lyoko.particles.LyokoParticleEffects;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockTower extends BlockContainer
{
    public BlockTower(int par1)
    {
        super(par1, Material.iron);
        this.setCreativeTab(CodeLyoko.LyokoTabs);
    }
    
    Icon inside;
    
    @Override
    public void registerIcons(IconRegister par1IconRegister)
    {
        this.blockIcon = par1IconRegister.registerIcon("lyoko:tower");
        inside = par1IconRegister.registerIcon("lyoko:blank");
    }

    @Override
    public TileEntity createNewTileEntity(World var1) {
        return new TileEntityTower();
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public Icon getIcon(int side, int meta)
    {
    	if(side == 2 && meta == 0)
    	{
    		return inside;
    	}
    	else if(side == 3 && meta == 2)
    	{
    		return inside;
    	}
    	else if(side == 4 && meta == 3)
    	{
    		return inside;
    	}
    	else if(side == 5 && meta == 1)
    	{
    		return inside;
    	}
    	return this.blockIcon;
    }

    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
    {
		TileEntityTower tet = (TileEntityTower) world.getBlockTileEntity(x, y, z);

		if(!world.isRemote)
		{
			if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.LaserArrow)
			{
				tet.owner = "reset";
				world.markBlockForUpdate(x, y, z);
				return true;
			}
		}
		return false;
    }

    @SideOnly(Side.CLIENT)
    public void randomDisplayTick(World world, int x, int y, int z, Random random)
    {
        TileEntityTower tet = (TileEntityTower) world.getBlockTileEntity(x, y, z);
        
        int meta = world.getBlockMetadata(x, y, z);
        
        Random worldRand = world.rand;
        // 1/16th of a block
        double pixelWidth = 0.0625D;

        for (int side = 0; side < 6; ++side)
        {
            double x2 = (double)((float)x + worldRand.nextFloat());
            double y2 = (double)((float)y + worldRand.nextFloat());
            double z2 = (double)((float)z + worldRand.nextFloat());

            if (side == 0 && !world.isBlockOpaqueCube(x, y + 1, z))
            {
                y2 = (double)(y + 1) + pixelWidth;
            }

            if (side == 1 && !world.isBlockOpaqueCube(x, y - 1, z))
            {
                y2 = (double)(y + 0) - pixelWidth;
            }

            if (side == 2 && !world.isBlockOpaqueCube(x, y, z + 1) && meta != 2)
            {
                z2 = (double)(z + 1) + pixelWidth;
            }

            if (side == 3 && !world.isBlockOpaqueCube(x, y, z - 1) && meta != 0)
            {
                z2 = (double)(z + 0) - pixelWidth;
            }

            if (side == 4 && !world.isBlockOpaqueCube(x + 1, y, z) && meta != 1)
            {
                x2 = (double)(x + 1) + pixelWidth;
            }

            if (side == 5 && !world.isBlockOpaqueCube(x - 1, y, z) && meta != 3)
            {
                x2 = (double)(x + 0) - pixelWidth;
            }

            if (x2 < (double)x || x2 > (double)(x + 1) || y2 < 0.0D || y2 > (double)(y + 1) || z2 < (double)z || z2 > (double)(z + 1))
            {
                if(tet.owner.equals("xana"))
                {
                    LyokoParticleEffects.spawnParticle("xana", x2, y2, z2, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("lyoko"))
                {
                    LyokoParticleEffects.spawnParticle("lyoko", x2, y2, z2, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("none"))
                {
                    LyokoParticleEffects.spawnParticle("deactivated", x2, y2, z2, 0.0D, 0.0D, 0.0D);
                }
                else if(tet.owner.equals("developer"))
                {
                    LyokoParticleEffects.spawnParticle("dev", x2, y2, z2, 0.0D, 0.0D, 0.0D);
{'fraction_non_alphanumeric': 0.13337684943429068, 'fraction_numerical': 0.026871192341166233, 'mean_word_length': 1.964527571751048, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '3847479', 'n_tokens_mistral': 3305, 'n_tokens_neox': 3076, 'n_words': 638}