<commit_before>package totemic_commons.pokefenn.tileentity.music;

import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import totemic_commons.pokefenn.ModBlocks;
import totemic_commons.pokefenn.api.music.MusicEnum;
import totemic_commons.pokefenn.block.music.BlockDrum;
import totemic_commons.pokefenn.block.music.BlockWindChime;
import totemic_commons.pokefenn.tileentity.TileTotemic;
import totemic_commons.pokefenn.util.TotemUtil;

import java.util.Random;

/**
 * Created by Pokefenn.
 * Licensed under MIT (If this is one of my Mods)
 */
public class TileWindChime extends TileTotemic
{
    public boolean isPlaying;
    public int currentTime;

    public TileWindChime()
    {
        isPlaying = false;
        currentTime = 0;
    }

    public void updateEntity()
    {
        super.updateEntity();

        World world = worldObj;

        if(!world.isRemote)
        {
            Random rand = new Random();

            if(world.getWorldTime() % 40L == 0)
            {
                if(!world.isRemote)
                    if(world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileWindChime)
                    {
                        if(!world.isAirBlock(xCoord, yCoord - 1, zCoord) && world.isAirBlock(xCoord, yCoord + 1, zCoord))
                        {
                            world.setBlockToAir(xCoord, yCoord, zCoord);
                            EntityItem entityItem = new EntityItem(world, xCoord, yCoord, zCoord, new ItemStack(ModBlocks.windChime, 1, 0));

                            world.spawnEntityInWorld(entityItem);
                        }
                    }
            }

            if(isPlaying)
            {
                currentTime++;
                if(world.getWorldTime() % 40L == 0)
                    if(rand.nextInt(2) == 1)
                    {
                        BlockWindChime thisBlock = (BlockWindChime) world.getBlock(xCoord, yCoord, zCoord);
                        TotemUtil.playMusicForCeremony(this, MusicEnum.WIND_CHIME_MUSIC, thisBlock.getRange(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null), thisBlock.getMaximumMusic(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null), thisBlock.getMusicOutput(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null));
                        MinecraftServer.getServer().worldServerForDimension(world.provider.dimensionId).func_147487_a("note", (double) xCoord + 0.5D, (double) yCoord + 1.2D, (double) zCoord + 0.5D, 2, 0.0D, 0.0D, 0.0D, 0.0D);
                    }
            }

            //This is for how long it can play
            if(currentTime >= 20 * 12)
            {
                isPlaying = false;
                currentTime = 0;
            }

            if(world.getWorldTime() % 80L == 0)
                if(rand.nextInt(12 * 8) == 1)
                {
                    //this makes all nearby chimes play
                    isPlaying = true;

                    int radius = 4;

                    for(int i = -radius; i <= radius; i++)
                        for(int j = -radius; j <= radius; j++)
                            for(int k = -radius; k <= radius; k++)
                                if(world.getBlock(xCoord + i, yCoord + j, zCoord + k) != null)
                                {
                                    if(world.getBlock(xCoord + i, yCoord + j, zCoord + k) == ModBlocks.windChime)
                                    {
                                        TileWindChime tileWindChime = (TileWindChime) world.getTileEntity(xCoord + i, yCoord + j, zCoord + k);

                                        tileWindChime.isPlaying = true;
                                    }
                                }
                }
        }
    }

    @Override
    public Packet getDescriptionPacket()
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        this.writeToNBT(nbttagcompound);
        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
    }

    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
    {
        readFromNBT(pkt.func_148857_g());
    }

    @Override
    public void writeToNBT(NBTTagCompound nbtTagCompound)
    {
        super.writeToNBT(nbtTagCompound);
        nbtTagCompound.setInteger("currentTime", currentTime);
        nbtTagCompound.setBoolean("isPlaying", isPlaying);
    }

    @Override
    public void readFromNBT(NBTTagCompound nbtTagCompound)
    {
        super.readFromNBT(nbtTagCompound);
        currentTime = nbtTagCompound.getInteger("currentTime");
        isPlaying = nbtTagCompound.getBoolean("isPlaying");
    }
}
<commit_msg>Changed the number, this will be a pain...<commit_after>package totemic_commons.pokefenn.tileentity.music;

import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import totemic_commons.pokefenn.ModBlocks;
import totemic_commons.pokefenn.api.music.MusicEnum;
import totemic_commons.pokefenn.block.music.BlockDrum;
import totemic_commons.pokefenn.block.music.BlockWindChime;
import totemic_commons.pokefenn.tileentity.TileTotemic;
import totemic_commons.pokefenn.util.TotemUtil;

import java.util.Random;

/**
 * Created by Pokefenn.
 * Licensed under MIT (If this is one of my Mods)
 */
public class TileWindChime extends TileTotemic
{
    public boolean isPlaying;
    public int currentTime;

    public TileWindChime()
    {
        isPlaying = false;
        currentTime = 0;
    }

    public void updateEntity()
    {
        super.updateEntity();

        World world = worldObj;

        if(!world.isRemote)
        {
            Random rand = new Random();

            if(world.getWorldTime() % 40L == 0)
            {
                if(!world.isRemote)
                    if(world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileWindChime)
                    {
                        if(!world.isAirBlock(xCoord, yCoord - 1, zCoord) && world.isAirBlock(xCoord, yCoord + 1, zCoord))
                        {
                            world.setBlockToAir(xCoord, yCoord, zCoord);
                            EntityItem entityItem = new EntityItem(world, xCoord, yCoord, zCoord, new ItemStack(ModBlocks.windChime, 1, 0));

                            world.spawnEntityInWorld(entityItem);
                        }
                    }
            }

            if(isPlaying)
            {
                currentTime++;
                if(world.getWorldTime() % 40L == 0)
                    if(rand.nextInt(2) == 1)
                    {
                        BlockWindChime thisBlock = (BlockWindChime) world.getBlock(xCoord, yCoord, zCoord);
                        TotemUtil.playMusicForCeremony(this, MusicEnum.WIND_CHIME_MUSIC, thisBlock.getRange(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null), thisBlock.getMaximumMusic(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null), thisBlock.getMusicOutput(world, xCoord, yCoord, zCoord, false, (EntityPlayer) null));
                        MinecraftServer.getServer().worldServerForDimension(world.provider.dimensionId).func_147487_a("note", (double) xCoord + 0.5D, (double) yCoord + 1.2D, (double) zCoord + 0.5D, 2, 0.0D, 0.0D, 0.0D, 0.0D);
                    }
            }

            //This is for how long it can play
            if(currentTime >= 20 * 12)
            {
                isPlaying = false;
                currentTime = 0;
            }

            if(world.getWorldTime() % 30L == 0)
                if(rand.nextInt(30) == 1)
                {
                    //this makes all nearby chimes play
                    isPlaying = true;

                    int radius = 4;

                    for(int i = -radius; i <= radius; i++)
                        for(int j = -radius; j <= radius; j++)
                            for(int k = -radius; k <= radius; k++)
                                if(world.getBlock(xCoord + i, yCoord + j, zCoord + k) != null)
                                {
                                    if(world.getBlock(xCoord + i, yCoord + j, zCoord + k) == ModBlocks.windChime)
                                    {
                                        TileWindChime tileWindChime = (TileWindChime) world.getTileEntity(xCoord + i, yCoord + j, zCoord + k);

                                        tileWindChime.isPlaying = true;
                                    }
                                }
                }
        }
    }

    @Override
    public Packet getDescriptionPacket()
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        this.writeToNBT(nbttagcompound);
        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
    }

    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
    {
        readFromNBT(pkt.func_148857_g());
    }

    @Override
    public void writeToNBT(NBTTagCompound nbtTagCompound)
    {
        super.writeToNBT(nbtTagCompound);
        nbtTagCompound.setInteger("currentTime", currentTime);
        nbtTagCompound.setBoolean("isPlaying", isPlaying);
    }

    @Override
    public void readFromNBT(NBTTagCompound nbtTagCompound)
    {
        super.readFromNBT(nbtTagCompound);
        currentTime = nbtTagCompound.getInteger("currentTime");
        isPlaying = nbtTagCompound.getBoolean("isPlaying");
    }
}

{'fraction_non_alphanumeric': 0.09618230245634803, 'fraction_numerical': 0.011739173325441452, 'mean_word_length': 1.8533633549113426, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2895043', 'n_tokens_mistral': 3109, 'n_tokens_neox': 2895, 'n_words': 566}