    001package net.minecraft.util;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.util.Random;
    006
    007@SideOnly(Side.CLIENT)
    008public class EnchantmentNameParts
    009{
    010    /** The static instance of this class. */
    011    public static final EnchantmentNameParts instance = new EnchantmentNameParts();
    012
    013    /** The RNG used to generate enchant names. */
    014    private Random rand = new Random();
    015
    016    /** List of words used to generate an enchant name. */
    017    private String[] wordList = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" ");
    018
    019    /**
    020     * Generates a random enchant name.
    021     */
    022    public String generateRandomEnchantName()
    023    {
    024        int i = this.rand.nextInt(2) + 3;
    025        String s = "";
    026
    027        for (int j = 0; j < i; ++j)
    028        {
    029            if (j > 0)
    030            {
    031                s = s + " ";
    032            }
    033
    034            s = s + this.wordList[this.rand.nextInt(this.wordList.length)];
    035        }
    036
    037        return s;
    038    }
    039
    040    /**
    041     * Sets the seed for the enchant name RNG.
    042     */
    043    public void setRandSeed(long par1)
    044    {
    045        this.rand.setSeed(par1);
    046    }
    047}