import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Random;
public class mod_DIDiamand extends BaseMod
{
public static int dIDiamandid = 3000;
public static int dIDiamandswordid = 3001;
public static int dIDiamandpickid = 3002;
public static int dIDiamandshovelid = 3003;
public static int dIDiamandaxeid = 3004;
public static int dIDiamandblockid = 101;
public static int dIDiamandhelmid = 3006;
public static int dIDiamandchestid = 3007;
public static int dIDiamandlegsid = 3008;
public static int dIDiamandbootsid = 3009;
public static int dIDiamandoreid = 100;
public static File file;
public static File file2;
private static boolean set = Set();
public static final qk dIDiamandore = new BlockDIDiamand(dIDiamandoreid, 0).c(8.0F).a(qk.h).a("dIDiamandIngot ore");
public static final qk dIDiamandblock = new BlockDIDiamand(dIDiamandblockid, 0).c(12.0F).b(200.0F).a(qk.h).a("dIDiamond block");
public static final ex dIDiamandIngot = new ex(dIDiamandid).a(14, 7).a("dIDiamandidIngot");
public static final ex dIDiamandpick = new aj(dIDiamandpickid, az.dIDiamand).a("dIDiamandpick");
public static final ex dIDiamandshovel = new rk(dIDiamandshovelid, az.dIDiamand).a("dIDiamandshovel");
public static final ex dIDiamandaxe = new ox(dIDiamandaxeid, az.dIDiamand).a("dIDiamandaxe");
public static final ex dIDiamandsword = new mm(dIDiamandswordid, az.dIDiamand).a("dIDiamandsword");
public static final ex dIDiamandhelm = new ri(dIDiamandhelmid, 4, ModLoader.AddArmor("dIDiamandarmor"), 0).a("dIDiamand Helm");
public static final ex dIDiamandchest = new ri(dIDiamandchestid, 4, ModLoader.AddArmor("dIDiamandarmor"), 1).a("dIDiamandIngot Chestplate");
public static final ex dIDiamandlegs = new ri(dIDiamandlegsid, 4, ModLoader.AddArmor("dIDiamandarmor"), 2).a("dIDiamand Platelegs");
public static final ex dIDiamandboots = new ri(dIDiamandbootsid, 4, ModLoader.AddArmor("dIDiamandarmor"), 3).a("dIDiamand Boots");
public static int dIDiamandoredrop = dIDiamandore.bk;
public static int dIDiamandblockdrop = dIDiamandblock.bk;
public String Version()
{
return "Beta 1.3_01";
}
private static boolean Set()
{
if (isWindows())
{
localObject = System.getenv("AppData");
file = new File((String)localObject + "\\.minecraft\\bin\\DIDiamandBlockIDs.properties");
file2 = new File((String)localObject + "\\.minecraft\\bin\\DIDiamandItem.properties");
} else if (isMac())
{
localObject = System.getProperty("user.home");
file = new File((String)localObject + "/library/application\\ support/minecraft/bin/DIDiamandBlockIDs.properties");
file2 = new File((String)localObject + "/library/application\\ support/minecraft/bin/DIDiamandItemIDs.properties");
} else if (isUnix())
{
localObject = System.getProperty("user.home");
file = new File((String)localObject + "/.minecraft/bin/DIDiamandBlockIDs.properties");
file2 = new File((String)localObject + "/.minecraft/bin/DIDiamandItemIDs.properties");
} else {
System.out.println("sorry, your operating system can't change the ids :/");
}
Object localObject = new SortedProperties();
SortedProperties localSortedProperties = new SortedProperties();
try {
((SortedProperties)localObject).load(new FileInputStream(file));
dIDiamandblockid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandblock").trim());
dIDiamandoreid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandore").trim());
}
catch (FileNotFoundException localFileNotFoundException1) {
System.out.println("couldn't find file");
try {
((SortedProperties)localObject).setProperty("DIDiamandblock", "101");
((SortedProperties)localObject).setProperty("DIDiamandore", "100");
String str1;
if (isWindows())
{
str1 = System.getenv("AppData");
((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "\\.minecraft\\bin\\DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
} else if (isMac())
{
str1 = System.getProperty("user.home");
((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "/library/application support/minecraft/bin/DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
} else if (isUnix())
{
str1 = System.getProperty("user.home");
((SortedProperties)localObject).store(new FileOutputStream(new File(str1 + "/.minecraft/bin/DIDiamandBlockIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
}
else {
System.out.println("sorry, your operating system can't change the ids :/");
}
try
{
((SortedProperties)localObject).load(new FileInputStream(file));
dIDiamandblockid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandblock").trim());
dIDiamandoreid = Integer.parseInt(((SortedProperties)localObject).getProperty("DIDiamandore").trim());
} catch (IOException localIOException5) {
localIOException5.printStackTrace();
}
}
catch (FileNotFoundException localFileNotFoundException3) {
localFileNotFoundException3.printStackTrace();
}
catch (IOException localIOException3) {
localIOException3.printStackTrace();
}
}
catch (IOException localIOException1) {
localIOException1.printStackTrace();
}
try
{
localSortedProperties.load(new FileInputStream(file2));
dIDiamandhelmid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandhelm").trim()) - 256;
dIDiamandchestid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandchest").trim()) - 256;
dIDiamandlegsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandlegs").trim()) - 256;
dIDiamandbootsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandboots").trim()) - 256;
dIDiamandswordid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandsword").trim()) - 256;
dIDiamandpickid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandpick").trim()) - 256;
dIDiamandshovelid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandshovel").trim()) - 256;
dIDiamandaxeid = Integer.parseInt(localSortedProperties.getProperty("dIDiamanddaxe").trim()) - 256;
dIDiamandid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandIngot").trim()) - 256;
} catch (FileNotFoundException localFileNotFoundException2) {
System.out.println("couldn't find file");
try
{
localSortedProperties.setProperty("dIDiamandpick", "3002");
localSortedProperties.setProperty("dIDiamandIngot", "3000");
localSortedProperties.setProperty("dIDiamandhelm", "3006");
localSortedProperties.setProperty("dIDiamandchest", "3007");
localSortedProperties.setProperty("dIDiamandlegs", "3008");
localSortedProperties.setProperty("dIDiamandboots", "3009");
localSortedProperties.setProperty("dIDiamandsword", "3001");
localSortedProperties.setProperty("dIDiamandaxe", "3004");
localSortedProperties.setProperty("dIDiamandshovel", "3003");
String str2;
if (isWindows())
{
str2 = System.getenv("AppData");
localSortedProperties.store(new FileOutputStream(new File(str2 + "\\.minecraft\\bin\\DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
} else if (isMac())
{
str2 = System.getProperty("user.home");
localSortedProperties.store(new FileOutputStream(new File(str2 + "/library/application support/minecraft/bin/DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
} else if (isUnix())
{
str2 = System.getProperty("user.home");
localSortedProperties.store(new FileOutputStream(new File(str2 + "/.minecraft/bin/DIDiamandItemIDs.properties")), "These are the default Block IDs, change them if there are any conflicts!");
} else {
System.out.println("sorry, your operating system can't change the ids :/");
}
try
{
localSortedProperties.load(new FileInputStream(file2));
dIDiamandhelmid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandhelm").trim()) - 256;
dIDiamandchestid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandchest").trim()) - 256;
dIDiamandlegsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandlegs").trim()) - 256;
dIDiamandbootsid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandboots").trim()) - 256;
dIDiamandswordid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandsword").trim()) - 256;
dIDiamandpickid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandpick").trim()) - 256;
dIDiamandshovelid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandshovel").trim()) - 256;
dIDiamandaxeid = Integer.parseInt(localSortedProperties.getProperty("dIDiamanddaxe").trim()) - 256;
dIDiamandid = Integer.parseInt(localSortedProperties.getProperty("dIDiamandIngot").trim()) - 256;
}
catch (IOException localIOException6) {
localIOException6.printStackTrace();
}
} catch (FileNotFoundException localFileNotFoundException4) {
localFileNotFoundException4.printStackTrace();
}
catch (IOException localIOException4) {
localIOException4.printStackTrace();
}
}
catch (IOException localIOException2) {
localIOException2.printStackTrace();
}
return true;
}
public void AddRecipes(fr paramfr)
{
paramfr.a(new gz(dIDiamandpick, 1), new Object[] { "###", " X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });
paramfr.a(new gz(dIDiamandshovel, 1), new Object[] { " # ", " X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });
paramfr.a(new gz(dIDiamandaxe, 1), new Object[] { "## ", "#X ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });
paramfr.a(new gz(dIDiamandsword, 1), new Object[] { "# ", " # ", " X ", Character.valueOf('#'), dIDiamandIngot, Character.valueOf('X'), ex.B });
paramfr.a(new gz(dIDiamandchest, 1), new Object[] { "# #", "###", "###", Character.valueOf('#'), dIDiamandIngot });
paramfr.a(new gz(dIDiamandboots, 1), new Object[] { "# #", "# #", Character.valueOf('#'), dIDiamandIngot });
paramfr.a(new gz(dIDiamandlegs, 1), new Object[] { "###", "# #", "# #", Character.valueOf('#'), dIDiamandIngot });
paramfr.a(new gz(dIDiamandhelm, 1), new Object[] { "###", "# #", Character.valueOf('#'), dIDiamandIngot });
}
public void GenerateSurface(dt paramdt, Random paramRandom, int paramInt1, int paramInt2)
{
for (int i = 0; i < 10; i++)
{
int j = paramInt1 + paramRandom.nextInt(16);
int k = paramRandom.nextInt(10);
int m = paramInt2 + paramRandom.nextInt(16);
new eb(dIDiamandore.bk, 1).a(paramdt, paramRandom, j, k, m);
}
}
public void GenerateNether(dt paramdt, Random paramRandom, int paramInt1, int paramInt2)
{
int i = paramRandom.nextInt(2) + 1;
for (int j = 0; j < i; j++)
{
int k = paramInt1 + paramRandom.nextInt(16);
int m = paramRandom.nextInt(64);
int n = paramInt2 + paramRandom.nextInt(16);
new eb(dIDiamandore.bk, 1).a(paramdt, paramRandom, k, m, n);
}
}
public static boolean isWindows()
{
String str = System.getProperty("os.name").toLowerCase();
return str.indexOf("win") >= 0;
}
public static boolean isMac() {
String str = System.getProperty("os.name").toLowerCase();
return str.indexOf("mac") >= 0;
}
public static boolean isUnix() {
String str = System.getProperty("os.name").toLowerCase();
return (str.indexOf("nix") >= 0) || (str.indexOf("nux") >= 0);
}
public mod_DIDiamand() {
ModLoader.RegisterBlock(dIDiamandblock);
ModLoader.RegisterBlock(dIDiamandore);
dIDiamandore.bj = ModLoader.addOverride("/terrain.png", "/Minerpack/dIDiamandOre.png");
dIDiamandblock.bj = ModLoader.addOverride("/terrain.png", "/Minerpack/dIDiamandblock.png");
dIDiamandpick.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandPick.png");
dIDiamandaxe.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandAxe.png");
dIDiamandshovel.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandShovel.png");
dIDiamandIngot.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandIngot.png");
dIDiamandsword.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandSword.png");
dIDiamandhelm.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandhelm.png");
dIDiamandchest.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandchest.png");
dIDiamandlegs.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandlegs.png");
dIDiamandboots.bf = ModLoader.addOverride("/gui/items.png", "/Minerpack/dIDiamandboots.png");
ModLoader.AddName(dIDiamandhelm, "DIDiamand Helm");
ModLoader.AddName(dIDiamandchest, "DIDiamand Chestplate");
ModLoader.AddName(dIDiamandlegs, "DIDiamand Platelegs");
ModLoader.AddName(dIDiamandboots, "DIDiamand Boots");
ModLoader.AddName(dIDiamandore, "DIDiamand Ore");
ModLoader.AddName(dIDiamandblock, "DIDiamand Block");
ModLoader.AddName(dIDiamandaxe, "DIDiamand Axe");
ModLoader.AddName(dIDiamandpick, "DIDiamand Pickaxe");
ModLoader.AddName(dIDiamandsword, "DIDiamand Sword");
ModLoader.AddName(dIDiamandIngot, "DIDiamand Ingot");
ModLoader.AddName(dIDiamandshovel, "DIDiamand Shovel");
ModLoader.AddSmelting(dIDiamandore.bk, new gz(dIDiamandIngot));
}
public static void main(String[] paramArrayOfString)
{
}
}