*Updated names to Mekanism.
*Package name updates.
*Minor bugfixes.
This commit is contained in:
Aidan Brady 2012-11-05 14:29:04 -05:00
parent 6cdf2fbd0b
commit e3e0befa30
99 changed files with 643 additions and 737 deletions

View file

@ -1,9 +1,9 @@
[
{
"modid": "ObsidianIngots",
"name": "Obsidian Ingots",
"modid": "Mekanism",
"name": "Mekanism",
"description": "Energy, Armor, Tools, Weapons, Machines, Magic.",
"version": "4.3",
"version": "5.0",
"mcversion": "1.4.2",
"updateUrl": "",
"authors": [

View file

@ -1,4 +1,4 @@
package obsidian.api;
package mekanism.api;
/**
* Implement this if you want your GUI to be accessible by the Control Panel.

View file

@ -1,4 +1,4 @@
package obsidian.api;
package mekanism.api;
import java.util.List;
@ -15,7 +15,7 @@ import net.minecraft.src.*;
import net.minecraftforge.common.ISidedInventory;
/**
* A group of common methods used by all Obsidian Ingots machines.
* A group of common methods used by all Mekanism machines.
* @author AidanBrady
*
*/

View file

@ -1,4 +1,4 @@
package obsidian.api;
package mekanism.api;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package obsidian.api;
package mekanism.api;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package obsidian.api;
package mekanism.api;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;

View file

@ -1,7 +1,7 @@
package obsidian.api;
package mekanism.api;
import mekanism.common.Mekanism;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ObsidianIngots;
public class ItemMachineUpgrade extends Item
{
@ -9,6 +9,6 @@ public class ItemMachineUpgrade extends Item
{
super(id);
setMaxStackSize(1);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
}

View file

@ -1,22 +1,22 @@
package obsidian.api;
package mekanism.api;
import net.minecraft.src.*;
/**
* Use this class's 'getItem()' method to retrieve ItemStacks from the 'ObsidianIngots'
* Use this class's 'getItem()' method to retrieve ItemStacks from the 'Mekanism'
* class.
* @author AidanBrady
*
*/
public final class ItemRetriever
{
/** The 'ObsidianIngots' class that items and blocks are retrieved from. */
private static Class ObsidianIngots;
/** The 'Mekanism' class that items and blocks are retrieved from. */
private static Class Mekanism;
/**
* Attempts to retrieve an ItemStack of an item or block with the declared identifier.
*
* ObsidianIngots identifiers follow an easy-to-remember pattern. All identifiers
* Mekanism identifiers follow an easy-to-remember pattern. All identifiers
* are identical to the String returned by 'getItemName().' None include spaces,
* and always make sure you start with a capital letter. The name that shows up
* in-game can be stripped down to identifier form by removing spaces and all non-
@ -31,24 +31,24 @@ public final class ItemRetriever
* Make sure you run this in or after FMLPostInitializationEvent runs, because most
* items are registered when FMLInitializationEvent runs. However, some items ARE
* registered later in order to hook into other mods. In a rare circumstance you may
* have to add "after:ObsidianIngots" in the @Mod 'dependencies' annotation.
* have to add "after:Mekanism" in the @Mod 'dependencies' annotation.
*
* Note that you will be able to retrieve items that Obsidian Ingots has retrieved
* Note that you will be able to retrieve items that Mekanism has retrieved
* from other mods. In other words, if IC2 is installed, 'getItem("GoldDust")' will
* return IndustrialCraft gold dust.
*
* @param identifier - a String to be searched in the 'ObsidianIngots' class
* @param identifier - a String to be searched in the 'Mekanism' class
* @return an ItemStack of the declared identifier, otherwise null.
*/
public static ItemStack getItem(String identifier)
{
try {
if(ObsidianIngots == null)
if(Mekanism == null)
{
ObsidianIngots = Class.forName("net.uberkat.obsidian.common.ObsidianIngots");
Mekanism = Class.forName("mekanism.common.Mekanism");
}
Object ret = ObsidianIngots.getField(identifier).get(null);
Object ret = Mekanism.getField(identifier).get(null);
if(ret instanceof Item)
{
@ -58,7 +58,7 @@ public final class ItemRetriever
return null;
}
} catch(Exception e) {
System.err.println("[ObsidianIngots] Error retrieving item with identifier '" + identifier + "': " + e.getMessage());
System.err.println("[Mekanism] Error retrieving item with identifier '" + identifier + "': " + e.getMessage());
return null;
}
}

View file

@ -1,13 +1,13 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import mekanism.common.BlockMachine.MachineType;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.uberkat.obsidian.common.BlockMachine.MachineType;
public class BlockGenerator extends BlockContainer
{
@ -18,7 +18,7 @@ public class BlockGenerator extends BlockContainer
super(id, Material.iron);
setHardness(3.5F);
setResistance(8F);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
setRequiresSelfNotify();
}
@ -180,7 +180,7 @@ public class BlockGenerator extends BlockContainer
if(metadata == 0) id = 9;
entityplayer.openGui(ObsidianIngots.instance, id, world, x, y, z);
entityplayer.openGui(Mekanism.instance, id, world, x, y, z);
}
else {
return false;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Random;
@ -27,7 +27,7 @@ public class BlockMachine extends BlockContainer
super(id, Material.iron);
setHardness(3.5F);
setResistance(8F);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
setRequiresSelfNotify();
}
@ -167,7 +167,7 @@ public class BlockMachine extends BlockContainer
{
if(side == tileEntity.facing)
{
return isActive(world, x, y, z) ? ObsidianIngots.ANIMATED_TEXTURE_INDEX : 14;
return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX : 14;
}
else {
@ -178,7 +178,7 @@ public class BlockMachine extends BlockContainer
{
if(side == tileEntity.facing)
{
return isActive(world, x, y, z) ? ObsidianIngots.ANIMATED_TEXTURE_INDEX+1 : 15;
return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+1 : 15;
}
else {
return 2;
@ -203,14 +203,14 @@ public class BlockMachine extends BlockContainer
else {
if(side == tileEntity.facing)
{
return isActive(world, x, y, z) ? ObsidianIngots.ANIMATED_TEXTURE_INDEX+2 : 16;
return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+2 : 16;
}
else if(side == ForgeDirection.getOrientation(tileEntity.facing).getOpposite().ordinal())
{
return isActive(world, x, y, z) ? ObsidianIngots.ANIMATED_TEXTURE_INDEX+3 : 17;
return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+3 : 17;
}
else {
return isActive(world, x, y, z) ? ObsidianIngots.ANIMATED_TEXTURE_INDEX+4 : 19;
return isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+4 : 19;
}
}
}
@ -323,7 +323,7 @@ public class BlockMachine extends BlockContainer
else if(metadata == 4) id = 7;
else if(metadata == 5) id = 10;
entityplayer.openGui(ObsidianIngots.instance, id, world, x, y, z);
entityplayer.openGui(Mekanism.instance, id, world, x, y, z);
return true;
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Random;
@ -7,9 +7,9 @@ import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import mekanism.client.GuiControlPanel;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeChunkManager;
import net.uberkat.obsidian.client.GuiControlPanel;
/**
* Block class for handling multiple metal block IDs.
@ -28,7 +28,7 @@ public class BlockMulti extends Block
super(i, Material.iron);
setHardness(5F);
setResistance(10F);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
setRequiresSelfNotify();
}
@ -73,8 +73,8 @@ public class BlockMulti extends Block
{
if(entityplayer.isSneaking())
{
entityplayer.openGui(ObsidianIngots.instance, 1, world, x, y, z);
//entityplayer.openGui(ObsidianIngots.instance, 10, world, x, y, z);
entityplayer.openGui(Mekanism.instance, 1, world, x, y, z);
//entityplayer.openGui(Mekanism.instance, 10, world, x, y, z);
return true;
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.ArrayList;
import java.util.Random;
@ -72,7 +72,7 @@ public class BlockObsidianTNT extends Block
{
if ((meta & 1) == 0)
{
dropBlockAsItem_do(world, x, y, z, new ItemStack(ObsidianIngots.ObsidianTNT, 1, 0));
dropBlockAsItem_do(world, x, y, z, new ItemStack(Mekanism.ObsidianTNT, 1, 0));
}
else
{

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
@ -19,7 +19,7 @@ public class BlockOre extends Block
super(i, Material.rock);
setHardness(3F);
setResistance(5F);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
setRequiresSelfNotify();
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import ic2.api.EnergyNet;
@ -26,7 +26,7 @@ public class BlockPowerUnit extends BlockContainer
super(id, Material.iron);
setHardness(2F);
setResistance(4F);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
setRequiresSelfNotify();
}
@ -154,7 +154,7 @@ public class BlockPowerUnit extends BlockContainer
}
}
}
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
EnergyNet.getForWorld(var5.worldObj).removeTileEntity(var5);
}
@ -179,7 +179,7 @@ public class BlockPowerUnit extends BlockContainer
{
if(!entityplayer.isSneaking())
{
entityplayer.openGui(ObsidianIngots.instance, 8, world, x, y, z);
entityplayer.openGui(Mekanism.instance, 8, world, x, y, z);
}
else {
return false;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.Arrays;
import java.util.List;
@ -10,21 +10,21 @@ import net.minecraft.src.ICommandSender;
import net.minecraft.src.PlayerNotFoundException;
import net.minecraft.src.WrongUsageException;
public class CommandOI extends CommandBase
public class CommandMekanism extends CommandBase
{
public String getCommandName()
{
return "oi";
return "mk";
}
public String getCommandUsage(ICommandSender sender)
{
return "/oi <parameters>";
return "/mk <parameters>";
}
public List getCommandAliases()
{
return Arrays.asList(new String[] {"obsidian", "obsidianingots"});
return Arrays.asList(new String[] {"mekanism"});
}
public boolean canCommandSenderUseCommand(ICommandSender sender)
@ -36,44 +36,44 @@ public class CommandOI extends CommandBase
{
if(params.length < 1)
{
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " --------");
sender.sendChatToPlayer(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + ObsidianIngots.versionNumber);
sender.sendChatToPlayer(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + ObsidianIngots.latestVersionNumber);
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " --------");
sender.sendChatToPlayer(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + Mekanism.versionNumber);
sender.sendChatToPlayer(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber);
sender.sendChatToPlayer(EnumColor.GREY + " *Developed on Mac OS X 10.8 Mountain Lion");
sender.sendChatToPlayer(EnumColor.GREY + " *Code, textures, and ideas by aidancbrady");
sender.sendChatToPlayer(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + ObsidianIngots.recentNews);
sender.sendChatToPlayer(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews);
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[============]" + EnumColor.GREY + " --------");
}
else if(params.length == 1)
{
if(params[0].equalsIgnoreCase("help"))
{
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " --------");
sender.sendChatToPlayer(EnumColor.INDIGO + " /oi" + EnumColor.GREY + " -- displays the main page.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /oi help" + EnumColor.GREY + " -- displays this guide.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /oi version" + EnumColor.GREY + " -- displays the version number.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /oi latest" + EnumColor.GREY + " -- displays the latest version number.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /oi news" + EnumColor.GREY + " -- displays most recent recent news.");
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " --------");
sender.sendChatToPlayer(EnumColor.INDIGO + " /mk" + EnumColor.GREY + " -- displays the main page.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /mk help" + EnumColor.GREY + " -- displays this guide.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /mk version" + EnumColor.GREY + " -- displays the version number.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /mk latest" + EnumColor.GREY + " -- displays the latest version number.");
sender.sendChatToPlayer(EnumColor.INDIGO + " /mk news" + EnumColor.GREY + " -- displays most recent recent news.");
sender.sendChatToPlayer(EnumColor.GREY + "-------- " + EnumColor.DARK_BLUE + "[============]" + EnumColor.GREY + " --------");
}
else if(params[0].equalsIgnoreCase("version"))
{
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " This server is running on version " + EnumColor.DARK_GREY + ObsidianIngots.versionNumber.toString() + EnumColor.GREY + ".");
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " This server is running on version " + EnumColor.DARK_GREY + Mekanism.versionNumber.toString() + EnumColor.GREY + ".");
}
else if(params[0].equalsIgnoreCase("news"))
{
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + ObsidianIngots.recentNews);
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + Mekanism.recentNews);
}
else if(params[0].equalsIgnoreCase("latest"))
{
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + ObsidianIngots.latestVersionNumber + EnumColor.GREY + ".");
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + ".");
}
else {
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[ObsidianIngots]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/oi help" + EnumColor.GREY + "' for help.");
sender.sendChatToPlayer(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help.");
}
}
}

View file

@ -1,11 +1,11 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
import cpw.mods.fml.common.network.IGuiHandler;
/**
* Client and server GUI hander for Obsidian Ingots.
* Client and server GUI hander for Mekanism.
* Uses CommonProxy to get the server GUI and ClientProxy for the client GUI.
* @author AidanBrady
*
@ -14,11 +14,11 @@ 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 Mekanism.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 Mekanism.proxy.getClientGui(ID, player, world, x, y, z);
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.File;
import java.io.FileInputStream;
@ -12,9 +12,10 @@ import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* Common proxy for Obsidian Ingots mod.
* Common proxy for the Mekanism mod.
* @author AidanBrady
*
*/
@ -49,16 +50,16 @@ public class CommonProxy
*/
public void loadConfiguration()
{
ObsidianIngots.configuration.load();
ObsidianIngots.multiBlockID = ObsidianIngots.configuration.getBlock("MultiBlock", 3000).getInt();
ObsidianIngots.machineBlockID = ObsidianIngots.configuration.getBlock("MachineBlock", 3001).getInt();
ObsidianIngots.oreBlockID = ObsidianIngots.configuration.getBlock("OreBlock", 3002).getInt();
ObsidianIngots.obsidianTNTID = ObsidianIngots.configuration.getBlock("ObsidianTNT", 3003).getInt();
ObsidianIngots.powerUnitID = ObsidianIngots.configuration.getBlock("PowerUnit", 3004).getInt();
ObsidianIngots.generatorID = ObsidianIngots.configuration.getBlock("Generator", 3005).getInt();
ObsidianIngots.extrasEnabled = ObsidianIngots.configuration.get("ExtrasEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
ObsidianIngots.oreGenerationEnabled = ObsidianIngots.configuration.get("OreGenerationEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
ObsidianIngots.configuration.save();
Mekanism.configuration.load();
Mekanism.multiBlockID = Mekanism.configuration.getBlock("MultiBlock", 3000).getInt();
Mekanism.machineBlockID = Mekanism.configuration.getBlock("MachineBlock", 3001).getInt();
Mekanism.oreBlockID = Mekanism.configuration.getBlock("OreBlock", 3002).getInt();
Mekanism.obsidianTNTID = Mekanism.configuration.getBlock("ObsidianTNT", 3003).getInt();
Mekanism.powerUnitID = Mekanism.configuration.getBlock("PowerUnit", 3004).getInt();
Mekanism.generatorID = Mekanism.configuration.getBlock("Generator", 3005).getInt();
Mekanism.extrasEnabled = Mekanism.configuration.get("ExtrasEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
Mekanism.oreGenerationEnabled = Mekanism.configuration.get("OreGenerationEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
Mekanism.configuration.save();
}
/**

View file

@ -1,9 +1,9 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import obsidian.api.IEnergizedItem;
import obsidian.api.ItemMachineUpgrade;
import ic2.api.IElectricItem;
import universalelectricity.implement.IItemElectric;
import mekanism.api.IEnergizedItem;
import mekanism.api.ItemMachineUpgrade;
import net.minecraft.src.*;
public class ContainerAdvancedElectricMachine extends Container

View file

@ -1,9 +1,9 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import obsidian.api.IEnergizedItem;
import obsidian.api.ItemMachineUpgrade;
import ic2.api.IElectricItem;
import universalelectricity.implement.IItemElectric;
import mekanism.api.IEnergizedItem;
import mekanism.api.ItemMachineUpgrade;
import net.minecraft.src.*;
public class ContainerElectricMachine extends Container

View file

@ -1,8 +1,8 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import ic2.api.IElectricItem;
import obsidian.api.IEnergizedItem;
import universalelectricity.implement.IItemElectric;
import mekanism.api.IEnergizedItem;
import net.minecraft.src.*;
public class ContainerGenerator extends Container

View file

@ -1,8 +1,8 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import obsidian.api.*;
import ic2.api.IElectricItem;
import universalelectricity.implement.IItemElectric;
import mekanism.api.*;
import net.minecraft.src.*;
public class ContainerPowerUnit extends Container

View file

@ -0,0 +1,16 @@
package mekanism.common;
import net.minecraft.src.*;
public class CreativeTabMekanism extends CreativeTabs
{
public CreativeTabMekanism()
{
super("tabMekanism");
}
public ItemStack getIconItemStack()
{
return new ItemStack(Mekanism.Stopwatch, 1, 0);
}
}

View file

@ -1,13 +1,13 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class DamageSourceObsidian extends EntityDamageSourceIndirect
public class DamageSourceMekanism extends EntityDamageSourceIndirect
{
private Entity damageSourceProjectile;
private Entity damageSourceEntity;
public DamageSourceObsidian(String s, Entity entity, Entity entity1)
public DamageSourceMekanism(String s, Entity entity, Entity entity1)
{
super(s, entity, entity1);
damageSourceProjectile = entity;
@ -26,6 +26,6 @@ public class DamageSourceObsidian extends EntityDamageSourceIndirect
public static DamageSource causeWeaponDamage(Entity entity, Entity entity1)
{
return (new DamageSourceObsidian("weapon", entity, entity1)).setProjectile();
return (new DamageSourceMekanism("weapon", entity, entity1)).setProjectile();
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.Random;
import net.minecraft.src.*;
@ -76,11 +76,11 @@ public class EntityKnife extends EntityProjectile
if (shootingEntity == null)
{
damagesource = DamageSourceObsidian.causeWeaponDamage(this, this);
damagesource = DamageSourceMekanism.causeWeaponDamage(this, this);
}
else
{
damagesource = DamageSourceObsidian.causeWeaponDamage(this, shootingEntity);
damagesource = DamageSourceMekanism.causeWeaponDamage(this, shootingEntity);
}
if (entity.attackEntityFrom(damagesource, thrownItem.getDamageVsEntity(entity)))

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
@ -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 = Mekanism.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, true);
worldObj.createExplosion((Entity)null, posX, posY, posZ, Mekanism.ObsidianTNTBlastRadius, true);
hasExploded = true;
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
/**
* Simple color enum for adding colors to in-game GUI Strings of text.

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
/**
* This class is designated to provide easy packet management in PacketHandler. Each type of packet is assigned to a

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
/**
* This class is designated for easy management of weather packets sent to the server. Each weather type is set to a

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.ItemBlock;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.ArrayList;
import java.util.List;
@ -6,7 +6,7 @@ import java.util.List;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.src.*;
public class ItemDust extends ItemObsidian
public class ItemDust extends ItemMekanism
{
public static String[] en_USNames = {"Iron", "Gold", "Platinum",
"Obsidian"};
@ -15,7 +15,7 @@ public class ItemDust extends ItemObsidian
{
super(id);
setHasSubtypes(true);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public int getIconFromDamage(int meta)

View file

@ -1,17 +1,17 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import obsidian.api.IEnergizedItem;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.electricity.ElectricInfo;
import universalelectricity.implement.IItemElectric;
import ic2.api.IElectricItem;
import mekanism.api.IEnergizedItem;
import net.minecraft.src.*;
public class ItemEnergized extends ItemObsidian implements IEnergizedItem, IItemElectric
public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItemElectric
{
public int maxEnergy;
@ -28,14 +28,14 @@ public class ItemEnergized extends ItemObsidian implements IEnergizedItem, IItem
setMaxStackSize(1);
setMaxDamage(maxEnergy/divider);
setNoRepair();
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{
int energy = getEnergy(itemstack);
list.add("Stored Energy: " + ObsidianUtils.getDisplayedEnergy(energy));
list.add("Stored Energy: " + MekanismUtils.getDisplayedEnergy(energy));
}
public void onCreated(ItemStack itemstack, World world, EntityPlayer entityplayer)

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.ArrayList;
import java.util.List;
@ -6,7 +6,7 @@ import java.util.List;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.src.*;
public class ItemIngot extends ItemObsidian
public class ItemIngot extends ItemMekanism
{
public static String[] en_USNames = {"Obsidian", "Platinum", "Redstone",
"Glowstone"};
@ -15,7 +15,7 @@ public class ItemIngot extends ItemObsidian
{
super(id);
setHasSubtypes(true);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public int getIconFromDamage(int meta)

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class ItemLightningRod extends ItemObsidian
public class ItemLightningRod extends ItemMekanism
{
public ItemLightningRod(int i)
{
super(i);
setMaxStackSize(1);
setMaxDamage(100);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public boolean hasEffect(ItemStack par1ItemStack)

View file

@ -0,0 +1,16 @@
package mekanism.common;
import net.minecraft.src.*;
public class ItemMekanism extends Item
{
public ItemMekanism(int i)
{
super(i);
setCreativeTab(Mekanism.tabMekanism);
}
public String getTextureFile() {
return "/textures/items.png";
}
}

View file

@ -1,13 +1,13 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class ItemObsidianArmor extends ItemArmor
public class ItemMekanismArmor extends ItemArmor
{
public ItemObsidianArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
public ItemMekanismArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
{
super(par1, par2EnumArmorMaterial, par3, par4);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public String getTextureFile() {

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.EnumToolMaterial;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
public class ItemObsidianAxe extends ItemObsidianTool
public class ItemMekanismAxe extends ItemMekanismTool
{
private static Block blocksEffectiveAgainst[];
public ItemObsidianAxe(int par1, EnumToolMaterial par2EnumToolMaterial)
public ItemMekanismAxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
}

View file

@ -1,16 +1,16 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.Random;
import net.minecraft.src.*;
public class ItemObsidianBow extends ItemObsidian
public class ItemMekanismBow extends ItemMekanism
{
public ItemObsidianBow(int par1)
public ItemMekanismBow(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(750);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
@ -18,26 +18,26 @@ public class ItemObsidianBow extends ItemObsidian
EntityPlayer player = (EntityPlayer)entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (player.isUsingItem() && currentItem.itemID == ObsidianIngots.ObsidianBow.shiftedIndex)
if (player.isUsingItem() && currentItem.itemID == Mekanism.ObsidianBow.shiftedIndex)
{
int useTicks = itemstack.getMaxItemUseDuration() - player.getItemInUseCount();
if (useTicks >= 14)
{
iconIndex = ObsidianIngots.BOW_TEXTURE_INDEX+3;
iconIndex = Mekanism.BOW_TEXTURE_INDEX+3;
}
else if (useTicks > 9)
{
iconIndex = ObsidianIngots.BOW_TEXTURE_INDEX+2;
iconIndex = Mekanism.BOW_TEXTURE_INDEX+2;
}
else if (useTicks > 0)
{
iconIndex = ObsidianIngots.BOW_TEXTURE_INDEX+1;
iconIndex = Mekanism.BOW_TEXTURE_INDEX+1;
}
}
else
{
iconIndex = ObsidianIngots.BOW_TEXTURE_INDEX;
iconIndex = Mekanism.BOW_TEXTURE_INDEX;
}
}
@ -108,9 +108,9 @@ public class ItemObsidianBow extends ItemObsidian
ItemStack itemStack = player.inventory.getCurrentItem();
if(itemStack.itemID != ObsidianIngots.ObsidianBow.shiftedIndex)
if(itemStack.itemID != Mekanism.ObsidianBow.shiftedIndex)
{
iconIndex = ObsidianIngots.BOW_TEXTURE_INDEX;
iconIndex = Mekanism.BOW_TEXTURE_INDEX;
}
}

View file

@ -1,10 +1,10 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class ItemObsidianHoe extends ItemObsidian
public class ItemMekanismHoe extends ItemMekanism
{
public ItemObsidianHoe(int par1, EnumToolMaterial par2EnumToolMaterial)
public ItemMekanismHoe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1);
maxStackSize = 1;

View file

@ -1,9 +1,9 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.Random;
import net.minecraft.src.*;
public class ItemObsidianKnife extends ItemObsidian
public class ItemMekanismKnife extends ItemMekanism
{
private EnumToolMaterial enumToolMaterial;
protected int weaponDamage;
@ -12,7 +12,7 @@ public class ItemObsidianKnife extends ItemObsidian
protected int blockDamage;
protected int enchantability;
public ItemObsidianKnife(int i, EnumToolMaterial enumtoolmaterial)
public ItemMekanismKnife(int i, EnumToolMaterial enumtoolmaterial)
{
super(i);
enumToolMaterial = enumtoolmaterial;
@ -23,7 +23,7 @@ public class ItemObsidianKnife extends ItemObsidian
entityDamage = 2;
blockDamage = 2;
enchantability = enumtoolmaterial.getEnchantability();
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
/**

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
@ -6,11 +6,11 @@ import net.minecraft.src.EnumToolMaterial;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
public class ItemObsidianPaxel extends ItemObsidianTool
public class ItemMekanismPaxel extends ItemMekanismTool
{
private static Block blocksEffectiveAgainst[];
public ItemObsidianPaxel(int i, EnumToolMaterial enumtoolmaterial)
public ItemMekanismPaxel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, 3, enumtoolmaterial, blocksEffectiveAgainst);
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
@ -6,11 +6,11 @@ import net.minecraft.src.EnumToolMaterial;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
public class ItemObsidianPickaxe extends ItemObsidianTool
public class ItemMekanismPickaxe extends ItemMekanismTool
{
private static Block blocksEffectiveAgainst[];
public ItemObsidianPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial)
public ItemMekanismPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst);
}

View file

@ -1,14 +1,14 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EnumToolMaterial;
public class ItemObsidianSpade extends ItemObsidianTool
public class ItemMekanismSpade extends ItemMekanismTool
{
private static Block blocksEffectiveAgainst[];
public ItemObsidianSpade(int par1, EnumToolMaterial par2EnumToolMaterial)
public ItemMekanismSpade(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst);
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
@ -11,12 +11,12 @@ import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;
public class ItemObsidianSword extends ItemObsidian
public class ItemMekanismSword extends ItemMekanism
{
private int weaponDamage;
private final EnumToolMaterial toolMaterial;
public ItemObsidianSword(int par1, EnumToolMaterial par2EnumToolMaterial)
public ItemMekanismSword(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1);
toolMaterial = par2EnumToolMaterial;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
@ -8,12 +8,12 @@ import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.ItemTool;
public class ItemObsidianTool extends ItemTool
public class ItemMekanismTool extends ItemTool
{
public ItemObsidianTool(int par1, int par2, EnumToolMaterial par3EnumToolMaterial, Block par4ArrayOfBlock[])
public ItemMekanismTool(int par1, int par2, EnumToolMaterial par3EnumToolMaterial, Block par4ArrayOfBlock[])
{
super(par1, par2, par3EnumToolMaterial, par4ArrayOfBlock);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public String getTextureFile()

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class ItemStopwatch extends ItemObsidian {
public class ItemStopwatch extends ItemMekanism {
public ItemStopwatch(int i)
{
super(i);
setMaxStackSize(1);
setMaxDamage(5000);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public boolean hasEffect(ItemStack itemstack)
@ -21,7 +21,7 @@ public class ItemStopwatch extends ItemObsidian {
{
if(itemstack.getItemDamage() == 0)
{
entityplayer.openGui(ObsidianIngots.instance, 0, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
entityplayer.openGui(Mekanism.instance, 0, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
}
return itemstack;
}

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.*;
public class ItemWeatherOrb extends ItemObsidian
public class ItemWeatherOrb extends ItemMekanism
{
public ItemWeatherOrb(int i)
{
super(i);
setMaxStackSize(1);
setMaxDamage(5000);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
setCreativeTab(Mekanism.tabMekanism);
}
public boolean hasEffect(ItemStack itemstack)
@ -21,7 +21,7 @@ public class ItemWeatherOrb extends ItemObsidian
{
if(itemstack.getItemDamage() == 0)
{
entityplayer.openGui(ObsidianIngots.instance, 2, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
entityplayer.openGui(Mekanism.instance, 2, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ);
}
return itemstack;
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.ArrayList;
import java.util.List;
@ -22,7 +22,7 @@ public class MachineryManager
public MachineryManager()
{
reset();
System.out.println("[ObsidianIngots] Successfully initialized Machinery Manager.");
System.out.println("[Mekanism] Successfully initialized Machinery Manager.");
}
/**
@ -36,7 +36,7 @@ public class MachineryManager
machines.add(machine);
}
else {
System.out.println("[ObsidianIngots] Attempted to add machine to manager that already exists.");
System.out.println("[Mekanism] Attempted to add machine to manager that already exists.");
}
}
@ -51,7 +51,7 @@ public class MachineryManager
machines.remove(machine);
}
else {
System.out.println("[ObsidianIngots] Attempted to remove machine from manager that doesn't exist.");
System.out.println("[Mekanism] Attempted to remove machine from manager that doesn't exist.");
}
}
@ -70,7 +70,7 @@ public class MachineryManager
return (TileEntityBasicMachine)world.getBlockTileEntity(x, y, z);
}
else {
System.out.println("[ObsidianIngots] Attempted to grab machine from manager that doesn't exist.");
System.out.println("[Mekanism] Attempted to grab machine from manager that doesn't exist.");
return null;
}
}
@ -85,7 +85,7 @@ public class MachineryManager
{
if(explode)
{
ObsidianUtils.doFakeBlockExplosion(machine.worldObj, machine.xCoord, machine.yCoord, machine.zCoord);
MekanismUtils.doFakeBlockExplosion(machine.worldObj, machine.xCoord, machine.yCoord, machine.zCoord);
}
machine.worldObj.setBlockAndMetadataWithNotify(machine.xCoord, machine.yCoord, machine.zCoord, 0, 0);
machine.worldObj.removeBlockTileEntity(machine.xCoord, machine.yCoord, machine.zCoord);

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import ic2.api.Ic2Recipes;
@ -14,13 +14,13 @@ import java.util.Properties;
import java.util.Random;
import java.util.logging.Logger;
import obsidian.api.ItemMachineUpgrade;
import mekanism.api.ItemMachineUpgrade;
import mekanism.client.SoundHandler;
import net.minecraftforge.common.*;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.src.*;
import net.uberkat.obsidian.client.SoundHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.Init;
@ -39,41 +39,41 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
/**
* Obsidian Ingots mod -- adds in Tools, Armor, Weapons, Machines, and Magic. Universal source.
* Mekanism mod -- adds in Tools, Armor, Weapons, Machines, and Magic. Universal source.
* @author AidanBrady
*
*/
@Mod(modid = "ObsidianIngots", name = "Obsidian Ingots", version = "5.0.0")
@NetworkMod(channels = { "ObsidianIngots" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class ObsidianIngots
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.0.0")
@NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class Mekanism
{
/** Obsidian Ingots logger instance */
/** Mekanism logger instance */
public static Logger logger = Logger.getLogger("Minecraft");
/** Obsidian Ingots proxy instance */
@SidedProxy(clientSide = "net.uberkat.obsidian.client.ClientProxy", serverSide = "net.uberkat.obsidian.common.CommonProxy")
/** Mekanism proxy instance */
@SidedProxy(clientSide = "mekanism.client.ClientProxy", serverSide = "mekanism.common.CommonProxy")
public static CommonProxy proxy;
/** Obsidian Ingots mod instance */
@Instance("ObsidianIngots")
public static ObsidianIngots instance;
/** Mekanism mod instance */
@Instance("Mekanism")
public static Mekanism instance;
/** Obsidian Ingots hooks instance */
public static ObsidianHooks hooks;
/** Mekanism hooks instance */
public static MekanismHooks hooks;
/** Obsidian Ingots configuration instance */
/** Mekanism configuration instance */
public static Configuration configuration;
/** Obsidian Ingots version number */
/** Mekanism version number */
public static Version versionNumber = new Version(5, 0, 0);
/** Obsidian Ingots creative tab */
public static CreativeTabOI tabOBSIDIAN = new CreativeTabOI();
/** Mekanism creative tab */
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();
/** The latest version number which is received from the Obsidian Ingots server */
/** The latest version number which is received from the Mekanism server */
public static String latestVersionNumber;
/** The recent news which is received from the Obsidian Ingots server */
/** The recent news which is received from the Mekanism server */
public static String recentNews;
/** The main MachineryManager instance that is used by all machines */
@ -83,10 +83,10 @@ public class ObsidianIngots
/** The main SoundHandler instance that is used by all audio sources */
public static SoundHandler audioHandler;
/** The IP used to connect to the Obsidian Ingots server */
/** The IP used to connect to the Mekanism server */
public static String hostIP = "71.56.58.57";
/** The port used to connect to the Obsidian Ingots server */
/** The port used to connect to the Mekanism server */
public static int hostPort = 3073;
//Enums: Tools
@ -213,6 +213,7 @@ public class ObsidianIngots
public static Block ObsidianTNT;
public static Block PowerUnit;
public static Block Generator;
public static Block PlatinumWire;
//MultiID Items
public static Item Dust;
@ -660,6 +661,7 @@ public class ObsidianIngots
LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade");
LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade");
LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade");
LanguageRegistry.addName(new ItemStack(PlatinumWire, 1, 0), "Platinum Wire");
//Localization for MultiBlock
LanguageRegistry.instance().addStringLocalization("tile.MultiBlock.PlatinumBlock.name", "Platinum Block");
@ -804,81 +806,81 @@ public class ObsidianIngots
*/
public void addItems()
{
RedstoneHelmet = (new ItemObsidianArmor(11235, armorREDSTONE, proxy.getArmorIndex("redstone"), 0)).setItemName("RedstoneHelmet");
RedstoneBody = (new ItemObsidianArmor(11236, armorREDSTONE, proxy.getArmorIndex("redstone"), 1)).setItemName("RedstoneBody");
RedstoneLegs = (new ItemObsidianArmor(11237, armorREDSTONE, proxy.getArmorIndex("redstone"), 2)).setItemName("RedstoneLegs");
RedstoneBoots = (new ItemObsidianArmor(11238, armorREDSTONE, proxy.getArmorIndex("redstone"), 3)).setItemName("RedstoneBoots");
RedstonePaxel = new ItemObsidianPaxel(11240, toolREDSTONE2).setItemName("RedstonePaxel");
RedstonePickaxe = new ItemObsidianPickaxe(11241, toolREDSTONE).setItemName("RedstonePickaxe");
RedstoneAxe = new ItemObsidianAxe(11242, toolREDSTONE).setItemName("RedstoneAxe");
RedstoneSpade = new ItemObsidianSpade(11243, toolREDSTONE).setItemName("RedstoneSpade");
RedstoneHoe = new ItemObsidianHoe(11244, toolREDSTONE).setItemName("RedstoneHoe");
RedstoneSword = new ItemObsidianSword(11245, toolREDSTONE).setItemName("RedstoneSword");
PlatinumHelmet = (new ItemObsidianArmor(11246, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 0)).setItemName("PlatinumHelmet");
PlatinumBody = (new ItemObsidianArmor(11247, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 1)).setItemName("PlatinumBody");
PlatinumLegs = (new ItemObsidianArmor(11248, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 2)).setItemName("PlatinumLegs");
PlatinumBoots = (new ItemObsidianArmor(11249, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 3)).setItemName("PlatinumBoots");
PlatinumPaxel = new ItemObsidianPaxel(11251, toolPLATINUM2).setItemName("PlatinumPaxel");
PlatinumPickaxe = new ItemObsidianPickaxe(11252, toolPLATINUM).setItemName("PlatinumPickaxe");
PlatinumAxe = new ItemObsidianAxe(11253, toolPLATINUM).setItemName("PlatinumAxe");
PlatinumSpade = new ItemObsidianSpade(11254, toolPLATINUM).setItemName("PlatinumSpade");
PlatinumHoe = new ItemObsidianHoe(11255, toolPLATINUM).setItemName("PlatinumHoe");
PlatinumSword = new ItemObsidianSword(11256, toolPLATINUM).setItemName("PlatinumSword");
ObsidianHelmet = (new ItemObsidianArmor(11257, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 0)).setItemName("ObsidianHelmet");
ObsidianBody = (new ItemObsidianArmor(11258, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 1)).setItemName("ObsidianBody");
ObsidianLegs = (new ItemObsidianArmor(11259, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 2)).setItemName("ObsidianLegs");
ObsidianBoots = (new ItemObsidianArmor(11260, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 3)).setItemName("ObsidianBoots");
ObsidianPaxel = new ItemObsidianPaxel(11262, toolOBSIDIAN2).setItemName("ObsidianPaxel");
ObsidianPickaxe = new ItemObsidianPickaxe(11263, toolOBSIDIAN).setItemName("ObsidianPickaxe");
ObsidianAxe = new ItemObsidianAxe(11264, toolOBSIDIAN).setItemName("ObsidianAxe");
ObsidianSpade = new ItemObsidianSpade(11265, toolOBSIDIAN).setItemName("ObsidianSpade");
ObsidianHoe = new ItemObsidianHoe(11266, toolOBSIDIAN).setItemName("ObsidianHoe");
ObsidianSword = new ItemObsidianSword(11267, toolOBSIDIAN).setItemName("ObsidianSword");
LazuliPaxel = new ItemObsidianPaxel(11268, toolLAZULI2).setItemName("LazuliPaxel");
LazuliPickaxe = new ItemObsidianPickaxe(11269, toolLAZULI).setItemName("LazuliPickaxe");
LazuliAxe = new ItemObsidianAxe(11270, toolLAZULI).setItemName("LazuliAxe");
LazuliSpade = new ItemObsidianSpade(11271, toolLAZULI).setItemName("LazuliSpade");
LazuliHoe = new ItemObsidianHoe(11272, toolLAZULI).setItemName("LazuliHoe");
LazuliSword = new ItemObsidianSword(11273, toolLAZULI).setItemName("LazuliSword");
LazuliHelmet = (new ItemObsidianArmor(11274, armorLAZULI, proxy.getArmorIndex("lazuli"), 0)).setItemName("LazuliHelmet");
LazuliBody = (new ItemObsidianArmor(11275, armorLAZULI, proxy.getArmorIndex("lazuli"), 1)).setItemName("LazuliBody");
LazuliLegs = (new ItemObsidianArmor(11276, armorLAZULI, proxy.getArmorIndex("lazuli"), 2)).setItemName("LazuliLegs");
LazuliBoots = (new ItemObsidianArmor(11277, armorLAZULI, proxy.getArmorIndex("lazuli"), 3)).setItemName("LazuliBoots");
ObsidianBow = new ItemObsidianBow(11279).setItemName("ObsidianBow");
RedstoneHelmet = (new ItemMekanismArmor(11235, armorREDSTONE, proxy.getArmorIndex("redstone"), 0)).setItemName("RedstoneHelmet");
RedstoneBody = (new ItemMekanismArmor(11236, armorREDSTONE, proxy.getArmorIndex("redstone"), 1)).setItemName("RedstoneBody");
RedstoneLegs = (new ItemMekanismArmor(11237, armorREDSTONE, proxy.getArmorIndex("redstone"), 2)).setItemName("RedstoneLegs");
RedstoneBoots = (new ItemMekanismArmor(11238, armorREDSTONE, proxy.getArmorIndex("redstone"), 3)).setItemName("RedstoneBoots");
RedstonePaxel = new ItemMekanismPaxel(11240, toolREDSTONE2).setItemName("RedstonePaxel");
RedstonePickaxe = new ItemMekanismPickaxe(11241, toolREDSTONE).setItemName("RedstonePickaxe");
RedstoneAxe = new ItemMekanismAxe(11242, toolREDSTONE).setItemName("RedstoneAxe");
RedstoneSpade = new ItemMekanismSpade(11243, toolREDSTONE).setItemName("RedstoneSpade");
RedstoneHoe = new ItemMekanismHoe(11244, toolREDSTONE).setItemName("RedstoneHoe");
RedstoneSword = new ItemMekanismSword(11245, toolREDSTONE).setItemName("RedstoneSword");
PlatinumHelmet = (new ItemMekanismArmor(11246, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 0)).setItemName("PlatinumHelmet");
PlatinumBody = (new ItemMekanismArmor(11247, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 1)).setItemName("PlatinumBody");
PlatinumLegs = (new ItemMekanismArmor(11248, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 2)).setItemName("PlatinumLegs");
PlatinumBoots = (new ItemMekanismArmor(11249, EnumArmorMaterial.DIAMOND, proxy.getArmorIndex("platinum"), 3)).setItemName("PlatinumBoots");
PlatinumPaxel = new ItemMekanismPaxel(11251, toolPLATINUM2).setItemName("PlatinumPaxel");
PlatinumPickaxe = new ItemMekanismPickaxe(11252, toolPLATINUM).setItemName("PlatinumPickaxe");
PlatinumAxe = new ItemMekanismAxe(11253, toolPLATINUM).setItemName("PlatinumAxe");
PlatinumSpade = new ItemMekanismSpade(11254, toolPLATINUM).setItemName("PlatinumSpade");
PlatinumHoe = new ItemMekanismHoe(11255, toolPLATINUM).setItemName("PlatinumHoe");
PlatinumSword = new ItemMekanismSword(11256, toolPLATINUM).setItemName("PlatinumSword");
ObsidianHelmet = (new ItemMekanismArmor(11257, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 0)).setItemName("ObsidianHelmet");
ObsidianBody = (new ItemMekanismArmor(11258, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 1)).setItemName("ObsidianBody");
ObsidianLegs = (new ItemMekanismArmor(11259, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 2)).setItemName("ObsidianLegs");
ObsidianBoots = (new ItemMekanismArmor(11260, armorOBSIDIAN, proxy.getArmorIndex("obsidian"), 3)).setItemName("ObsidianBoots");
ObsidianPaxel = new ItemMekanismPaxel(11262, toolOBSIDIAN2).setItemName("ObsidianPaxel");
ObsidianPickaxe = new ItemMekanismPickaxe(11263, toolOBSIDIAN).setItemName("ObsidianPickaxe");
ObsidianAxe = new ItemMekanismAxe(11264, toolOBSIDIAN).setItemName("ObsidianAxe");
ObsidianSpade = new ItemMekanismSpade(11265, toolOBSIDIAN).setItemName("ObsidianSpade");
ObsidianHoe = new ItemMekanismHoe(11266, toolOBSIDIAN).setItemName("ObsidianHoe");
ObsidianSword = new ItemMekanismSword(11267, toolOBSIDIAN).setItemName("ObsidianSword");
LazuliPaxel = new ItemMekanismPaxel(11268, toolLAZULI2).setItemName("LazuliPaxel");
LazuliPickaxe = new ItemMekanismPickaxe(11269, toolLAZULI).setItemName("LazuliPickaxe");
LazuliAxe = new ItemMekanismAxe(11270, toolLAZULI).setItemName("LazuliAxe");
LazuliSpade = new ItemMekanismSpade(11271, toolLAZULI).setItemName("LazuliSpade");
LazuliHoe = new ItemMekanismHoe(11272, toolLAZULI).setItemName("LazuliHoe");
LazuliSword = new ItemMekanismSword(11273, toolLAZULI).setItemName("LazuliSword");
LazuliHelmet = (new ItemMekanismArmor(11274, armorLAZULI, proxy.getArmorIndex("lazuli"), 0)).setItemName("LazuliHelmet");
LazuliBody = (new ItemMekanismArmor(11275, armorLAZULI, proxy.getArmorIndex("lazuli"), 1)).setItemName("LazuliBody");
LazuliLegs = (new ItemMekanismArmor(11276, armorLAZULI, proxy.getArmorIndex("lazuli"), 2)).setItemName("LazuliLegs");
LazuliBoots = (new ItemMekanismArmor(11277, armorLAZULI, proxy.getArmorIndex("lazuli"), 3)).setItemName("LazuliBoots");
ObsidianBow = new ItemMekanismBow(11279).setItemName("ObsidianBow");
if(extrasEnabled == true)
{
LightningRod = new ItemLightningRod(11280).setItemName("LightningRod");
Stopwatch = new ItemStopwatch(11281).setItemName("Stopwatch");
WeatherOrb = new ItemWeatherOrb(11282).setItemName("WeatherOrb");
EnrichedAlloy = new ItemObsidian(11313).setItemName("EnrichedAlloy").setCreativeTab(tabOBSIDIAN);
EnrichedAlloy = new ItemMekanism(11313).setItemName("EnrichedAlloy").setCreativeTab(tabMekanism);
}
WoodPaxel = new ItemObsidianPaxel(11283, EnumToolMaterial.WOOD).setItemName("WoodPaxel");
StonePaxel = new ItemObsidianPaxel(11284, EnumToolMaterial.STONE).setItemName("StonePaxel");
IronPaxel = new ItemObsidianPaxel(11285, EnumToolMaterial.IRON).setItemName("IronPaxel");
DiamondPaxel = new ItemObsidianPaxel(11286, EnumToolMaterial.EMERALD).setItemName("DiamondPaxel");
GoldPaxel = new ItemObsidianPaxel(11287, EnumToolMaterial.GOLD).setItemName("GoldPaxel");
WoodKnife = new ItemObsidianKnife(11288, EnumToolMaterial.WOOD).setItemName("WoodKnife");
StoneKnife = new ItemObsidianKnife(11289, EnumToolMaterial.STONE).setItemName("StoneKnife");
IronKnife = new ItemObsidianKnife(11290, EnumToolMaterial.IRON).setItemName("IronKnife");
DiamondKnife = new ItemObsidianKnife(11291, EnumToolMaterial.EMERALD).setItemName("DiamondKnife");
GoldKnife = new ItemObsidianKnife(11292, EnumToolMaterial.GOLD).setItemName("GoldKnife");
ObsidianKnife = new ItemObsidianKnife(11293, toolOBSIDIAN).setItemName("ObsidianKnife");
LazuliKnife = new ItemObsidianKnife(11294, toolLAZULI).setItemName("LazuliKnife");
PlatinumKnife = new ItemObsidianKnife(11295, toolPLATINUM).setItemName("PlatinumKnife");
RedstoneKnife = new ItemObsidianKnife(11296, toolREDSTONE).setItemName("RedstoneKnife");
WoodPaxel = new ItemMekanismPaxel(11283, EnumToolMaterial.WOOD).setItemName("WoodPaxel");
StonePaxel = new ItemMekanismPaxel(11284, EnumToolMaterial.STONE).setItemName("StonePaxel");
IronPaxel = new ItemMekanismPaxel(11285, EnumToolMaterial.IRON).setItemName("IronPaxel");
DiamondPaxel = new ItemMekanismPaxel(11286, EnumToolMaterial.EMERALD).setItemName("DiamondPaxel");
GoldPaxel = new ItemMekanismPaxel(11287, EnumToolMaterial.GOLD).setItemName("GoldPaxel");
WoodKnife = new ItemMekanismKnife(11288, EnumToolMaterial.WOOD).setItemName("WoodKnife");
StoneKnife = new ItemMekanismKnife(11289, EnumToolMaterial.STONE).setItemName("StoneKnife");
IronKnife = new ItemMekanismKnife(11290, EnumToolMaterial.IRON).setItemName("IronKnife");
DiamondKnife = new ItemMekanismKnife(11291, EnumToolMaterial.EMERALD).setItemName("DiamondKnife");
GoldKnife = new ItemMekanismKnife(11292, EnumToolMaterial.GOLD).setItemName("GoldKnife");
ObsidianKnife = new ItemMekanismKnife(11293, toolOBSIDIAN).setItemName("ObsidianKnife");
LazuliKnife = new ItemMekanismKnife(11294, toolLAZULI).setItemName("LazuliKnife");
PlatinumKnife = new ItemMekanismKnife(11295, toolPLATINUM).setItemName("PlatinumKnife");
RedstoneKnife = new ItemMekanismKnife(11296, toolREDSTONE).setItemName("RedstoneKnife");
Dust = new ItemDust(11297-256);
Ingot = new ItemIngot(11298-256);
GlowstonePaxel = new ItemObsidianPaxel(11302, toolGLOWSTONE2).setItemName("GlowstonePaxel");
GlowstonePickaxe = new ItemObsidianPickaxe(11303, toolGLOWSTONE).setItemName("GlowstonePickaxe");
GlowstoneAxe = new ItemObsidianAxe(11304, toolGLOWSTONE).setItemName("GlowstoneAxe");
GlowstoneSpade = new ItemObsidianSpade(11305, toolGLOWSTONE).setItemName("GlowstoneSpade");
GlowstoneHoe = new ItemObsidianHoe(11306, toolGLOWSTONE).setItemName("GlowstoneHoe");
GlowstoneSword = new ItemObsidianSword(11307, toolGLOWSTONE).setItemName("GlowstoneSword");
GlowstoneHelmet = new ItemObsidianArmor(11308, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 0).setItemName("GlowstoneHelmet");
GlowstoneBody = new ItemObsidianArmor(11309, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 1).setItemName("GlowstoneBody");
GlowstoneLegs = new ItemObsidianArmor(11310, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 2).setItemName("GlowstoneLegs");
GlowstoneBoots = new ItemObsidianArmor(11311, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 3).setItemName("GlowstoneBoots");
GlowstoneKnife = new ItemObsidianKnife(11312, toolGLOWSTONE).setItemName("GlowstoneKnife");
GlowstonePaxel = new ItemMekanismPaxel(11302, toolGLOWSTONE2).setItemName("GlowstonePaxel");
GlowstonePickaxe = new ItemMekanismPickaxe(11303, toolGLOWSTONE).setItemName("GlowstonePickaxe");
GlowstoneAxe = new ItemMekanismAxe(11304, toolGLOWSTONE).setItemName("GlowstoneAxe");
GlowstoneSpade = new ItemMekanismSpade(11305, toolGLOWSTONE).setItemName("GlowstoneSpade");
GlowstoneHoe = new ItemMekanismHoe(11306, toolGLOWSTONE).setItemName("GlowstoneHoe");
GlowstoneSword = new ItemMekanismSword(11307, toolGLOWSTONE).setItemName("GlowstoneSword");
GlowstoneHelmet = new ItemMekanismArmor(11308, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 0).setItemName("GlowstoneHelmet");
GlowstoneBody = new ItemMekanismArmor(11309, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 1).setItemName("GlowstoneBody");
GlowstoneLegs = new ItemMekanismArmor(11310, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 2).setItemName("GlowstoneLegs");
GlowstoneBoots = new ItemMekanismArmor(11311, armorGLOWSTONE, proxy.getArmorIndex("glowstone"), 3).setItemName("GlowstoneBoots");
GlowstoneKnife = new ItemMekanismKnife(11312, toolGLOWSTONE).setItemName("GlowstoneKnife");
EnergyTablet = (ItemEnergized) new ItemEnergized(11314, 50000, 100, 500).setItemName("EnergyTablet");
EnergyOrb = (ItemEnergized) new ItemEnergized(11315, 15000000, 1000, 150000).setItemName("EnergyOrb");
EnergyCube = (ItemEnergized) new ItemEnergized(11316, 12000, 100, 120).setItemName("EnergyCube");
@ -898,7 +900,7 @@ public class ObsidianIngots
OreBlock = new BlockOre(oreBlockID).setBlockName("OreBlock");
PowerUnit = new BlockPowerUnit(powerUnitID).setBlockName("PowerUnit");
Generator = new BlockGenerator(generatorID).setBlockName("Generator");
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(tabOBSIDIAN);
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(tabMekanism);
//Registrations
GameRegistry.registerBlock(ObsidianTNT);
@ -998,11 +1000,11 @@ public class ObsidianIngots
@PostInit
public void postInit(FMLPostInitializationEvent event)
{
hooks = new ObsidianHooks();
hooks = new MekanismHooks();
hooks.hook();
addIntegratedItems();
System.out.println("[ObsidianIngots] Hooking complete.");
System.out.println("[Mekanism] Hooking complete.");
proxy.loadSoundHandler();
}
@ -1016,14 +1018,14 @@ public class ObsidianIngots
NetworkRegistry.instance().registerGuiHandler(this, new CommonGuiHandler());
//Register the MachineryManager
manager = new MachineryManager();
System.out.println("[ObsidianIngots] Version " + versionNumber + " initializing...");
System.out.println("[Mekanism] Version " + versionNumber + " initializing...");
new ThreadGetData();
proxy.registerRenderInformation();
proxy.loadConfiguration();
proxy.loadUtilities();
proxy.loadTickHandler();
LanguageRegistry.instance().addStringLocalization("itemGroup.tabObsidian", "Obsidian Ingots");
LanguageRegistry.instance().addStringLocalization("itemGroup.tabMekanism", "Mekanism");
//Attempt to load server commands
try {
@ -1032,29 +1034,29 @@ public class ObsidianIngots
//Add all items
addItems();
System.out.println("[ObsidianIngots] Items loaded.");
System.out.println("[Mekanism] Items loaded.");
//Add all blocks
addBlocks();
System.out.println("[ObsidianIngots] Blocks loaded.");
System.out.println("[Mekanism] Blocks loaded.");
//Set item and block names
addNames();
System.out.println("[ObsidianIngots] Names loaded.");
System.out.println("[Mekanism] Names loaded.");
//Set item and block textures
addTextures();
System.out.println("[ObsidianIngots] Textures loaded.");
System.out.println("[Mekanism] Textures loaded.");
//Set item and block recipes
addRecipes();
System.out.println("[ObsidianIngots] Recipes loaded.");
System.out.println("[Mekanism] Recipes loaded.");
//Set up entities to run on SSP and SMP
addEntities();
System.out.println("[ObsidianIngots] Entities loaded.");
System.out.println("[Mekanism] Entities loaded.");
//Success message
logger.info("[ObsidianIngots] Mod loaded.");
logger.info("[Mekanism] Mod loaded.");
}
}

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import railcraft.common.api.core.items.ItemRegistry;
import ic2.api.Ic2Recipes;
import net.minecraft.src.*;
/**
* Hooks for Obsidian Ingots. Use to grab items or blocks out of different mods.
* Hooks for Mekanism. Use to grab items or blocks out of different mods.
* @author AidanBrady
*
*/
public class ObsidianHooks
public class MekanismHooks
{
private Class Ic2Items;
private Class IC2;
@ -31,27 +31,27 @@ public class ObsidianHooks
{
if(isIC2Installed()) IC2Loaded = true;
if(isRailcraftInstalled()) RailcraftLoaded = true;
if(isUEInstalled()) BCLoaded = true;
if(isBCInstalled()) BCLoaded = true;
if(IC2Loaded)
{
IC2IronDust = getIC2Item("ironDust");
IC2GoldDust = getIC2Item("goldDust");
Ic2Recipes.addMaceratorRecipe(new ItemStack(ObsidianIngots.OreBlock, 1, 0), new ItemStack(ObsidianIngots.Dust, 2, 2));
Ic2Recipes.addMatterAmplifier(ObsidianIngots.EnrichedAlloy, 100000);
Ic2Recipes.addMaceratorRecipe(new ItemStack(Mekanism.OreBlock, 1, 0), new ItemStack(Mekanism.Dust, 2, 2));
Ic2Recipes.addMatterAmplifier(Mekanism.EnrichedAlloy, 100000);
System.out.println("[ObsidianIngots] Hooked into IC2 successfully.");
System.out.println("[Mekanism] Hooked into IC2 successfully.");
}
if(RailcraftLoaded)
{
RailcraftObsidianDust = getRailcraftItem("dust.obsidian");
System.out.println("[ObsidianIngots] Hooked into Railcraft successfully.");
System.out.println("[Mekanism] Hooked into Railcraft successfully.");
}
if(BCLoaded)
{
System.out.println("[ObsidianIngots] Hooked into BasicComponents successfully.");
System.out.println("[Mekanism] Hooked into BasicComponents successfully.");
}
}
@ -76,7 +76,7 @@ public class ObsidianHooks
return null;
}
} catch(Exception e) {
System.out.println("[ObsidianIngots] Unable to retrieve IC2 item " + name + ".");
System.out.println("[Mekanism] Unable to retrieve IC2 item " + name + ".");
return null;
}
}
@ -99,7 +99,7 @@ public class ObsidianHooks
}
return false;
} catch(Exception e) {
System.out.println("[ObsidianIngots] Unable to hook into IC2.");
System.out.println("[Mekanism] Unable to hook into IC2.");
return false;
}
}
@ -116,12 +116,12 @@ public class ObsidianHooks
}
return false;
} catch(Exception e) {
System.out.println("[ObsidianIngots] Unable to hook into Railcraft.");
System.out.println("[Mekanism] Unable to hook into Railcraft.");
return false;
}
}
public boolean isUEInstalled()
public boolean isBCInstalled()
{
try {
if(BCLoader == null) BCLoader = Class.forName("basiccomponents.BCLoader");
@ -133,7 +133,7 @@ public class ObsidianHooks
}
return false;
} catch(Exception e) {
System.out.println("[ObsidianIngots] Unable to hook into BasicComponents.");
System.out.println("[Mekanism] Unable to hook into BasicComponents.");
return false;
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
@ -16,28 +16,32 @@ import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.server.FMLServerHandler;
import mekanism.client.ThreadSendData;
import net.minecraft.src.*;
import net.uberkat.obsidian.client.ThreadSendData;
/**
* Utilities used by Obsidian Ingots. All miscellaneous methods are located here.
* Utilities used by Mekanism. All miscellaneous methods are located here.
* @author AidanBrady
*
*/
public class ObsidianUtils
public class MekanismUtils
{
/**
* Checks for a new version of Obsidian Ingots.
* Checks for a new version of Mekanism.
*/
public static void checkForUpdates(EntityPlayer entityplayer)
{
if(!(ObsidianIngots.latestVersionNumber.equals("Error retrieving data.")) && !(ObsidianIngots.latestVersionNumber.equals(ObsidianIngots.versionNumber.toString())))
if(!Mekanism.latestVersionNumber.equals("Error retrieving data."))
{
entityplayer.addChatMessage(EnumColor.GREY.code + "Your version of " + EnumColor.DARK_BLUE.code + "Obsidian Ingots " + EnumColor.GREY.code + "(" + EnumColor.DARK_GREY.code + ObsidianIngots.versionNumber.toString() + EnumColor.GREY.code + ") is outdated. Please update to version " + EnumColor.DARK_GREY.code + ObsidianIngots.latestVersionNumber);
if(!Mekanism.latestVersionNumber.equals(Mekanism.versionNumber))
{
entityplayer.addChatMessage(EnumColor.GREY + "Your version of " + EnumColor.DARK_BLUE + "Mekanism " + EnumColor.GREY + "(" + EnumColor.DARK_GREY + Mekanism.versionNumber + EnumColor.GREY + ") is outdated. Please update to version " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber);
return;
}
else if(ObsidianIngots.latestVersionNumber.equals("Error retrieving data."))
{
System.out.println("[ObsidianIngots] Minecraft is in offline mode, could not check for updates.");
}
else {
System.out.println("[Mekanism] Minecraft is in offline mode, could not check for updates.");
return;
}
}
@ -82,7 +86,7 @@ public class ObsidianUtils
{
if(energy == 0)
{
return EnumColor.DARK_RED.code + energy + " u" + EnumColor.DARK_GREY.code;
return EnumColor.DARK_RED + "" + energy + " u" + EnumColor.DARK_GREY;
}
else if(energy < 1000)
{
@ -115,7 +119,7 @@ public class ObsidianUtils
*/
public static String getLatestVersion()
{
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/ObsidianIngots.txt").split(":");
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt").split(":");
if(!text[0].contains("UTF-8") && !text[0].contains("HTML")) return text[0];
return "Error retrieving data.";
}
@ -126,7 +130,7 @@ public class ObsidianUtils
*/
public static String getRecentNews()
{
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/ObsidianIngots.txt").split(":");
String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt").split(":");
if(text.length > 1 && !text[1].contains("UTF-8") && !text[1].contains("HTML")) return text[1];
return "There is no news to show.";
}
@ -156,7 +160,7 @@ public class ObsidianUtils
rd.close();
} catch (Exception e) {
result = "Error retrieving data.";
System.err.println("[ObsidianIngots] An error occured while connecting to URL '" + urlToRead + ".'");
System.err.println("[Mekanism] An error occured while connecting to URL '" + urlToRead + ".'");
}
return result;
}
@ -182,7 +186,7 @@ public class ObsidianUtils
*/
public static boolean isLatestVersion()
{
return ObsidianIngots.versionNumber.toString().equals(ObsidianIngots.latestVersionNumber);
return Mekanism.versionNumber.toString().equals(Mekanism.latestVersionNumber);
}
/**

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.Random;
@ -25,21 +25,21 @@ public class OreHandler implements IWorldGenerator
*/
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
if(ObsidianIngots.oreGenerationEnabled == true)
if(Mekanism.oreGenerationEnabled == true)
{
for(int i=0;i<6;i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(new ItemStack(ObsidianIngots.OreBlock, 1, 0).itemID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 0).itemID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i=0;i<2;i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(new ItemStack(ObsidianIngots.OreBlock, 1, 1).itemID, 6)).generate(world, random, randPosX, randPosY, randPosZ);
(new WorldGenMinable(new ItemStack(Mekanism.OreBlock, 1, 1).itemID, 6)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -6,11 +6,11 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import obsidian.api.ITileNetwork;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
import mekanism.api.ITileNetwork;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet;
@ -24,7 +24,7 @@ import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.server.FMLServerHandler;
/**
* Obsidian Ingots packet handler. As always, use packets sparingly!
* Mekanism packet handler. As always, use packets sparingly!
* @author AidanBrady
*
*/
@ -35,19 +35,19 @@ public class PacketHandler implements IPacketHandler
ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data);
EntityPlayer entityplayer = (EntityPlayer)player;
if(packet.channel.equals("ObsidianIngots"))
if(packet.channel.equals("Mekanism"))
{
try {
int packetType = dataStream.readInt();
if(packetType == EnumPacketType.TIME.id)
{
System.out.println("[ObsidianIngots] Received time update packet from " + entityplayer.username + ".");
ObsidianUtils.setHourForward(FMLServerHandler.instance().getServer().worldServerForDimension(0), dataStream.readInt());
System.out.println("[Mekanism] Received time update packet from " + entityplayer.username + ".");
MekanismUtils.setHourForward(FMLServerHandler.instance().getServer().worldServerForDimension(0), dataStream.readInt());
}
if(packetType == EnumPacketType.WEATHER.id)
{
System.out.println("[ObsidianIngots] Received weather update packet from " + entityplayer.username + ".");
System.out.println("[Mekanism] Received weather update packet from " + entityplayer.username + ".");
int weatherType = dataStream.readInt();
if(weatherType == EnumWeatherType.CLEAR.id)
{
@ -83,17 +83,21 @@ public class PacketHandler implements IPacketHandler
}
} catch (Exception e)
{
System.err.println("[ObsidianIngots] Error while handling tile entity packet.");
System.err.println("[Mekanism] Error while handling tile entity packet.");
e.printStackTrace();
}
}
}
catch (Exception e)
{
System.err.println("[ObsidianIngots] Error while handling data int packet.");
System.err.println("[Mekanism] Error while handling data int packet.");
e.printStackTrace();
}
}
else if(packet.channel.equals("MekanismUE"))
{
}
}
/**
@ -119,12 +123,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.currentTicksRequired);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -158,12 +162,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.currentTicksRequired);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -195,12 +199,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.currentTicksRequired);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -236,12 +240,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.currentTicksRequired);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -267,12 +271,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.energyStored);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -302,12 +306,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.energyStored);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -334,12 +338,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.fuelStored);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -370,12 +374,12 @@ public class PacketHandler implements IPacketHandler
output.writeInt(sender.fuelStored);
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
System.err.println("[Mekanism] Error while writing tile entity packet.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
@ -395,14 +399,14 @@ public class PacketHandler implements IPacketHandler
data.writeInt(type.id);
data.writeInt(i);
} catch (IOException e) {
System.out.println("[ObsidianIngots] An error occured while writing packet data.");
System.out.println("[Mekanism] An error occured while writing packet data.");
e.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "ObsidianIngots";
packet.channel = "Mekanism";
packet.data = bytes.toByteArray();
packet.length = packet.data.length;
PacketDispatcher.sendPacketToServer(packet);
System.out.println("[ObsidianIngots] Sent data int packet '" + i + "' to server");
System.out.println("[Mekanism] Sent data int packet '" + i + "' to server");
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.*;
import net.minecraft.src.*;

View file

@ -1,10 +1,10 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import net.minecraft.src.ServerCommandManager;
import cpw.mods.fml.common.FMLCommonHandler;
/**
* Handler to handle all incoming Obsidian Ingots commands.
* Handler to handle all incoming Mekanism commands.
* @author AidanBrady
*
*/
@ -19,7 +19,7 @@ public class ServerCommandHandler
initialized = true;
ServerCommandManager manager = (ServerCommandManager)FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
manager.registerCommand(new CommandOI());
manager.registerCommand(new CommandMekanism());
}
}
}

View file

@ -1,8 +1,8 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import obsidian.api.IEnergizedItem;
import universalelectricity.implement.IItemElectric;
import ic2.api.IElectricItem;
import mekanism.api.IEnergizedItem;
import net.minecraft.src.*;
public class SlotEnergy extends Slot

View file

@ -1,7 +1,7 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import mekanism.api.ItemMachineUpgrade;
import net.minecraft.src.*;
import obsidian.api.ItemMachineUpgrade;
public class SlotMachineUpgrade extends Slot
{

View file

@ -0,0 +1,27 @@
package mekanism.common;
/**
* Thread used to retrieve data from the Mekanism server.
* @author AidanBrady
*
*/
public class ThreadGetData extends Thread
{
public ThreadGetData()
{
setDaemon(true);
start();
}
public void run()
{
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion();
Mekanism.recentNews = MekanismUtils.getRecentNews();
System.out.println("[Mekanism] Successfully retrieved data from server.");
try {
finalize();
} catch(Throwable t) {
System.out.println("[Mekanism] Unable to finalize server data.");
}
}
}

View file

@ -1,11 +1,10 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.List;
import obsidian.api.IEnergizedItem;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.electricity.ElectricInfo;
@ -22,6 +21,7 @@ import ic2.api.ElectricItem;
import ic2.api.EnergyNet;
import ic2.api.IElectricItem;
import ic2.api.IWrenchable;
import mekanism.api.IEnergizedItem;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
@ -151,21 +151,21 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
int energyToAdd = 0;
int ticksToRemove = 0;
if(inventory[4].isItemEqual(new ItemStack(ObsidianIngots.SpeedUpgrade)))
if(inventory[4].isItemEqual(new ItemStack(Mekanism.SpeedUpgrade)))
{
if(currentTicksRequired == TICKS_REQUIRED)
{
ticksToRemove = 150;
}
}
else if(inventory[4].isItemEqual(new ItemStack(ObsidianIngots.EnergyUpgrade)))
else if(inventory[4].isItemEqual(new ItemStack(Mekanism.EnergyUpgrade)))
{
if(currentMaxEnergy == MAX_ENERGY)
{
energyToAdd = 600;
}
}
else if(inventory[4].isItemEqual(new ItemStack(ObsidianIngots.UltimateUpgrade)))
else if(inventory[4].isItemEqual(new ItemStack(Mekanism.UltimateUpgrade)))
{
if(currentTicksRequired == TICKS_REQUIRED)
{
@ -340,7 +340,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
} catch (Exception e)
{
System.out.println("[ObsidianIngots] Error while handling tile entity packet.");
System.out.println("[Mekanism] Error while handling tile entity packet.");
e.printStackTrace();
}
}
@ -404,7 +404,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
case 7:
return new Object[] {(currentMaxEnergy-energyStored)};
default:
System.err.println("[ObsidianIngots] Attempted to call unknown method with computer ID " + computer.getID());
System.err.println("[Mekanism] Attempted to call unknown method with computer ID " + computer.getID());
return new Object[] {"Unknown command."};
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
public class TileEntityAdvancedPowerUnit extends TileEntityPowerUnit
{

View file

@ -1,6 +1,5 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import obsidian.api.IElectricMachine;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.electricity.ElectricInfo;
import universalelectricity.electricity.ElectricityManager;
@ -20,10 +19,11 @@ import dan200.computer.api.IComputerAccess;
import ic2.api.Direction;
import ic2.api.EnergyNet;
import ic2.api.IWrenchable;
import mekanism.api.IElectricMachine;
import mekanism.client.Sound;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
import net.uberkat.obsidian.client.Sound;
public abstract class TileEntityBasicMachine extends TileEntityElectricBlock implements IElectricMachine
{
@ -91,7 +91,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
{
if(!registered && worldObj != null && !worldObj.isRemote)
{
ObsidianIngots.manager.register(this);
Mekanism.manager.register(this);
registered = true;
}
@ -109,7 +109,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
{
if(FMLClientHandler.instance().getClient().sndManager.sndSystem != null)
{
audio = ObsidianIngots.audioHandler.getSound(fullName.replace(" ", ""), soundURL, worldObj, xCoord, yCoord, zCoord);
audio = Mekanism.audioHandler.getSound(fullName.replace(" ", ""), soundURL, worldObj, xCoord, yCoord, zCoord);
}
}
@ -158,7 +158,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
super.invalidate();
if(!worldObj.isRemote && registered)
{
ObsidianIngots.manager.remove(this);
Mekanism.manager.remove(this);
registered = false;
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Vector;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Vector;

View file

@ -1,10 +1,10 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import buildcraft.api.power.PowerFramework;
import obsidian.api.ITileNetwork;
import universalelectricity.prefab.TileEntityDisableable;
import ic2.api.EnergyNet;
import ic2.api.IWrenchable;
import mekanism.api.ITileNetwork;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
@ -51,7 +51,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
{
if(!initialized && worldObj != null)
{
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
EnergyNet.getForWorld(worldObj).addTileEntity(this);
}
@ -221,7 +221,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
{
if(initialized)
{
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
EnergyNet.getForWorld(worldObj).removeTileEntity(this);
}
@ -230,7 +230,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
initialized = false;
facing = direction;
sendPacket();
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
EnergyNet.getForWorld(worldObj).addTileEntity(this);
}

View file

@ -1,11 +1,10 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.List;
import obsidian.api.IEnergizedItem;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.electricity.ElectricInfo;
@ -22,6 +21,7 @@ import ic2.api.ElectricItem;
import ic2.api.EnergyNet;
import ic2.api.IElectricItem;
import ic2.api.IWrenchable;
import mekanism.api.IEnergizedItem;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
@ -107,21 +107,21 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
int energyToAdd = 0;
int ticksToRemove = 0;
if(inventory[3].isItemEqual(new ItemStack(ObsidianIngots.SpeedUpgrade)))
if(inventory[3].isItemEqual(new ItemStack(Mekanism.SpeedUpgrade)))
{
if(currentTicksRequired == TICKS_REQUIRED)
{
ticksToRemove = 150;
}
}
else if(inventory[3].isItemEqual(new ItemStack(ObsidianIngots.EnergyUpgrade)))
else if(inventory[3].isItemEqual(new ItemStack(Mekanism.EnergyUpgrade)))
{
if(currentMaxEnergy == MAX_ENERGY)
{
energyToAdd = 600;
}
}
else if(inventory[3].isItemEqual(new ItemStack(ObsidianIngots.UltimateUpgrade)))
else if(inventory[3].isItemEqual(new ItemStack(Mekanism.UltimateUpgrade)))
{
if(currentTicksRequired == TICKS_REQUIRED)
{
@ -278,7 +278,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
} catch (Exception e)
{
System.out.println("[ObsidianIngots] Error while handling tile entity packet.");
System.out.println("[Mekanism] Error while handling tile entity packet.");
e.printStackTrace();
}
}
@ -307,7 +307,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
case 6:
return new Object[] {(currentMaxEnergy-energyStored)};
default:
System.err.println("[ObsidianIngots] Attempted to call unknown method with computer ID " + computer.getID());
System.err.println("[Mekanism] Attempted to call unknown method with computer ID " + computer.getID());
return new Object[] {"Unknown command."};
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Vector;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import buildcraft.api.core.Orientations;
import buildcraft.api.power.IPowerProvider;
@ -17,8 +17,6 @@ import ic2.api.EnergyNet;
import ic2.api.IElectricItem;
import ic2.api.IEnergySource;
import ic2.api.IEnergyStorage;
import obsidian.api.IEnergizedItem;
import obsidian.api.IEnergyAcceptor;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.core.Vector3;
import universalelectricity.electricity.ElectricInfo;
@ -28,6 +26,8 @@ import universalelectricity.implement.IElectricityReceiver;
import universalelectricity.implement.IItemElectric;
import universalelectricity.implement.IJouleStorage;
import universalelectricity.prefab.TileEntityConductor;
import mekanism.api.IEnergizedItem;
import mekanism.api.IEnergyAcceptor;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
@ -138,7 +138,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
{
TileEntity tileEntity = Vector3.getTileEntityFromSide(worldObj, Vector3.get(this), ForgeDirection.getOrientation(facing));
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
if(energyStored >= output)
{
@ -358,7 +358,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
} catch (Exception e)
{
System.out.println("[ObsidianIngots] Error while handling tile entity packet.");
System.out.println("[Mekanism] Error while handling tile entity packet.");
e.printStackTrace();
}
}
@ -400,7 +400,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
case 5:
return new Object[] {MAX_FUEL-fuelStored};
default:
System.err.println("[ObsidianIngots] Attempted to call unknown method with computer ID " + computer.getID());
System.err.println("[Mekanism] Attempted to call unknown method with computer ID " + computer.getID());
return null;
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import com.google.common.io.ByteArrayDataInput;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Vector;
@ -27,7 +27,7 @@ public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMach
public int getFuelTicks(ItemStack itemstack)
{
if (itemstack.itemID == new ItemStack(ObsidianIngots.Ingot, 1, 1).itemID) return 200;
if (itemstack.itemID == new ItemStack(Mekanism.Ingot, 1, 1).itemID) return 200;
return 0;
}
}

View file

@ -1,12 +1,9 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import obsidian.api.IEnergizedItem;
import obsidian.api.ITileNetwork;
import obsidian.api.IEnergyAcceptor;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.core.Vector3;
@ -38,6 +35,9 @@ import ic2.api.IEnergySource;
import ic2.api.IEnergyStorage;
import ic2.api.IWrenchable;
import ic2.api.IElectricItem;
import mekanism.api.IEnergizedItem;
import mekanism.api.IEnergyAcceptor;
import mekanism.api.ITileNetwork;
import net.minecraft.src.*;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
@ -169,7 +169,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
{
TileEntity tileEntity = Vector3.getTileEntityFromSide(worldObj, Vector3.get(this), ForgeDirection.getOrientation(facing));
if(ObsidianIngots.hooks.IC2Loaded)
if(Mekanism.hooks.IC2Loaded)
{
if(energyStored >= output)
{
@ -291,7 +291,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
} catch (Exception e)
{
System.out.println("[ObsidianIngots] Error while handling tile entity packet.");
System.out.println("[Mekanism] Error while handling tile entity packet.");
e.printStackTrace();
}
}
@ -456,7 +456,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
case 3:
return new Object[] {(MAX_ENERGY-energyStored)};
default:
System.err.println("[ObsidianIngots] Attempted to call unknown method with computer ID " + computer.getID());
System.err.println("[Mekanism] Attempted to call unknown method with computer ID " + computer.getID());
return null;
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.common;
package mekanism.common;
import java.util.List;
import java.util.Random;
@ -30,9 +30,9 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
{
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 Mekanism.LightningRod;
if(random == 1) return Mekanism.Stopwatch;
if(random == 2) return Mekanism.WeatherOrb;
return Mekanism.EnrichedAlloy;
}
}

View file

@ -1,7 +1,7 @@
package net.uberkat.obsidian.common;
package mekanism.common;
/**
* Version v1.0.3. Simple version handling for Obsidian Ingots.
* Version v1.0.4. Simple version handling for Mekanism.
* @author AidanBrady
*
*/
@ -27,18 +27,6 @@ public class Version
build = buildNum;
}
/**
* Creates a version number with 3 digits from a string, by splitting with the char '.'
* @param version - version number as a String
*/
public Version(String version)
{
String[] numbers = version.split(".");
major = Integer.getInteger(numbers[0]);
minor = Integer.getInteger(numbers[1]);
build = Integer.getInteger(numbers[2]);
}
/**
* Resets the version number to "0.0.0."
*/

View file

@ -1,16 +0,0 @@
package net.uberkat.obsidian.common;
import net.minecraft.src.*;
public class CreativeTabOI extends CreativeTabs
{
public CreativeTabOI()
{
super("tabObsidian");
}
public ItemStack getIconItemStack()
{
return new ItemStack(ObsidianIngots.Ingot, 1, 0);
}
}

View file

@ -1,16 +0,0 @@
package net.uberkat.obsidian.common;
import net.minecraft.src.*;
public class ItemObsidian extends Item
{
public ItemObsidian(int i)
{
super(i);
setCreativeTab(ObsidianIngots.tabOBSIDIAN);
}
public String getTextureFile() {
return "/textures/items.png";
}
}

View file

@ -1,27 +0,0 @@
package net.uberkat.obsidian.common;
/**
* Thread used to retrieve data from the Obsidian Ingots server.
* @author AidanBrady
*
*/
public class ThreadGetData extends Thread
{
public ThreadGetData()
{
setDaemon(true);
start();
}
public void run()
{
ObsidianIngots.latestVersionNumber = ObsidianUtils.getLatestVersion();
ObsidianIngots.recentNews = ObsidianUtils.getRecentNews();
System.out.println("[ObsidianIngots] Successfully retrieved data from server.");
try {
finalize();
} catch(Throwable t) {
System.out.println("[ObsidianIngots] Unable to finalize server data.");
}
}
}

View file

@ -1,93 +0,0 @@
package net.uberkat.obsidian.common;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import cpw.mods.fml.server.FMLServerHandler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.ICommandSender;
import net.minecraft.src.ModLoader;
import net.uberkat.obsidian.common.ObsidianIngots;
/**
* 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
*
*/
public class ThreadServerUpdate extends Thread
{
private ICommandSender sender;
private int bytesDownloaded;
private int lastBytesDownloaded;
private byte[] buffer = new byte[10240];
private URL url;
public ThreadServerUpdate(String location, ICommandSender player)
{
sender = player;
try {
url = new URL(location);
setDaemon(true);
start();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
public void run()
{
File download = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/mods/ObsidianIngots.jar").toString());
try {
prepareForDownload();
download.createNewFile();
FileOutputStream outputStream = new FileOutputStream(download.getAbsolutePath());
InputStream stream = url.openStream();
while((lastBytesDownloaded = stream.read(buffer)) > 0)
{
outputStream.write(buffer, 0, lastBytesDownloaded);
buffer = new byte[10240];
bytesDownloaded += lastBytesDownloaded;
}
outputStream.close();
stream.close();
sender.sendChatToPlayer(EnumColor.DARK_BLUE.code + "[ObsidianIngots] " + EnumColor.GREY.code + "Successfully updated to version " + EnumColor.DARK_GREY.code + ObsidianIngots.latestVersionNumber);
System.out.println("[ObsidianIngots] Successfully updated to latest version (" + ObsidianIngots.latestVersionNumber + ").");
finalize();
} catch(Throwable e)
{
sender.sendChatToPlayer(EnumColor.DARK_BLUE.code + "[ObsidianIngots] " + EnumColor.GREY.code + "Unable to update to version " + EnumColor.DARK_GREY.code + ObsidianIngots.latestVersionNumber);
System.err.println("[ObsidianIngots] Error while finishing update thread: " + e.getMessage());
try {
finalize();
} catch (Throwable e1) {
System.err.println("[ObsidianIngots] Error while finalizing update thread: " + e1.getMessage());
}
}
}
/**
* Prepares to update to the latest version of Obsidian Ingots by deleting the files "ObsidianIngots.cfg" and "ObsidianIngots.jar."
*/
public void prepareForDownload()
{
File download = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/mods/ObsidianIngots.jar").toString());
File config = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/config/ObsidianIngots.cfg").toString());
if(download.exists())
{
download.delete();
}
if(config.exists())
{
config.delete();
}
System.out.println("[ObsidianIngots] Preparing to update...");
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.io.File;
import java.io.FileInputStream;
@ -14,6 +14,18 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.TickRegistry;
import mekanism.common.CommonProxy;
import mekanism.common.EntityKnife;
import mekanism.common.EntityObsidianTNT;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityCombiner;
import mekanism.common.TileEntityCrusher;
import mekanism.common.TileEntityEnrichmentChamber;
import mekanism.common.TileEntityGenerator;
import mekanism.common.TileEntityPlatinumCompressor;
import mekanism.common.TileEntityPowerUnit;
import mekanism.common.TileEntityTheoreticalElementizer;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.EntityPlayer;
@ -23,21 +35,9 @@ import net.minecraft.src.ModLoader;
import net.minecraft.src.RenderBlocks;
import net.minecraft.src.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.uberkat.obsidian.common.CommonProxy;
import net.uberkat.obsidian.common.EntityKnife;
import net.uberkat.obsidian.common.EntityObsidianTNT;
import net.uberkat.obsidian.common.ObsidianIngots;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.TileEntityCombiner;
import net.uberkat.obsidian.common.TileEntityCrusher;
import net.uberkat.obsidian.common.TileEntityEnrichmentChamber;
import net.uberkat.obsidian.common.TileEntityGenerator;
import net.uberkat.obsidian.common.TileEntityPlatinumCompressor;
import net.uberkat.obsidian.common.TileEntityPowerUnit;
import net.uberkat.obsidian.common.TileEntityTheoreticalElementizer;
/**
* Client proxy for Obsidian Ingots mod.
* Client proxy for the Mekanism mod.
* @author AidanBrady
*
*/
@ -50,7 +50,7 @@ public class ClientProxy extends CommonProxy
public void registerRenderInformation()
{
System.out.println("[ObsidianIngots] Beginning render initiative...");
System.out.println("[Mekanism] Beginning render initiative...");
//Preload block/item textures
MinecraftForgeClient.preloadTexture("/textures/items.png");
@ -61,26 +61,22 @@ public class ClientProxy extends CommonProxy
MinecraftForgeClient.preloadTexture("/textures/ElementizerBack.png");
MinecraftForgeClient.preloadTexture("/textures/ElementizerSide.png");
//Hawk's Machines
MinecraftForgeClient.preloadTexture("/textures/hawk/blocks.png");
MinecraftForgeClient.preloadTexture("/textures/hawk/items.png");
//Register animated TextureFX for machines
try {
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CompressorFront.png", ObsidianIngots.ANIMATED_TEXTURE_INDEX));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CombinerFront.png", ObsidianIngots.ANIMATED_TEXTURE_INDEX+1));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerFront.png", ObsidianIngots.ANIMATED_TEXTURE_INDEX+2));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerBack.png", ObsidianIngots.ANIMATED_TEXTURE_INDEX+3));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerSide.png", ObsidianIngots.ANIMATED_TEXTURE_INDEX+4));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CompressorFront.png", Mekanism.ANIMATED_TEXTURE_INDEX));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/CombinerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+1));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+2));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerBack.png", Mekanism.ANIMATED_TEXTURE_INDEX+3));
TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/textures/ElementizerSide.png", Mekanism.ANIMATED_TEXTURE_INDEX+4));
} catch (IOException e) {
System.err.println("[ObsidianIngots] Error registering animation with FML: " + e.getMessage());
System.err.println("[Mekanism] Error registering animation with FML: " + e.getMessage());
}
//Register entity rendering handlers
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNT());
RenderingRegistry.registerEntityRenderingHandler(EntityKnife.class, new RenderKnife());
System.out.println("[ObsidianIngots] Render initiative complete.");
System.out.println("[Mekanism] Render initiative complete.");
}
public World getClientWorld()
@ -90,9 +86,9 @@ public class ClientProxy extends CommonProxy
public void loadUtilities()
{
System.out.println("[ObsidianIngots] Beginning utility initiative...");
System.out.println("[Mekanism] Beginning utility initiative...");
new ThreadSendData();
System.out.println("[ObsidianIngots] Utility initiative complete.");
System.out.println("[Mekanism] Utility initiative complete.");
}
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
@ -139,6 +135,6 @@ public class ClientProxy extends CommonProxy
public void loadSoundHandler()
{
ObsidianIngots.audioHandler = new SoundHandler();
Mekanism.audioHandler = new SoundHandler();
}
}

View file

@ -1,17 +1,17 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.util.EnumSet;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
import net.minecraft.src.ModLoader;
import net.minecraftforge.common.MinecraftForge;
import net.uberkat.obsidian.common.ObsidianIngots;
import net.uberkat.obsidian.common.ObsidianUtils;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
/**
* Client-side tick handler for Obsidian Ingots. Used mainly for the update check upon startup.
* Client-side tick handler for Mekanism. Used mainly for the update check upon startup.
* @author AidanBrady
*
*/
@ -19,10 +19,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(Mekanism.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null)
{
ObsidianUtils.checkForUpdates(ModLoader.getMinecraftInstance().thePlayer);
ObsidianIngots.ticksPassed++;
MekanismUtils.checkForUpdates(ModLoader.getMinecraftInstance().thePlayer);
Mekanism.ticksPassed++;
}
}
@ -38,6 +38,6 @@ public class ClientTickHandler implements ITickHandler
public String getLabel()
{
return "ObsidianIngots";
return "Mekanism";
}
}

View file

@ -1,9 +1,10 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.ContainerAdvancedElectricMachine;
import mekanism.common.TileEntityAdvancedElectricMachine;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ContainerAdvancedElectricMachine;
import net.uberkat.obsidian.common.TileEntityAdvancedElectricMachine;
public class GuiAdvancedElectricMachine extends GuiContainer
{

View file

@ -1,15 +1,15 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import obsidian.api.IAccessibleGui;
import mekanism.api.IAccessibleGui;
import mekanism.common.EnumColor;
import mekanism.common.MekanismUtils;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.GuiTextField;
import net.minecraft.src.World;
import net.uberkat.obsidian.common.EnumColor;
import net.uberkat.obsidian.common.ObsidianUtils;
public class GuiControlPanel extends GuiScreen
{

View file

@ -1,14 +1,14 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.io.IOException;
import java.net.URL;
import org.lwjgl.Sys;
import mekanism.common.EnumColor;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.EnumColor;
import net.uberkat.obsidian.common.ObsidianIngots;
import net.uberkat.obsidian.common.ObsidianUtils;
public class GuiCredits extends GuiScreen {
@ -44,11 +44,11 @@ public class GuiCredits extends GuiScreen {
}
if(guibutton.id == 2)
{
if(!ObsidianUtils.isLatestVersion())
if(!MekanismUtils.isLatestVersion())
{
updateProgress = "Downloading latest version...";
guibutton.enabled = false;
new ThreadClientUpdate("http://dl.dropbox.com/u/90411166/ObsidianIngots.jar");
new ThreadClientUpdate("http://dl.dropbox.com/u/90411166/Mekanism.jar");
}
else {
updateProgress = "You already have the latest version.";
@ -68,12 +68,12 @@ public class GuiCredits extends GuiScreen {
public void drawScreen(int i, int j, float f)
{
drawDefaultBackground();
drawCenteredString(fontRenderer, EnumColor.DARK_BLUE + "Obsidian Ingots" + EnumColor.GREY + " by aidancbrady", width / 2, (height / 4 - 60) + 20, 0xffffff);
writeText(EnumColor.GREY + "Your version: " + (ObsidianUtils.isLatestVersion() ? ObsidianIngots.versionNumber.toString() : EnumColor.DARK_RED + ObsidianIngots.versionNumber.toString()) + EnumColor.GREY + " -- OUTDATED", 36);
writeText(EnumColor.GREY + "Newest version: " + ObsidianIngots.latestVersionNumber, 45);
drawCenteredString(fontRenderer, EnumColor.DARK_BLUE + "Mekanism" + EnumColor.GREY + " by aidancbrady", width / 2, (height / 4 - 60) + 20, 0xffffff);
writeText(EnumColor.GREY + "Your version: " + (MekanismUtils.isLatestVersion() ? Mekanism.versionNumber.toString() : EnumColor.DARK_RED + Mekanism.versionNumber.toString()) + EnumColor.GREY + " -- OUTDATED", 36);
writeText(EnumColor.GREY + "Newest version: " + Mekanism.latestVersionNumber, 45);
writeText(EnumColor.GREY + "*Developed on Mac OS X 10.8 Mountain Lion", 63);
writeText(EnumColor.GREY + "*Code, textures, and ideas by aidancbrady", 72);
writeText(EnumColor.GREY + "Recent news: " + EnumColor.DARK_BLUE + ObsidianIngots.recentNews, 81);
writeText(EnumColor.GREY + "Recent news: " + EnumColor.DARK_BLUE + Mekanism.recentNews, 81);
writeText(EnumColor.GREY + updateProgress, 99);
super.drawScreen(i, j, f);
}

View file

@ -1,9 +1,10 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.ContainerElectricMachine;
import mekanism.common.TileEntityElectricMachine;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ContainerElectricMachine;
import net.uberkat.obsidian.common.TileEntityElectricMachine;
public class GuiElectricMachine extends GuiContainer
{

View file

@ -1,11 +1,11 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.ContainerGenerator;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityGenerator;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ContainerGenerator;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.TileEntityGenerator;
public class GuiGenerator extends GuiContainer
{
@ -27,9 +27,9 @@ public class GuiGenerator extends GuiContainer
{
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
fontRenderer.drawString(ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY), 51, 26, 0x404040);
fontRenderer.drawString(MekanismUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY), 51, 26, 0x404040);
fontRenderer.drawString("Fuel: " + tileEntity.fuelStored, 51, 35, 0x404040);
fontRenderer.drawString("Out: " + ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.output), 51, 44, 0x404040);
fontRenderer.drawString("Out: " + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.output), 51, 44, 0x404040);
}
/**

View file

@ -1,11 +1,11 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.ContainerPowerUnit;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityPowerUnit;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ContainerPowerUnit;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.TileEntityPowerUnit;
public class GuiPowerUnit extends GuiContainer
{
@ -22,8 +22,8 @@ public class GuiPowerUnit extends GuiContainer
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
String capacityInfo = ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY);
String outputInfo = "Out: " + ObsidianUtils.getDisplayedEnergyNoColor(tileEntity.output) + "/t";
String capacityInfo = MekanismUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY);
String outputInfo = "Out: " + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.output) + "/t";
fontRenderer.drawString(tileEntity.getInvName(), 43, 6, 0x404040);
fontRenderer.drawString(capacityInfo, 45, 40, 0x404040);
fontRenderer.drawString(outputInfo, 45, 49, 0x404040);

View file

@ -1,11 +1,11 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.EnumPacketType;
import mekanism.common.MekanismUtils;
import mekanism.common.PacketHandler;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.EnumPacketType;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.PacketHandler;
public class GuiStopwatch extends GuiScreen {
@ -61,28 +61,28 @@ public class GuiStopwatch extends GuiScreen {
if(guibutton.id == 0)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.TIME, 0);
mc.displayGuiScreen(null);
}
if(guibutton.id == 1)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.TIME, 6);
mc.displayGuiScreen(null);
}
if(guibutton.id == 2)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.TIME, 12);
mc.displayGuiScreen(null);
}
if(guibutton.id == 3)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.TIME, 18);
mc.displayGuiScreen(null);
}

View file

@ -1,11 +1,12 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.ContainerAdvancedElectricMachine;
import mekanism.common.EnumColor;
import mekanism.common.MekanismUtils;
import mekanism.common.TileEntityTheoreticalElementizer;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.ContainerAdvancedElectricMachine;
import net.uberkat.obsidian.common.EnumColor;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.TileEntityTheoreticalElementizer;
public class GuiTheoreticalElementizer extends GuiAdvancedElectricMachine
{

View file

@ -1,12 +1,12 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.EnumPacketType;
import mekanism.common.EnumWeatherType;
import mekanism.common.MekanismUtils;
import mekanism.common.PacketHandler;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.EnumPacketType;
import net.uberkat.obsidian.common.EnumWeatherType;
import net.uberkat.obsidian.common.ObsidianUtils;
import net.uberkat.obsidian.common.PacketHandler;
public class GuiWeatherOrb extends GuiScreen {
@ -62,28 +62,28 @@ public class GuiWeatherOrb extends GuiScreen {
if(guibutton.id == 0)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.WEATHER, EnumWeatherType.CLEAR.id);
mc.displayGuiScreen(null);
}
if(guibutton.id == 1)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.WEATHER, EnumWeatherType.STORM.id);
mc.displayGuiScreen(null);
}
if(guibutton.id == 2)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.WEATHER, EnumWeatherType.HAZE.id);
mc.displayGuiScreen(null);
}
if(guibutton.id == 3)
{
player.inventory.getCurrentItem().damageItem(4999, player);
ObsidianUtils.doFakeEntityExplosion(player);
MekanismUtils.doFakeEntityExplosion(player);
PacketHandler.sendPacketDataInt(EnumPacketType.WEATHER, EnumWeatherType.RAIN.id);
mc.displayGuiScreen(null);
}

View file

@ -1,8 +1,9 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import org.lwjgl.opengl.GL11;
import mekanism.common.EntityKnife;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.EntityKnife;
import org.lwjgl.opengl.GL12;

View file

@ -1,8 +1,8 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import mekanism.common.EntityObsidianTNT;
import mekanism.common.Mekanism;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.EntityObsidianTNT;
import net.uberkat.obsidian.common.ObsidianIngots;
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("/textures/terrain.png");
blockRenderer.renderBlockAsItem(ObsidianIngots.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1));
blockRenderer.renderBlockAsItem(Mekanism.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(Mekanism.ObsidianTNT, 0, 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.io.File;
import java.net.URL;
@ -65,7 +65,7 @@ public class Sound
URL url = getClass().getClassLoader().getResource("sounds/" + sound);
if(url == null)
{
System.out.println("[ObsidianIngots] Invalid sound file: " + sound);
System.out.println("[Mekanism] Invalid sound file: " + sound);
}
soundSystem.newSource(false, id, url, sound, true, x, y, z, 0, 16F);

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.util.Random;
@ -7,7 +7,7 @@ import paulscode.sound.SoundSystem;
import net.minecraft.src.*;
/**
* SoundHandler - a class that handles all Sounds used by Obsidian Ingots.
* SoundHandler - a class that handles all Sounds used by Mekanism.
* Runs off of PaulsCode's SoundSystem.
* @author AidanBrady
*
@ -17,13 +17,13 @@ public class SoundHandler
/** The PaulsCode SoundSystem */
public SoundSystem soundSystem;
/** SoundHandler -- a class that handles all Sounds used by Obsidian Ingots. */
/** SoundHandler -- a class that handles all Sounds used by Mekanism. */
public SoundHandler()
{
if(soundSystem == null)
{
soundSystem = FMLClientHandler.instance().instance().getClient().sndManager.sndSystem;
System.out.println("[ObsidianIngots] Successfully set up SoundHandler.");
System.out.println("[Mekanism] Successfully set up SoundHandler.");
}
}

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.awt.image.BufferedImage;
import java.io.IOException;

View file

@ -1,4 +1,4 @@
package net.uberkat.obsidian.client;
package mekanism.client;
import java.io.File;
import java.io.FileOutputStream;
@ -7,10 +7,10 @@ import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import net.minecraft.src.ModLoader;
import net.uberkat.obsidian.common.ObsidianIngots;
import mekanism.common.Mekanism;
import net.minecraft.client.Minecraft;
/**
* Thread that downloads the latest release of Obsidian Ingots. The older file is deleted and the newly downloaded file takes it's place.
* Thread that downloads the latest release of Mekanism. The older file is deleted and the newly downloaded file takes it's place.
* @author AidanBrady
*
*/
@ -34,7 +34,7 @@ public class ThreadClientUpdate extends Thread
public void run()
{
File download = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/mods/ObsidianIngots.jar").toString());
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());
try {
prepareForDownload();
download.createNewFile();
@ -51,28 +51,28 @@ public class ThreadClientUpdate extends Thread
outputStream.close();
stream.close();
GuiCredits.onFinishedDownloading();
System.out.println("[ObsidianIngots] Successfully updated to latest version (" + ObsidianIngots.latestVersionNumber + ").");
System.out.println("[Mekanism] Successfully updated to latest version (" + Mekanism.latestVersionNumber + ").");
finalize();
} catch(Throwable e)
{
GuiCredits.onErrorDownloading();
System.err.println("[ObsidianIngots] Error while finishing update thread: " + e.getMessage());
System.err.println("[Mekanism] Error while finishing update thread: " + e.getMessage());
try {
finalize();
} catch (Throwable e1) {
System.err.println("[ObsidianIngots] Error while finalizing update thread: " + e1.getMessage());
System.err.println("[Mekanism] Error while finalizing update thread: " + e1.getMessage());
}
}
}
/**
* Prepares to update to the latest version of Obsidian Ingots by deleting the files "ObsidianIngots.cfg" and "ObsidianIngots.jar."
* Prepares to update to the latest version of Mekanism by deleting the files "Mekanism.cfg" and "Mekanism.jar."
*/
public void prepareForDownload()
{
File download = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/mods/ObsidianIngots.jar").toString());
File config = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/config/ObsidianIngots.cfg").toString());
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());
File config = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/config/Mekanism.cfg").toString());
if(download.exists())
{
@ -82,6 +82,6 @@ public class ThreadClientUpdate extends Thread
{
config.delete();
}
System.out.println("[ObsidianIngots] Preparing to update...");
System.out.println("[Mekanism] Preparing to update...");
}
}

View file

@ -0,0 +1,51 @@
package mekanism.client;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
import cpw.mods.fml.client.FMLClientHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismUtils;
import net.minecraft.src.ModLoader;
/**
* Sends information about this mod to the Mekanism server.
*/
public class ThreadSendData extends Thread
{
public ThreadSendData()
{
setDaemon(true);
start();
}
public void run()
{
System.out.println("[Mekanism] Initiating server protocol...");
try {
InetAddress address = InetAddress.getByName(Mekanism.hostIP);
Socket socket = new Socket(address, Mekanism.hostPort);
PrintWriter writer = new PrintWriter(socket.getOutputStream());
writer.println("USER:" + FMLClientHandler.instance().getClient().session.username);
writer.println("DONE");
writer.close();
socket.close();
try {
finalize();
} catch (Throwable e) {
System.err.println("[Mekanism] Could not end server thread, error was '" + e.getMessage() + ".'");
}
} catch (IOException e)
{
System.err.println("[Mekanism] Could not connect to server, error was '" + e.getMessage() + ".'");
try {
finalize();
} catch (Throwable e1) {
System.err.println("[Mekanism] Could not end server thread, error was '" + e.getMessage() + ".'");
}
}
}
}

View file

@ -1,51 +0,0 @@
package net.uberkat.obsidian.client;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
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.ObsidianUtils;
/**
* Sends information about this mod to the Obsidian Ingots server.
*/
public class ThreadSendData extends Thread
{
public ThreadSendData()
{
setDaemon(true);
start();
}
public void run()
{
System.out.println("[ObsidianIngots] Initiating server protocol...");
try {
InetAddress address = InetAddress.getByName(ObsidianIngots.hostIP);
Socket socket = new Socket(address, ObsidianIngots.hostPort);
PrintWriter writer = new PrintWriter(socket.getOutputStream());
writer.println("USER:" + FMLClientHandler.instance().getClient().session.username);
writer.println("DONE");
writer.close();
socket.close();
try {
finalize();
} catch (Throwable e) {
System.err.println("[ObsidianIngots] Could not end server thread, error was '" + e.getMessage() + ".'");
}
} catch (IOException e)
{
System.err.println("[ObsidianIngots] Could not connect to server, error was '" + e.getMessage() + ".'");
try {
finalize();
} catch (Throwable e1) {
System.err.println("[ObsidianIngots] Could not end server thread, error was '" + e.getMessage() + ".'");
}
}
}
}