Rename ObsidianIngots-ObsidianIngotsCore, clean up code.
This commit is contained in:
parent
954e3dee55
commit
f6a8a49785
38 changed files with 103 additions and 160 deletions
|
@ -12,20 +12,20 @@ public class BlockBase extends Block
|
|||
{
|
||||
super(i, j, Material.iron);
|
||||
|
||||
if(blockID == ObsidianIngots.platinumOreID)
|
||||
if(blockID == ObsidianIngotsCore.platinumOreID)
|
||||
{
|
||||
setHardness(3F);
|
||||
setResistance(5F);
|
||||
}
|
||||
if(blockID == ObsidianIngots.refinedGlowstoneID || blockID == ObsidianIngots.refinedObsidianID || blockID == ObsidianIngots.coalBlockID || blockID == ObsidianIngots.redstoneBlockID || blockID == ObsidianIngots.platinumBlockID)
|
||||
if(blockID == ObsidianIngotsCore.refinedGlowstoneID || blockID == ObsidianIngotsCore.refinedObsidianID || blockID == ObsidianIngotsCore.coalBlockID || blockID == ObsidianIngotsCore.redstoneBlockID || blockID == ObsidianIngotsCore.platinumBlockID)
|
||||
{
|
||||
setHardness(5F);
|
||||
setResistance(10F);
|
||||
if(blockID == ObsidianIngots.refinedObsidianID)
|
||||
if(blockID == ObsidianIngotsCore.refinedObsidianID)
|
||||
{
|
||||
setLightValue(0.5F);
|
||||
}
|
||||
if(blockID == ObsidianIngots.refinedGlowstoneID)
|
||||
if(blockID == ObsidianIngotsCore.refinedGlowstoneID)
|
||||
{
|
||||
setLightValue(0.875F);
|
||||
}
|
||||
|
@ -44,11 +44,11 @@ public class BlockBase extends Block
|
|||
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
|
||||
{
|
||||
if(blockID == ObsidianIngots.refinedObsidianID)
|
||||
if(blockID == ObsidianIngotsCore.refinedObsidianID)
|
||||
{
|
||||
if(entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 19, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 19, world, x, y, z);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -56,7 +56,7 @@ public class BlockBase extends Block
|
|||
|
||||
public void addCreativeItems(ArrayList itemList)
|
||||
{
|
||||
if(blockID != ObsidianIngots.platinumOreID)
|
||||
if(blockID != ObsidianIngotsCore.platinumOreID)
|
||||
{
|
||||
itemList.add(new ItemStack(this));
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ public class BlockCombiner extends BlockContainer
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 23, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 23, world, x, y, z);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
|
|
@ -169,7 +169,7 @@ public class BlockCrusher extends BlockContainer
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 24, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 24, world, x, y, z);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
|
|
@ -172,7 +172,7 @@ public class BlockEnrichmentChamber extends BlockContainer
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 21, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 21, world, x, y, z);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
|
|
@ -91,7 +91,7 @@ public class BlockObsidianTNT extends Block
|
|||
{
|
||||
if ((par5 & 1) == 0)
|
||||
{
|
||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(ObsidianIngots.ObsidianTNT, 1, 0));
|
||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(ObsidianIngotsCore.ObsidianTNT, 1, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -182,7 +182,7 @@ public class BlockPlatinumCompressor extends BlockContainer
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 22, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 22, world, x, y, z);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
|
|
@ -225,7 +225,7 @@ public class BlockTheoreticalElementizer extends BlockContainer
|
|||
{
|
||||
if(!entityplayer.isSneaking())
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 25, world, x, y, z);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 25, world, x, y, z);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
|
|
@ -24,10 +24,10 @@ public class CombinerRecipes
|
|||
private CombinerRecipes()
|
||||
{
|
||||
addSmelting(Item.redstone.shiftedIndex, new ItemStack(Block.oreRedstone, 1));
|
||||
addSmelting(ObsidianIngots.ObsidianDust.shiftedIndex, new ItemStack(Block.obsidian, 1));
|
||||
addSmelting(ObsidianIngots.IronDust.shiftedIndex, new ItemStack(Block.oreIron, 1));
|
||||
addSmelting(ObsidianIngots.GoldDust.shiftedIndex, new ItemStack(Block.oreGold, 1));
|
||||
addSmelting(ObsidianIngots.PlatinumDust.shiftedIndex, new ItemStack(ObsidianIngots.PlatinumOre, 1));
|
||||
addSmelting(ObsidianIngotsCore.ObsidianDust.shiftedIndex, new ItemStack(Block.obsidian, 1));
|
||||
addSmelting(ObsidianIngotsCore.IronDust.shiftedIndex, new ItemStack(Block.oreIron, 1));
|
||||
addSmelting(ObsidianIngotsCore.GoldDust.shiftedIndex, new ItemStack(Block.oreGold, 1));
|
||||
addSmelting(ObsidianIngotsCore.PlatinumDust.shiftedIndex, new ItemStack(ObsidianIngotsCore.PlatinumOre, 1));
|
||||
addSmelting(Item.diamond.shiftedIndex, new ItemStack(Block.oreDiamond, 1));
|
||||
addSmelting(new ItemStack(Item.dyePowder, 1, 4).getItem().shiftedIndex, new ItemStack(Block.oreLapis, 1));
|
||||
}
|
||||
|
|
|
@ -7,10 +7,10 @@ import cpw.mods.fml.common.network.IGuiHandler;
|
|||
public class CommonGuiHandler implements IGuiHandler
|
||||
{
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return ObsidianIngots.proxy.getServerGui(ID, player, world, x, y, z);
|
||||
return ObsidianIngotsCore.proxy.getServerGui(ID, player, world, x, y, z);
|
||||
}
|
||||
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return ObsidianIngots.proxy.getClientGui(ID, player, world, x, y, z);
|
||||
return ObsidianIngotsCore.proxy.getClientGui(ID, player, world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,25 +36,25 @@ public abstract class CommonProxy
|
|||
if(config.exists())
|
||||
{
|
||||
properties.load(new FileInputStream(config));
|
||||
ObsidianIngots.platinumOreID = Integer.parseInt(properties.getProperty("platinumOreID"));
|
||||
ObsidianIngots.platinumBlockID = Integer.parseInt(properties.getProperty("platinumBlockID"));
|
||||
ObsidianIngots.redstoneBlockID = Integer.parseInt(properties.getProperty("redstoneBlockID"));
|
||||
ObsidianIngots.obsidianTNTID = Integer.parseInt(properties.getProperty("obsidianTNTID"));
|
||||
ObsidianIngots.refinedObsidianID = Integer.parseInt(properties.getProperty("refinedObsidianID"));
|
||||
ObsidianIngots.elementizerID = Integer.parseInt(properties.getProperty("elementizerID"));
|
||||
ObsidianIngots.enrichmentChamberID = Integer.parseInt(properties.getProperty("enrichmentChamberID"));
|
||||
ObsidianIngots.platinumCompressorID = Integer.parseInt(properties.getProperty("platinumCompressorID"));
|
||||
ObsidianIngots.combinerID = Integer.parseInt(properties.getProperty("combinerID"));
|
||||
ObsidianIngots.crusherID = Integer.parseInt(properties.getProperty("crusherID"));
|
||||
ObsidianIngots.coalBlockID = Integer.parseInt(properties.getProperty("coalBlockID"));
|
||||
ObsidianIngots.refinedGlowstoneID = Integer.parseInt(properties.getProperty("refinedGlowstoneID"));
|
||||
ObsidianIngots.extrasEnabled = Boolean.parseBoolean(properties.getProperty("extrasEnabled"));
|
||||
ObsidianIngots.oreGenerationEnabled = Boolean.parseBoolean(properties.getProperty("oreGenerationEnabled"));
|
||||
ObsidianIngots.logger.info("[ObsidianIngots] Data loaded.");
|
||||
ObsidianIngotsCore.platinumOreID = Integer.parseInt(properties.getProperty("platinumOreID"));
|
||||
ObsidianIngotsCore.platinumBlockID = Integer.parseInt(properties.getProperty("platinumBlockID"));
|
||||
ObsidianIngotsCore.redstoneBlockID = Integer.parseInt(properties.getProperty("redstoneBlockID"));
|
||||
ObsidianIngotsCore.obsidianTNTID = Integer.parseInt(properties.getProperty("obsidianTNTID"));
|
||||
ObsidianIngotsCore.refinedObsidianID = Integer.parseInt(properties.getProperty("refinedObsidianID"));
|
||||
ObsidianIngotsCore.elementizerID = Integer.parseInt(properties.getProperty("elementizerID"));
|
||||
ObsidianIngotsCore.enrichmentChamberID = Integer.parseInt(properties.getProperty("enrichmentChamberID"));
|
||||
ObsidianIngotsCore.platinumCompressorID = Integer.parseInt(properties.getProperty("platinumCompressorID"));
|
||||
ObsidianIngotsCore.combinerID = Integer.parseInt(properties.getProperty("combinerID"));
|
||||
ObsidianIngotsCore.crusherID = Integer.parseInt(properties.getProperty("crusherID"));
|
||||
ObsidianIngotsCore.coalBlockID = Integer.parseInt(properties.getProperty("coalBlockID"));
|
||||
ObsidianIngotsCore.refinedGlowstoneID = Integer.parseInt(properties.getProperty("refinedGlowstoneID"));
|
||||
ObsidianIngotsCore.extrasEnabled = Boolean.parseBoolean(properties.getProperty("extrasEnabled"));
|
||||
ObsidianIngotsCore.oreGenerationEnabled = Boolean.parseBoolean(properties.getProperty("oreGenerationEnabled"));
|
||||
ObsidianIngotsCore.logger.info("[ObsidianIngots] Data loaded.");
|
||||
}
|
||||
else {
|
||||
config.createNewFile();
|
||||
ObsidianIngots.logger.info("[ObsidianIngots] Created 'ObsidianIngots.txt' configuration file.");
|
||||
ObsidianIngotsCore.logger.info("[ObsidianIngots] Created 'ObsidianIngots.txt' configuration file.");
|
||||
FileOutputStream fileoutputstream = new FileOutputStream(config);
|
||||
properties.setProperty("platinumOreID", Integer.toString(200));
|
||||
properties.setProperty("platinumBlockID", Integer.toString(201));
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerCombiner extends Container
|
|||
this.combiner = par2TileEntityCombiner;
|
||||
this.addSlotToContainer(new Slot(par2TileEntityCombiner, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(par2TileEntityCombiner, 1, 56, 53));
|
||||
this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityCombiner, 2, 116, 35));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityCombiner, 2, 116, 35));
|
||||
int var3;
|
||||
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerCrusher extends Container
|
|||
this.crusher = par2TileEntityCrusher;
|
||||
this.addSlotToContainer(new Slot(par2TileEntityCrusher, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(par2TileEntityCrusher, 1, 56, 53));
|
||||
this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityCrusher, 2, 116, 35));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityCrusher, 2, 116, 35));
|
||||
int var3;
|
||||
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerEnrichmentChamber extends Container
|
|||
this.chamber = par2TileEntityEnrichmentChamber;
|
||||
this.addSlotToContainer(new Slot(par2TileEntityEnrichmentChamber, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(par2TileEntityEnrichmentChamber, 1, 56, 53));
|
||||
this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityEnrichmentChamber, 2, 116, 35));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityEnrichmentChamber, 2, 116, 35));
|
||||
int var3;
|
||||
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerPlatinumCompressor extends Container
|
|||
this.compressor = par2TileEntityPlatinumCompressor;
|
||||
this.addSlotToContainer(new Slot(par2TileEntityPlatinumCompressor, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(par2TileEntityPlatinumCompressor, 1, 56, 53));
|
||||
this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityPlatinumCompressor, 2, 116, 35));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityPlatinumCompressor, 2, 116, 35));
|
||||
int var3;
|
||||
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerTheoreticalElementizer extends Container
|
|||
this.elementizer = par2TileEntityTheoreticalElementizer;
|
||||
this.addSlotToContainer(new Slot(par2TileEntityTheoreticalElementizer, 0, 56, 17));
|
||||
this.addSlotToContainer(new Slot(par2TileEntityTheoreticalElementizer, 1, 56, 53));
|
||||
this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityTheoreticalElementizer, 2, 116, 35));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityTheoreticalElementizer, 2, 116, 35));
|
||||
int var3;
|
||||
|
||||
for (var3 = 0; var3 < 3; ++var3)
|
||||
|
@ -110,7 +110,7 @@ public class ContainerTheoreticalElementizer extends Container
|
|||
}
|
||||
else if (par1 != 1 && par1 != 0)
|
||||
{
|
||||
if (var4.getItem().shiftedIndex == ObsidianIngots.EnrichedAlloy.shiftedIndex)
|
||||
if (var4.getItem().shiftedIndex == ObsidianIngotsCore.EnrichedAlloy.shiftedIndex)
|
||||
{
|
||||
if (!this.mergeItemStack(var4, 0, 1, false))
|
||||
{
|
||||
|
|
|
@ -23,11 +23,11 @@ public class CrusherRecipes
|
|||
|
||||
private CrusherRecipes()
|
||||
{
|
||||
addSmelting(ObsidianIngots.RedstoneIngot.shiftedIndex, new ItemStack(Item.redstone, 1));
|
||||
addSmelting(Item.ingotIron.shiftedIndex, new ItemStack(ObsidianIngots.IronDust, 1));
|
||||
addSmelting(Item.ingotGold.shiftedIndex, new ItemStack(ObsidianIngots.GoldDust, 1));
|
||||
addSmelting(ObsidianIngots.PlatinumIngot.shiftedIndex, new ItemStack(ObsidianIngots.PlatinumDust, 1));
|
||||
addSmelting(ObsidianIngots.GlowstoneIngot.shiftedIndex, new ItemStack(Item.lightStoneDust));
|
||||
addSmelting(ObsidianIngotsCore.RedstoneIngot.shiftedIndex, new ItemStack(Item.redstone, 1));
|
||||
addSmelting(Item.ingotIron.shiftedIndex, new ItemStack(ObsidianIngotsCore.IronDust, 1));
|
||||
addSmelting(Item.ingotGold.shiftedIndex, new ItemStack(ObsidianIngotsCore.GoldDust, 1));
|
||||
addSmelting(ObsidianIngotsCore.PlatinumIngot.shiftedIndex, new ItemStack(ObsidianIngotsCore.PlatinumDust, 1));
|
||||
addSmelting(ObsidianIngotsCore.GlowstoneIngot.shiftedIndex, new ItemStack(Item.lightStoneDust));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,10 +23,10 @@ public class EnrichmentChamberRecipes
|
|||
|
||||
private EnrichmentChamberRecipes()
|
||||
{
|
||||
addSmelting(Block.obsidian.blockID, new ItemStack(ObsidianIngots.ObsidianDust, 1));
|
||||
addSmelting(Block.oreIron.blockID, new ItemStack(ObsidianIngots.IronDust, 1));
|
||||
addSmelting(Block.oreGold.blockID, new ItemStack(ObsidianIngots.GoldDust, 1));
|
||||
addSmelting(ObsidianIngots.platinumOreID, new ItemStack(ObsidianIngots.PlatinumDust, 1));
|
||||
addSmelting(Block.obsidian.blockID, new ItemStack(ObsidianIngotsCore.ObsidianDust, 1));
|
||||
addSmelting(Block.oreIron.blockID, new ItemStack(ObsidianIngotsCore.IronDust, 1));
|
||||
addSmelting(Block.oreGold.blockID, new ItemStack(ObsidianIngotsCore.GoldDust, 1));
|
||||
addSmelting(ObsidianIngotsCore.platinumOreID, new ItemStack(ObsidianIngotsCore.PlatinumDust, 1));
|
||||
addSmelting(Block.oreRedstone.blockID, new ItemStack(Item.redstone));
|
||||
}
|
||||
|
||||
|
|
|
@ -458,7 +458,7 @@ public class EntityObsidianArrow extends Entity
|
|||
{
|
||||
boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode;
|
||||
|
||||
if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngots.ObsidianArrow, 1)))
|
||||
if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngotsCore.ObsidianArrow, 1)))
|
||||
{
|
||||
var2 = false;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class EntityObsidianTNT extends Entity
|
|||
motionX = (double)(-((float)Math.sin((double)var8)) * 0.02F);
|
||||
motionY = 0.20000000298023224D;
|
||||
motionZ = (double)(-((float)Math.cos((double)var8)) * 0.02F);
|
||||
fuse = ObsidianIngots.ObsidianTNTDelay;
|
||||
fuse = ObsidianIngotsCore.ObsidianTNTDelay;
|
||||
prevPosX = par2;
|
||||
prevPosY = par4;
|
||||
prevPosZ = par6;
|
||||
|
@ -97,7 +97,7 @@ public class EntityObsidianTNT extends Entity
|
|||
|
||||
private void explode()
|
||||
{
|
||||
worldObj.createExplosion((Entity)null, posX, posY, posZ, ObsidianIngots.ObsidianTNTBlastRadius);
|
||||
worldObj.createExplosion((Entity)null, posX, posY, posZ, ObsidianIngotsCore.ObsidianTNTBlastRadius);
|
||||
hasExploded = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public class ItemObsidianBow extends ItemObsidian
|
|||
{
|
||||
boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
|
||||
|
||||
if (flag || par3EntityPlayer.inventory.hasItem(ObsidianIngots.ObsidianArrow.shiftedIndex))
|
||||
if (flag || par3EntityPlayer.inventory.hasItem(ObsidianIngotsCore.ObsidianArrow.shiftedIndex))
|
||||
{
|
||||
int i = getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
float f = (float)i / 20F;
|
||||
|
@ -71,7 +71,7 @@ public class ItemObsidianBow extends ItemObsidian
|
|||
}
|
||||
else
|
||||
{
|
||||
par3EntityPlayer.inventory.consumeInventoryItem(ObsidianIngots.ObsidianArrow.shiftedIndex);
|
||||
par3EntityPlayer.inventory.consumeInventoryItem(ObsidianIngotsCore.ObsidianArrow.shiftedIndex);
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
|
@ -107,7 +107,7 @@ public class ItemObsidianBow extends ItemObsidian
|
|||
*/
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(ObsidianIngots.ObsidianArrow.shiftedIndex))
|
||||
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(ObsidianIngotsCore.ObsidianArrow.shiftedIndex))
|
||||
{
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ItemStopwatch extends ItemObsidian {
|
|||
{
|
||||
if(itemstack.getItemDamage() == 0)
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 18, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 18, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ItemWeatherOrb extends ItemObsidian
|
|||
{
|
||||
if(itemstack.getItemDamage() == 0)
|
||||
{
|
||||
entityplayer.openGui(ObsidianIngots.instance, 20, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
|
||||
entityplayer.openGui(ObsidianIngotsCore.instance, 20, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import cpw.mods.fml.common.registry.TickRegistry;
|
|||
*/
|
||||
@Mod(modid = "ObsidianIngots", name = "Obsidian Ingots", version = "4.0.3")
|
||||
@NetworkMod(channels = { "ObsidianIngots" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
||||
public class ObsidianIngots
|
||||
public class ObsidianIngotsCore
|
||||
{
|
||||
/** Obsidian Ingots logger instance */
|
||||
public static Logger logger = Logger.getLogger("Minecraft");
|
||||
|
@ -44,7 +44,7 @@ public class ObsidianIngots
|
|||
|
||||
/** Obsidian Ingots mod instance */
|
||||
@Instance
|
||||
public static ObsidianIngots instance;
|
||||
public static ObsidianIngotsCore instance;
|
||||
|
||||
/** Obsidian Ingots hooks instance */
|
||||
public static ObsidianHooks hooks;
|
|
@ -32,9 +32,9 @@ public class ObsidianUtils
|
|||
*/
|
||||
public static void checkForUpdates(EntityPlayer entityplayer)
|
||||
{
|
||||
if(!(getLatestVersion().toString().equals("Error retrieving data.")) && !(getLatestVersion().toString().equals(ObsidianIngots.versionNumber.toString())))
|
||||
if(!(getLatestVersion().toString().equals("Error retrieving data.")) && !(getLatestVersion().toString().equals(ObsidianIngotsCore.versionNumber.toString())))
|
||||
{
|
||||
entityplayer.addChatMessage("Your version of ¤1Obsidian Ingots ¤7(¤8" + ObsidianIngots.versionNumber.toString() + "¤7) is outdated. Please update to version ¤8" + getLatestVersion().toString());
|
||||
entityplayer.addChatMessage("Your version of ¤1Obsidian Ingots ¤7(¤8" + ObsidianIngotsCore.versionNumber.toString() + "¤7) is outdated. Please update to version ¤8" + getLatestVersion().toString());
|
||||
}
|
||||
else if(getLatestVersion().toString().equals("Error retrieving data."))
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ public class ObsidianUtils
|
|||
*/
|
||||
public static boolean isClientLatestVersion()
|
||||
{
|
||||
if(ObsidianIngots.versionNumber.toString().equals(ObsidianIngots.latestVersionNumber))
|
||||
if(ObsidianIngotsCore.versionNumber.toString().equals(ObsidianIngotsCore.latestVersionNumber))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -11,14 +11,14 @@ public class OreHandler implements IWorldGenerator
|
|||
{
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
if(ObsidianIngots.oreGenerationEnabled == true)
|
||||
if(ObsidianIngotsCore.oreGenerationEnabled == true)
|
||||
{
|
||||
for (int i=0;i<1;i++)
|
||||
{
|
||||
int randPosX = chunkX + random.nextInt(16);
|
||||
int randPosY = random.nextInt(60);
|
||||
int randPosZ = chunkZ + random.nextInt(16);
|
||||
(new WorldGenMinable(ObsidianIngots.PlatinumOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
|
||||
(new WorldGenMinable(ObsidianIngotsCore.PlatinumOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@ public class PlatinumCompressorRecipes
|
|||
|
||||
private PlatinumCompressorRecipes()
|
||||
{
|
||||
addSmelting(Item.redstone.shiftedIndex, new ItemStack(ObsidianIngots.RedstoneIngot, 1));
|
||||
addSmelting(ObsidianIngots.ObsidianDust.shiftedIndex, new ItemStack(ObsidianIngots.ObsidianIngot, 1));
|
||||
addSmelting(ObsidianIngots.PlatinumDust.shiftedIndex, new ItemStack(ObsidianIngots.PlatinumIngot, 1));
|
||||
addSmelting(ObsidianIngots.IronDust.shiftedIndex, new ItemStack(Item.ingotIron, 1));
|
||||
addSmelting(ObsidianIngots.GoldDust.shiftedIndex, new ItemStack(Item.ingotGold, 1));
|
||||
addSmelting(Item.lightStoneDust.shiftedIndex, new ItemStack(ObsidianIngots.GlowstoneIngot, 1));
|
||||
addSmelting(Item.redstone.shiftedIndex, new ItemStack(ObsidianIngotsCore.RedstoneIngot, 1));
|
||||
addSmelting(ObsidianIngotsCore.ObsidianDust.shiftedIndex, new ItemStack(ObsidianIngotsCore.ObsidianIngot, 1));
|
||||
addSmelting(ObsidianIngotsCore.PlatinumDust.shiftedIndex, new ItemStack(ObsidianIngotsCore.PlatinumIngot, 1));
|
||||
addSmelting(ObsidianIngotsCore.IronDust.shiftedIndex, new ItemStack(Item.ingotIron, 1));
|
||||
addSmelting(ObsidianIngotsCore.GoldDust.shiftedIndex, new ItemStack(Item.ingotGold, 1));
|
||||
addSmelting(Item.lightStoneDust.shiftedIndex, new ItemStack(ObsidianIngotsCore.GlowstoneIngot, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
package net.uberkat.obsidian.common;
|
||||
|
||||
import net.minecraft.src.*;
|
||||
|
||||
public class SlotObsidian extends Slot
|
||||
{
|
||||
/** The player that is using the GUI where this slot resides. */
|
||||
private EntityPlayer thePlayer;
|
||||
private int field_75228_b;
|
||||
|
||||
public SlotObsidian(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5)
|
||||
{
|
||||
super(par2IInventory, par3, par4, par5);
|
||||
this.thePlayer = par1EntityPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
|
||||
*/
|
||||
public boolean isItemValid(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
|
||||
* stack.
|
||||
*/
|
||||
public ItemStack decrStackSize(int par1)
|
||||
{
|
||||
if (this.getHasStack())
|
||||
{
|
||||
this.field_75228_b += Math.min(par1, this.getStack().stackSize);
|
||||
}
|
||||
|
||||
return super.decrStackSize(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the player picks up an item from an inventory slot
|
||||
*/
|
||||
public void onPickupFromSlot(ItemStack par1ItemStack)
|
||||
{
|
||||
this.onCrafting(par1ItemStack);
|
||||
super.onPickupFromSlot(par1ItemStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
|
||||
* internal count then calls onCrafting(item).
|
||||
*/
|
||||
protected void onCrafting(ItemStack par1ItemStack, int par2)
|
||||
{
|
||||
field_75228_b += par2;
|
||||
onCrafting(par1ItemStack);
|
||||
}
|
||||
}
|
|
@ -108,7 +108,7 @@ public class TileEntityCombiner extends TileEntity implements IInventory, ISided
|
|||
*/
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.combiner";
|
||||
return "Combiner";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -108,7 +108,7 @@ public class TileEntityCrusher extends TileEntity implements IInventory, ISidedI
|
|||
*/
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.crusher";
|
||||
return "Crusher";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -337,8 +337,8 @@ public class TileEntityCrusher extends TileEntity implements IInventory, ISidedI
|
|||
{
|
||||
int var1 = par1ItemStack.getItem().shiftedIndex;
|
||||
if (var1 == Item.redstone.shiftedIndex) return 600;
|
||||
if (var1 == ObsidianIngots.RedstoneIngot.shiftedIndex)
|
||||
if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngots.RedstoneBlock.blockID) return 5400;
|
||||
if (var1 == ObsidianIngotsCore.RedstoneIngot.shiftedIndex)
|
||||
if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngotsCore.RedstoneBlock.blockID) return 5400;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class TileEntityEnrichmentChamber extends TileEntity implements IInventor
|
|||
*/
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.chamber";
|
||||
return "Enrichment Chamber";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ public class TileEntityPlatinumCompressor extends TileEntity implements IInvento
|
|||
*/
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.compressor";
|
||||
return "Platinum Compressor";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -338,8 +338,8 @@ public class TileEntityPlatinumCompressor extends TileEntity implements IInvento
|
|||
else
|
||||
{
|
||||
int var1 = par1ItemStack.getItem().shiftedIndex;
|
||||
if (var1 == ObsidianIngots.PlatinumIngot.shiftedIndex) return 200;
|
||||
if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngots.PlatinumBlock.blockID) return 1800;
|
||||
if (var1 == ObsidianIngotsCore.PlatinumIngot.shiftedIndex) return 200;
|
||||
if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngotsCore.PlatinumBlock.blockID) return 1800;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class TileEntityTheoreticalElementizer extends TileEntity implements IInv
|
|||
*/
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.elementizer";
|
||||
return "Theoretical Elementizer";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,7 +286,7 @@ public class TileEntityTheoreticalElementizer extends TileEntity implements IInv
|
|||
}
|
||||
else
|
||||
{
|
||||
if (machineItemStacks[0].getItem().shiftedIndex != ObsidianIngots.EnrichedAlloy.shiftedIndex) return false;
|
||||
if (machineItemStacks[0].getItem().shiftedIndex != ObsidianIngotsCore.EnrichedAlloy.shiftedIndex) return false;
|
||||
if (this.machineItemStacks[2] == null) return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -353,10 +353,10 @@ public class TileEntityTheoreticalElementizer extends TileEntity implements IInv
|
|||
{
|
||||
Random rand = new Random();
|
||||
int random = rand.nextInt(3);
|
||||
if(random == 0) return ObsidianIngots.LightningRod;
|
||||
if(random == 1) return ObsidianIngots.Stopwatch;
|
||||
if(random == 2) return ObsidianIngots.WeatherOrb;
|
||||
return ObsidianIngots.EnrichedAlloy;
|
||||
if(random == 0) return ObsidianIngotsCore.LightningRod;
|
||||
if(random == 1) return ObsidianIngotsCore.Stopwatch;
|
||||
if(random == 2) return ObsidianIngotsCore.WeatherOrb;
|
||||
return ObsidianIngotsCore.EnrichedAlloy;
|
||||
}
|
||||
|
||||
public void openChest() {}
|
||||
|
|
|
@ -25,7 +25,7 @@ import net.uberkat.obsidian.common.ContainerTheoreticalElementizer;
|
|||
import net.uberkat.obsidian.common.EntityKnife;
|
||||
import net.uberkat.obsidian.common.EntityObsidianArrow;
|
||||
import net.uberkat.obsidian.common.EntityObsidianTNT;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
import net.uberkat.obsidian.common.ObsidianUtils;
|
||||
import net.uberkat.obsidian.common.TileEntityCombiner;
|
||||
import net.uberkat.obsidian.common.TileEntityCrusher;
|
||||
|
@ -61,8 +61,8 @@ public class ClientProxy extends CommonProxy
|
|||
public void loadUtilities()
|
||||
{
|
||||
System.out.println("[ObsidianIngots] Beginning utility initiative...");
|
||||
ObsidianIngots.latestVersionNumber = ObsidianUtils.getLatestVersion();
|
||||
ObsidianIngots.recentNews = ObsidianUtils.getRecentNews();
|
||||
ObsidianIngotsCore.latestVersionNumber = ObsidianUtils.getLatestVersion();
|
||||
ObsidianIngotsCore.recentNews = ObsidianUtils.getRecentNews();
|
||||
new ThreadServerData();
|
||||
System.out.println("[ObsidianIngots] Utility initiative complete.");
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.EnumSet;
|
|||
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
import net.uberkat.obsidian.common.ObsidianUtils;
|
||||
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
|
@ -14,10 +14,10 @@ public class ClientTickHandler implements ITickHandler
|
|||
{
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
if(ObsidianIngots.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null)
|
||||
if(ObsidianIngotsCore.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null)
|
||||
{
|
||||
ObsidianUtils.checkForUpdates(ModLoader.getMinecraftInstance().thePlayer);
|
||||
ObsidianIngots.ticksPassed++;
|
||||
ObsidianIngotsCore.ticksPassed++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.net.URL;
|
|||
import org.lwjgl.Sys;
|
||||
|
||||
import net.minecraft.src.*;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
import net.uberkat.obsidian.common.ObsidianUtils;
|
||||
|
||||
public class GuiCredits extends GuiScreen {
|
||||
|
@ -68,11 +68,11 @@ public class GuiCredits extends GuiScreen {
|
|||
{
|
||||
drawDefaultBackground();
|
||||
drawCenteredString(fontRenderer, "Obsidian Ingots by aidancbrady", width / 2, (height / 4 - 60) + 20, 0xffffff);
|
||||
drawString(fontRenderer, (new StringBuilder()).append("Your version: ").append(ObsidianUtils.isClientLatestVersion() ? ObsidianIngots.versionNumber.toString() : (ObsidianIngots.versionNumber.toString() + " -- OUTDATED")).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 36, 0xa0a0a0);
|
||||
drawString(fontRenderer, (new StringBuilder()).append("Newest version: ").append(ObsidianIngots.latestVersionNumber).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 45, 0xa0a0a0);
|
||||
drawString(fontRenderer, (new StringBuilder()).append("Your version: ").append(ObsidianUtils.isClientLatestVersion() ? ObsidianIngotsCore.versionNumber.toString() : (ObsidianIngotsCore.versionNumber.toString() + " -- OUTDATED")).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 36, 0xa0a0a0);
|
||||
drawString(fontRenderer, (new StringBuilder()).append("Newest version: ").append(ObsidianIngotsCore.latestVersionNumber).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 45, 0xa0a0a0);
|
||||
writeText("*Developed on Mac OS X 10.8 Mountain Lion", 63);
|
||||
writeText("*Code, textures, and ideas by aidancbrady", 72);
|
||||
writeText("Recent news: " + ObsidianIngots.recentNews, 81);
|
||||
writeText("Recent news: " + ObsidianIngotsCore.recentNews, 81);
|
||||
writeText(updateProgress, 99);
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package net.uberkat.obsidian.client;
|
|||
|
||||
import net.minecraft.src.*;
|
||||
import net.uberkat.obsidian.common.EntityObsidianTNT;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class RenderObsidianTNT extends Render
|
|||
|
||||
float f3 = (1.0F - (((float)entityobsidiantnt.fuse - f1) + 1.0F) / 100F) * 0.8F;
|
||||
loadTexture("/obsidian/terrain.png");
|
||||
blockRenderer.renderBlockAsItem(ObsidianIngots.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1));
|
||||
blockRenderer.renderBlockAsItem(ObsidianIngotsCore.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1));
|
||||
|
||||
if ((entityobsidiantnt.fuse / 5) % 2 == 0)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ public class RenderObsidianTNT extends Render
|
|||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);
|
||||
blockRenderer.renderBlockAsItem(ObsidianIngots.ObsidianTNT, 0, 1.0F);
|
||||
blockRenderer.renderBlockAsItem(ObsidianIngotsCore.ObsidianTNT, 0, 1.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.net.Socket;
|
|||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
import net.uberkat.obsidian.common.ObsidianUtils;
|
||||
|
||||
public class ThreadServerData extends Thread
|
||||
|
@ -26,8 +26,8 @@ public class ThreadServerData extends Thread
|
|||
{
|
||||
System.out.println("[ObsidianIngots] Initiating server protocol...");
|
||||
try {
|
||||
InetAddress address = InetAddress.getByName(ObsidianIngots.hostIP);
|
||||
Socket socket = new Socket(address, ObsidianIngots.hostPort);
|
||||
InetAddress address = InetAddress.getByName(ObsidianIngotsCore.hostIP);
|
||||
Socket socket = new Socket(address, ObsidianIngotsCore.hostPort);
|
||||
PrintWriter writer = new PrintWriter(socket.getOutputStream());
|
||||
writer.println("USER:" + FMLClientHandler.instance().getClient().session.username);
|
||||
writer.println("DONE");
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.net.MalformedURLException;
|
|||
import java.net.URL;
|
||||
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.uberkat.obsidian.common.ObsidianIngots;
|
||||
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
||||
/**
|
||||
* Thread that downloads the latest release of Obsidian Ingots. The older file is deleted and the newly downloaded file takes it's place.
|
||||
* @author AidanBrady
|
||||
|
@ -51,7 +51,7 @@ public class ThreadUpdate extends Thread
|
|||
outputStream.close();
|
||||
stream.close();
|
||||
GuiCredits.onFinishedDownloading();
|
||||
System.out.println("[ObsidianIngots] Successfully updated to latest version (" + ObsidianIngots.latestVersionNumber + ").");
|
||||
System.out.println("[ObsidianIngots] Successfully updated to latest version (" + ObsidianIngotsCore.latestVersionNumber + ").");
|
||||
finalize();
|
||||
|
||||
} catch(Throwable e)
|
||||
|
|
Loading…
Reference in a new issue