001 package net.minecraft.util; 002 003 import cpw.mods.fml.relauncher.Side; 004 import cpw.mods.fml.relauncher.SideOnly; 005 import java.util.Random; 006 007 @SideOnly(Side.CLIENT) 008 public 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 var1 = this.rand.nextInt(2) + 3; 025 String var2 = ""; 026 027 for (int var3 = 0; var3 < var1; ++var3) 028 { 029 if (var3 > 0) 030 { 031 var2 = var2 + " "; 032 } 033 034 var2 = var2 + this.wordList[this.rand.nextInt(this.wordList.length)]; 035 } 036 037 return var2; 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 }