*@Override on inherited methods for all you trolls.
*TabProxy API to use the Mekanism creative tab.
*Removed useless javadocs.
*Fixed swords not being damaged when breaking blocks.
*Fixed console spam.
*Reduced machine packets.
*Removed useless weather orb and stopwatch GUI Code.
*Fixed sound bug.
This commit is contained in:
Aidan Brady 2012-11-06 10:44:14 -05:00
parent e3e0befa30
commit b699e34b0e
78 changed files with 422 additions and 168 deletions
src
common/mekanism
minecraft/mekanism/client

View file

@ -9,6 +9,11 @@ public class ItemMachineUpgrade extends Item
{ {
super(id); super(id);
setMaxStackSize(1); setMaxStackSize(1);
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(TabProxy.tabMekanism());
}
public String getTextureFile()
{
return "/textures/items.png";
} }
} }

View file

@ -0,0 +1,31 @@
package mekanism.api;
import net.minecraft.src.*;
public final class TabProxy
{
public static Class Mekanism;
public static CreativeTabs tabMekanism()
{
try {
if(Mekanism == null)
{
Mekanism = Class.forName("mekanism.common.Mekanism");
}
Object ret = Mekanism.getField("tabMekanism").get(null);
if(ret instanceof CreativeTabs)
{
return (CreativeTabs)ret;
}
else {
return null;
}
} catch(Exception e) {
System.err.println("[Mekanism] Error retrieving Mekanism creative tab.");
return null;
}
}
}

View file

@ -22,6 +22,7 @@ public class BlockGenerator extends BlockContainer
setRequiresSelfNotify(); setRequiresSelfNotify();
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving) public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
{ {
TileEntityGenerator tileEntity = (TileEntityGenerator)world.getBlockTileEntity(x, y, z); TileEntityGenerator tileEntity = (TileEntityGenerator)world.getBlockTileEntity(x, y, z);
@ -39,6 +40,7 @@ public class BlockGenerator extends BlockContainer
tileEntity.setFacing((short)change); tileEntity.setFacing((short)change);
} }
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta) public int getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if(meta == 0) if(meta == 0)
@ -60,6 +62,7 @@ public class BlockGenerator extends BlockContainer
} }
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{ {
@ -85,11 +88,13 @@ public class BlockGenerator extends BlockContainer
} }
} }
@Override
public int damageDropped(int i) public int damageDropped(int i)
{ {
return i; return i;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list) public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
{ {
@ -114,6 +119,7 @@ public class BlockGenerator extends BlockContainer
return false; return false;
} }
@Override
public void breakBlock(World world, int x, int y, int z, int i1, int i2) public void breakBlock(World world, int x, int y, int z, int i1, int i2)
{ {
TileEntityGenerator tileEntity = (TileEntityGenerator)world.getBlockTileEntity(x, y, z); TileEntityGenerator tileEntity = (TileEntityGenerator)world.getBlockTileEntity(x, y, z);
@ -161,6 +167,7 @@ public class BlockGenerator extends BlockContainer
super.breakBlock(world, x, y, z, i1, i2); super.breakBlock(world, x, y, z, i1, i2);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
{ {
if (world.isRemote) if (world.isRemote)
@ -190,11 +197,13 @@ public class BlockGenerator extends BlockContainer
} }
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";
} }
@Override
public TileEntity createNewTileEntity(World world, int metadata) public TileEntity createNewTileEntity(World world, int metadata)
{ {
if(metadata == MachineType.HEAT_GENERATOR.index) if(metadata == MachineType.HEAT_GENERATOR.index)
@ -207,6 +216,7 @@ public class BlockGenerator extends BlockContainer
} }
/*This method is not used, metadata manipulation is required to create a Tile Entity.*/ /*This method is not used, metadata manipulation is required to create a Tile Entity.*/
@Override
public TileEntity createNewTileEntity(World world) public TileEntity createNewTileEntity(World world)
{ {
return null; return null;

View file

@ -31,6 +31,7 @@ public class BlockMachine extends BlockContainer
setRequiresSelfNotify(); setRequiresSelfNotify();
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving) public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
{ {
if(!(world.getBlockMetadata(x, y, z) == 6)) if(!(world.getBlockMetadata(x, y, z) == 6))
@ -51,6 +52,7 @@ public class BlockMachine extends BlockContainer
} }
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) public void randomDisplayTick(World world, int x, int y, int z, Random random)
{ {
@ -86,6 +88,7 @@ public class BlockMachine extends BlockContainer
} }
} }
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta) public int getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if(meta == 0) if(meta == 0)
@ -147,6 +150,7 @@ public class BlockMachine extends BlockContainer
} }
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{ {
@ -219,11 +223,13 @@ public class BlockMachine extends BlockContainer
} }
} }
@Override
public int damageDropped(int i) public int damageDropped(int i)
{ {
return i; return i;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list) public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
{ {
@ -252,6 +258,7 @@ public class BlockMachine extends BlockContainer
return false; return false;
} }
@Override
public void breakBlock(World world, int x, int y, int z, int i1, int i2) public void breakBlock(World world, int x, int y, int z, int i1, int i2)
{ {
TileEntityBasicMachine tileEntity = (TileEntityBasicMachine)world.getBlockTileEntity(x, y, z); TileEntityBasicMachine tileEntity = (TileEntityBasicMachine)world.getBlockTileEntity(x, y, z);
@ -299,6 +306,7 @@ public class BlockMachine extends BlockContainer
super.breakBlock(world, x, y, z, i1, i2); super.breakBlock(world, x, y, z, i1, i2);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
{ {
if(world.isRemote) if(world.isRemote)
@ -331,11 +339,13 @@ public class BlockMachine extends BlockContainer
} }
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";
} }
@Override
public TileEntity createNewTileEntity(World world, int metadata) public TileEntity createNewTileEntity(World world, int metadata)
{ {
if(metadata == MachineType.ENRICHMENT_CHAMBER.index) if(metadata == MachineType.ENRICHMENT_CHAMBER.index)
@ -363,7 +373,7 @@ public class BlockMachine extends BlockContainer
} }
} }
/*This method is not used, metadata manipulation is required to create a Tile Entity.*/ @Override
public TileEntity createNewTileEntity(World world) public TileEntity createNewTileEntity(World world)
{ {
return null; return null;

View file

@ -32,6 +32,7 @@ public class BlockMulti extends Block
setRequiresSelfNotify(); setRequiresSelfNotify();
} }
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta) public int getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
switch(meta) switch(meta)
@ -50,11 +51,13 @@ public class BlockMulti extends Block
return 0; return 0;
} }
@Override
public int damageDropped(int i) public int damageDropped(int i)
{ {
return i; return i;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list) public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
{ {
@ -65,6 +68,7 @@ public class BlockMulti extends Block
list.add(new ItemStack(i, 1, 4)); list.add(new ItemStack(i, 1, 4));
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
{ {
int metadata = world.getBlockMetadata(x, y, z); int metadata = world.getBlockMetadata(x, y, z);
@ -81,6 +85,7 @@ public class BlockMulti extends Block
return false; return false;
} }
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) public int getLightValue(IBlockAccess world, int x, int y, int z)
{ {
int metadata = world.getBlockMetadata(x, y, z); int metadata = world.getBlockMetadata(x, y, z);
@ -96,6 +101,7 @@ public class BlockMulti extends Block
return 0; return 0;
} }
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) public void randomDisplayTick(World world, int x, int y, int z, Random random)
{ {
if (world.isBlockIndirectlyGettingPowered(x, y + 1, z) && world.getBlockMetadata(z, y, z) == 5) if (world.isBlockIndirectlyGettingPowered(x, y + 1, z) && world.getBlockMetadata(z, y, z) == 5)
@ -148,12 +154,14 @@ public class BlockMulti extends Block
} }
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving) public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
{ {
world.markBlockAsNeedsUpdate(x, y, z); world.markBlockAsNeedsUpdate(x, y, z);
world.updateAllLightTypes(x, y, z); world.updateAllLightTypes(x, y, z);
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";

View file

@ -16,6 +16,7 @@ public class BlockObsidianTNT extends Block
setResistance(0.0F); setResistance(0.0F);
} }
@Override
public int getBlockTextureFromSide(int side) public int getBlockTextureFromSide(int side)
{ {
if(side == 1) if(side == 1)
@ -31,6 +32,7 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
public void onBlockAdded(World world, int x, int y, int z) public void onBlockAdded(World world, int x, int y, int z)
{ {
super.onBlockAdded(world, x, y, z); super.onBlockAdded(world, x, y, z);
@ -42,6 +44,7 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{ {
if (blockID > 0 && Block.blocksList[blockID].canProvidePower() && world.isBlockIndirectlyGettingPowered(x, y, z)) if (blockID > 0 && Block.blocksList[blockID].canProvidePower() && world.isBlockIndirectlyGettingPowered(x, y, z))
@ -51,11 +54,13 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
public int quantityDropped(Random random) public int quantityDropped(Random random)
{ {
return 0; return 0;
} }
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z) public void onBlockDestroyedByExplosion(World world, int x, int y, int z)
{ {
if (!world.isRemote) if (!world.isRemote)
@ -66,6 +71,7 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
{ {
if (!world.isRemote) if (!world.isRemote)
@ -83,11 +89,13 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityplayer) public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityplayer)
{ {
super.onBlockClicked(world, x, y, z, entityplayer); super.onBlockClicked(world, x, y, z, entityplayer);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
{ {
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex) if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex)
@ -102,11 +110,13 @@ public class BlockObsidianTNT extends Block
} }
} }
@Override
protected ItemStack createStackedBlock(int i) protected ItemStack createStackedBlock(int i)
{ {
return null; return null;
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";

View file

@ -23,11 +23,13 @@ public class BlockOre extends Block
setRequiresSelfNotify(); setRequiresSelfNotify();
} }
@Override
public boolean canDragonDestroy(World world, int x, int y, int z) public boolean canDragonDestroy(World world, int x, int y, int z)
{ {
return world.getBlockMetadata(x, y, z) != 1; return world.getBlockMetadata(x, y, z) != 1;
} }
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta) public int getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
switch(meta) switch(meta)
@ -38,17 +40,20 @@ public class BlockOre extends Block
return 0; return 0;
} }
@Override
public int damageDropped(int i) public int damageDropped(int i)
{ {
return i; return i;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list) public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
{ {
list.add(new ItemStack(i, 1, 0)); list.add(new ItemStack(i, 1, 0));
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";

View file

@ -30,6 +30,7 @@ public class BlockPowerUnit extends BlockContainer
setRequiresSelfNotify(); setRequiresSelfNotify();
} }
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta) public int getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if(meta == 0) if(meta == 0)
@ -55,6 +56,7 @@ public class BlockPowerUnit extends BlockContainer
return 0; return 0;
} }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving) public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
{ {
TileEntityPowerUnit tileEntity = (TileEntityPowerUnit)world.getBlockTileEntity(x, y, z); TileEntityPowerUnit tileEntity = (TileEntityPowerUnit)world.getBlockTileEntity(x, y, z);
@ -72,11 +74,13 @@ public class BlockPowerUnit extends BlockContainer
tileEntity.setFacing((short)change); tileEntity.setFacing((short)change);
} }
@Override
public int damageDropped(int i) public int damageDropped(int i)
{ {
return i; return i;
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs creativetabs, List list) public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
{ {
@ -84,6 +88,7 @@ public class BlockPowerUnit extends BlockContainer
list.add(new ItemStack(i, 1, 1)); list.add(new ItemStack(i, 1, 1));
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{ {
@ -113,6 +118,7 @@ public class BlockPowerUnit extends BlockContainer
return 0; return 0;
} }
@Override
public void breakBlock(World world, int par2, int par3, int par4, int i1, int i2) public void breakBlock(World world, int par2, int par3, int par4, int i1, int i2)
{ {
TileEntityPowerUnit var5 = (TileEntityPowerUnit)world.getBlockTileEntity(par2, par3, par4); TileEntityPowerUnit var5 = (TileEntityPowerUnit)world.getBlockTileEntity(par2, par3, par4);
@ -164,6 +170,7 @@ public class BlockPowerUnit extends BlockContainer
super.breakBlock(world, par2, par3, par4, i1, i2); super.breakBlock(world, par2, par3, par4, i1, i2);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
{ {
if (world.isRemote) if (world.isRemote)
@ -189,11 +196,13 @@ public class BlockPowerUnit extends BlockContainer
} }
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/terrain.png"; return "/textures/terrain.png";
} }
@Override
public TileEntity createNewTileEntity(World world, int metadata) public TileEntity createNewTileEntity(World world, int metadata)
{ {
if(metadata == 0) if(metadata == 0)
@ -207,6 +216,7 @@ public class BlockPowerUnit extends BlockContainer
return null; return null;
} }
@Override
public TileEntity createNewTileEntity(World world) public TileEntity createNewTileEntity(World world)
{ {
return null; return null;

View file

@ -12,26 +12,31 @@ import net.minecraft.src.WrongUsageException;
public class CommandMekanism extends CommandBase public class CommandMekanism extends CommandBase
{ {
@Override
public String getCommandName() public String getCommandName()
{ {
return "mk"; return "mk";
} }
@Override
public String getCommandUsage(ICommandSender sender) public String getCommandUsage(ICommandSender sender)
{ {
return "/mk <parameters>"; return "/mk <parameters>";
} }
@Override
public List getCommandAliases() public List getCommandAliases()
{ {
return Arrays.asList(new String[] {"mekanism"}); return Arrays.asList(new String[] {"mekanism"});
} }
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) public boolean canCommandSenderUseCommand(ICommandSender sender)
{ {
return !MinecraftServer.getServer().isSinglePlayer() && super.canCommandSenderUseCommand(sender); return !MinecraftServer.getServer().isSinglePlayer() && super.canCommandSenderUseCommand(sender);
} }
@Override
public void processCommand(ICommandSender sender, String[] params) public void processCommand(ICommandSender sender, String[] params)
{ {
if(params.length < 1) if(params.length < 1)

View file

@ -12,11 +12,13 @@ import cpw.mods.fml.common.network.IGuiHandler;
*/ */
public class CommonGuiHandler implements IGuiHandler public class CommonGuiHandler implements IGuiHandler
{ {
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{ {
return Mekanism.proxy.getServerGui(ID, player, world, x, y, z); return Mekanism.proxy.getServerGui(ID, player, world, x, y, z);
} }
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{ {
return Mekanism.proxy.getClientGui(ID, player, world, x, y, z); return Mekanism.proxy.getClientGui(ID, player, world, x, y, z);

View file

@ -36,20 +36,20 @@ public class ContainerAdvancedElectricMachine extends Container
tileEntity.openChest(); tileEntity.openChest();
} }
@Override
public void onCraftGuiClosed(EntityPlayer entityplayer) public void onCraftGuiClosed(EntityPlayer entityplayer)
{ {
super.onCraftGuiClosed(entityplayer); super.onCraftGuiClosed(entityplayer);
tileEntity.closeChest(); tileEntity.closeChest();
} }
@Override
public boolean canInteractWith(EntityPlayer par1EntityPlayer) public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{ {
return tileEntity.isUseableByPlayer(par1EntityPlayer); return tileEntity.isUseableByPlayer(par1EntityPlayer);
} }
/** @Override
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
public ItemStack transferStackInSlot(EntityPlayer player, int slotID) public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{ {
ItemStack stack = null; ItemStack stack = null;

View file

@ -35,20 +35,20 @@ public class ContainerElectricMachine extends Container
tileEntity.openChest(); tileEntity.openChest();
} }
@Override
public void onCraftGuiClosed(EntityPlayer entityplayer) public void onCraftGuiClosed(EntityPlayer entityplayer)
{ {
super.onCraftGuiClosed(entityplayer); super.onCraftGuiClosed(entityplayer);
tileEntity.closeChest(); tileEntity.closeChest();
} }
@Override
public boolean canInteractWith(EntityPlayer par1EntityPlayer) public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{ {
return tileEntity.isUseableByPlayer(par1EntityPlayer); return tileEntity.isUseableByPlayer(par1EntityPlayer);
} }
/** @Override
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
public ItemStack transferStackInSlot(EntityPlayer player, int slotID) public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{ {
ItemStack stack = null; ItemStack stack = null;

View file

@ -32,20 +32,20 @@ public class ContainerGenerator extends Container
tileEntity.openChest(); tileEntity.openChest();
} }
@Override
public void onCraftGuiClosed(EntityPlayer entityplayer) public void onCraftGuiClosed(EntityPlayer entityplayer)
{ {
super.onCraftGuiClosed(entityplayer); super.onCraftGuiClosed(entityplayer);
tileEntity.closeChest(); tileEntity.closeChest();
} }
@Override
public boolean canInteractWith(EntityPlayer par1EntityPlayer) public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{ {
return tileEntity.isUseableByPlayer(par1EntityPlayer); return tileEntity.isUseableByPlayer(par1EntityPlayer);
} }
/** @Override
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
public ItemStack transferStackInSlot(EntityPlayer player, int slotID) public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{ {
ItemStack stack = null; ItemStack stack = null;

View file

@ -33,17 +33,20 @@ public class ContainerPowerUnit extends Container
tileEntity.openChest(); tileEntity.openChest();
} }
@Override
public void onCraftGuiClosed(EntityPlayer entityplayer) public void onCraftGuiClosed(EntityPlayer entityplayer)
{ {
super.onCraftGuiClosed(entityplayer); super.onCraftGuiClosed(entityplayer);
tileEntity.closeChest(); tileEntity.closeChest();
} }
@Override
public boolean canInteractWith(EntityPlayer par1EntityPlayer) public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{ {
return tileEntity.isUseableByPlayer(par1EntityPlayer); return tileEntity.isUseableByPlayer(par1EntityPlayer);
} }
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotID) public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{ {
ItemStack stack = null; ItemStack stack = null;

View file

@ -9,6 +9,7 @@ public class CreativeTabMekanism extends CreativeTabs
super("tabMekanism"); super("tabMekanism");
} }
@Override
public ItemStack getIconItemStack() public ItemStack getIconItemStack()
{ {
return new ItemStack(Mekanism.Stopwatch, 1, 0); return new ItemStack(Mekanism.Stopwatch, 1, 0);

View file

@ -19,6 +19,7 @@ public class DamageSourceMekanism extends EntityDamageSourceIndirect
return damageSourceProjectile; return damageSourceProjectile;
} }
@Override
public Entity getEntity() public Entity getEntity()
{ {
return damageSourceEntity; return damageSourceEntity;

View file

@ -38,9 +38,7 @@ public class EntityKnife extends EntityProjectile
setArrowHeading(motionX, motionY, motionZ, 0.8F, 3F); setArrowHeading(motionX, motionY, motionZ, 0.8F, 3F);
} }
/** @Override
* Called to update the entity's position/logic.
*/
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
@ -65,6 +63,7 @@ public class EntityKnife extends EntityProjectile
soundTimer++; soundTimer++;
} }
@Override
public void onEntityHit(Entity entity) public void onEntityHit(Entity entity)
{ {
if (worldObj.isRemote) if (worldObj.isRemote)
@ -102,29 +101,31 @@ public class EntityKnife extends EntityProjectile
} }
} }
@Override
public boolean aimRotation() public boolean aimRotation()
{ {
return beenInGround; return beenInGround;
} }
@Override
public int getMaxArrowShake() public int getMaxArrowShake()
{ {
return 4; return 4;
} }
@Override
public float getGravity() public float getGravity()
{ {
return 0.03F; return 0.03F;
} }
@Override
public ItemStack getPickupItem() public ItemStack getPickupItem()
{ {
return thrownItem; return thrownItem;
} }
/** @Override
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound nbttagcompound) public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{ {
super.writeEntityToNBT(nbttagcompound); super.writeEntityToNBT(nbttagcompound);
@ -135,9 +136,7 @@ public class EntityKnife extends EntityProjectile
} }
} }
/** @Override
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound nbttagcompound) public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{ {
super.readEntityFromNBT(nbttagcompound); super.readEntityFromNBT(nbttagcompound);

View file

@ -31,28 +31,22 @@ public class EntityObsidianTNT extends Entity
prevPosZ = par6; prevPosZ = par6;
} }
@Override
protected void entityInit() {} protected void entityInit() {}
/** @Override
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
protected boolean canTriggerWalking() protected boolean canTriggerWalking()
{ {
return false; return false;
} }
/** @Override
* Returns true if other Entities should be prevented from moving through this Entity.
*/
public boolean canBeCollidedWith() public boolean canBeCollidedWith()
{ {
return !isDead; return !isDead;
} }
/** @Override
* Called to update the entity's position/logic.
*/
public void onUpdate() public void onUpdate()
{ {
prevPosX = posX; prevPosX = posX;
@ -101,22 +95,19 @@ public class EntityObsidianTNT extends Entity
hasExploded = true; hasExploded = true;
} }
/** @Override
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{ {
par1NBTTagCompound.setByte("Fuse", (byte)fuse); par1NBTTagCompound.setByte("Fuse", (byte)fuse);
} }
/** @Override
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{ {
fuse = par1NBTTagCompound.getByte("Fuse"); fuse = par1NBTTagCompound.getByte("Fuse");
} }
@Override
public float getShadowSize() public float getShadowSize()
{ {
return 0.0F; return 0.0F;

View file

@ -37,9 +37,8 @@ public abstract class EntityProjectile extends Entity
setSize(0.5F, 0.5F); setSize(0.5F, 0.5F);
} }
protected void entityInit() @Override
{ protected void entityInit() {}
}
public void setArrowHeading(double d, double d1, double d2, float f, float f1) public void setArrowHeading(double d, double d1, double d2, float f, float f1)
{ {
@ -62,9 +61,7 @@ public abstract class EntityProjectile extends Entity
ticksInGround = 0; ticksInGround = 0;
} }
/** @Override
* Sets the velocity to the args. Args: x, y, z
*/
public void setVelocity(double d, double d1, double d2) public void setVelocity(double d, double d1, double d2)
{ {
motionX = d; motionX = d;
@ -87,9 +84,7 @@ public abstract class EntityProjectile extends Entity
} }
} }
/** @Override
* Called to update the entity's position/logic.
*/
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
@ -324,13 +319,9 @@ public abstract class EntityProjectile extends Entity
return 7; return 7;
} }
public void playHitSound() public void playHitSound() {}
{
}
/** @Override
* Called by a player entity when they collide with an entity
*/
public void onCollideWithPlayer(EntityPlayer entityplayer) public void onCollideWithPlayer(EntityPlayer entityplayer)
{ {
if (worldObj.isRemote) if (worldObj.isRemote)
@ -358,9 +349,7 @@ public abstract class EntityProjectile extends Entity
return 0.0F; return 0.0F;
} }
/** @Override
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound nbttagcompound) public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{ {
nbttagcompound.setShort("xTile", (short)xTile); nbttagcompound.setShort("xTile", (short)xTile);
@ -375,9 +364,7 @@ public abstract class EntityProjectile extends Entity
nbttagcompound.setBoolean("beenInGround", beenInGround); nbttagcompound.setBoolean("beenInGround", beenInGround);
} }
/** @Override
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound nbttagcompound) public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{ {
xTile = nbttagcompound.getShort("xTile"); xTile = nbttagcompound.getShort("xTile");

View file

@ -32,6 +32,7 @@ public enum EnumColor
code = s; code = s;
} }
@Override
public String toString() public String toString()
{ {
return code; return code;

View file

@ -19,16 +19,19 @@ public class ItemBlockGenerator extends ItemBlock
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int i) public int getMetadata(int i)
{ {
return i; return i;
} }
@Override
public int getIconFromDamage(int i) public int getIconFromDamage(int i)
{ {
return metaBlock.getBlockTextureFromSideAndMetadata(2, i); return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
} }
@Override
public String getItemNameIS(ItemStack itemstack) public String getItemNameIS(ItemStack itemstack)
{ {
String name = ""; String name = "";

View file

@ -25,16 +25,19 @@ public class ItemBlockMachine extends ItemBlock
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int i) public int getMetadata(int i)
{ {
return i; return i;
} }
@Override
public int getIconFromDamage(int i) public int getIconFromDamage(int i)
{ {
return metaBlock.getBlockTextureFromSideAndMetadata(2, i); return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
} }
@Override
public String getItemNameIS(ItemStack itemstack) public String getItemNameIS(ItemStack itemstack)
{ {
String name = ""; String name = "";

View file

@ -23,16 +23,19 @@ public class ItemBlockMulti extends ItemBlock
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int i) public int getMetadata(int i)
{ {
return i; return i;
} }
@Override
public int getIconFromDamage(int i) public int getIconFromDamage(int i)
{ {
return metaBlock.getBlockTextureFromSideAndMetadata(2, i); return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
} }
@Override
public String getItemNameIS(ItemStack itemstack) public String getItemNameIS(ItemStack itemstack)
{ {
String name = ""; String name = "";

View file

@ -19,16 +19,19 @@ public class ItemBlockOre extends ItemBlock
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int i) public int getMetadata(int i)
{ {
return i; return i;
} }
@Override
public int getIconFromDamage(int i) public int getIconFromDamage(int i)
{ {
return metaBlock.getBlockTextureFromSideAndMetadata(2, i); return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
} }
@Override
public String getItemNameIS(ItemStack itemstack) public String getItemNameIS(ItemStack itemstack)
{ {
String name = ""; String name = "";

View file

@ -20,16 +20,19 @@ public class ItemBlockPowerUnit extends ItemBlock
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
public int getMetadata(int i) public int getMetadata(int i)
{ {
return i; return i;
} }
@Override
public int getIconFromDamage(int i) public int getIconFromDamage(int i)
{ {
return metaBlock.getBlockTextureFromSideAndMetadata(2, i); return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
} }
@Override
public String getItemNameIS(ItemStack itemstack) public String getItemNameIS(ItemStack itemstack)
{ {
String name = ""; String name = "";

View file

@ -18,6 +18,7 @@ public class ItemDust extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public int getIconFromDamage(int meta) public int getIconFromDamage(int meta)
{ {
switch (meta) switch (meta)
@ -30,6 +31,7 @@ public class ItemDust extends ItemMekanism
} }
} }
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList) public void getSubItems(int id, CreativeTabs tabs, List itemList)
{ {
for (int counter = 0; counter <= 3; ++counter) for (int counter = 0; counter <= 3; ++counter)
@ -38,6 +40,7 @@ public class ItemDust extends ItemMekanism
} }
} }
@Override
public String getItemNameIS(ItemStack item) public String getItemNameIS(ItemStack item)
{ {
return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Dust"; return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Dust";

View file

@ -31,6 +31,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{ {
int energy = getEnergy(itemstack); int energy = getEnergy(itemstack);
@ -38,17 +39,20 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
list.add("Stored Energy: " + MekanismUtils.getDisplayedEnergy(energy)); list.add("Stored Energy: " + MekanismUtils.getDisplayedEnergy(energy));
} }
@Override
public void onCreated(ItemStack itemstack, World world, EntityPlayer entityplayer) public void onCreated(ItemStack itemstack, World world, EntityPlayer entityplayer)
{ {
itemstack = getUnchargedItem(); itemstack = getUnchargedItem();
} }
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{ {
ItemEnergized item = ((ItemEnergized)itemstack.getItem()); ItemEnergized item = ((ItemEnergized)itemstack.getItem());
item.setEnergy(itemstack, item.getEnergy(itemstack)); item.setEnergy(itemstack, item.getEnergy(itemstack));
} }
@Override
public int getEnergy(ItemStack itemstack) public int getEnergy(ItemStack itemstack)
{ {
if(itemstack.stackTagCompound == null) if(itemstack.stackTagCompound == null)
@ -67,6 +71,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return stored; return stored;
} }
@Override
public void setEnergy(ItemStack itemstack, int energy) public void setEnergy(ItemStack itemstack, int energy)
{ {
if(itemstack.stackTagCompound == null) if(itemstack.stackTagCompound == null)
@ -86,6 +91,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return charged; return charged;
} }
@Override
public void getSubItems(int i, CreativeTabs tabs, List list) public void getSubItems(int i, CreativeTabs tabs, List list)
{ {
ItemStack discharged = new ItemStack(this); ItemStack discharged = new ItemStack(this);
@ -96,16 +102,19 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
list.add(charged); list.add(charged);
} }
@Override
public int getMaxEnergy() public int getMaxEnergy()
{ {
return maxEnergy; return maxEnergy;
} }
@Override
public int getRate() public int getRate()
{ {
return transferRate; return transferRate;
} }
@Override
public int charge(ItemStack itemstack, int amount) public int charge(ItemStack itemstack, int amount)
{ {
int rejects = Math.max((getEnergy(itemstack) + amount) - maxEnergy, 0); int rejects = Math.max((getEnergy(itemstack) + amount) - maxEnergy, 0);
@ -113,6 +122,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return rejects; return rejects;
} }
@Override
public int discharge(ItemStack itemstack, int amount) public int discharge(ItemStack itemstack, int amount)
{ {
int energyToUse = Math.min(getEnergy(itemstack), amount); int energyToUse = Math.min(getEnergy(itemstack), amount);
@ -120,6 +130,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return energyToUse; return energyToUse;
} }
@Override
public double getJoules(Object... data) public double getJoules(Object... data)
{ {
if(data[0] instanceof ItemStack) if(data[0] instanceof ItemStack)
@ -130,6 +141,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return 0; return 0;
} }
@Override
public void setJoules(double joules, Object... data) public void setJoules(double joules, Object... data)
{ {
if(data[0] instanceof ItemStack) if(data[0] instanceof ItemStack)
@ -140,16 +152,19 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
} }
} }
@Override
public double getMaxJoules() public double getMaxJoules()
{ {
return maxEnergy*UniversalElectricity.IC2_RATIO; return maxEnergy*UniversalElectricity.IC2_RATIO;
} }
@Override
public double getVoltage() public double getVoltage()
{ {
return 20; return 20;
} }
@Override
public double onReceive(double amps, double voltage, ItemStack itemStack) public double onReceive(double amps, double voltage, ItemStack itemStack)
{ {
int rejects = (int)Math.max((getEnergy(itemStack) + ElectricInfo.getJoules(amps, voltage, 1)*UniversalElectricity.TO_IC2_RATIO) - getMaxEnergy(), 0); int rejects = (int)Math.max((getEnergy(itemStack) + ElectricInfo.getJoules(amps, voltage, 1)*UniversalElectricity.TO_IC2_RATIO) - getMaxEnergy(), 0);
@ -157,6 +172,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return rejects*UniversalElectricity.IC2_RATIO; return rejects*UniversalElectricity.IC2_RATIO;
} }
@Override
public double onUse(double joulesNeeded, ItemStack itemStack) public double onUse(double joulesNeeded, ItemStack itemStack)
{ {
int energyRequest = (int)Math.min(getEnergy(itemStack), joulesNeeded*UniversalElectricity.TO_IC2_RATIO); int energyRequest = (int)Math.min(getEnergy(itemStack), joulesNeeded*UniversalElectricity.TO_IC2_RATIO);
@ -164,16 +180,19 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
return energyRequest*UniversalElectricity.IC2_RATIO; return energyRequest*UniversalElectricity.IC2_RATIO;
} }
@Override
public boolean canReceiveElectricity() public boolean canReceiveElectricity()
{ {
return true; return true;
} }
@Override
public boolean canProduceElectricity() public boolean canProduceElectricity()
{ {
return true; return true;
} }
@Override
public int getDivider() public int getDivider()
{ {
return divider; return divider;

View file

@ -8,8 +8,7 @@ import net.minecraft.src.*;
public class ItemIngot extends ItemMekanism public class ItemIngot extends ItemMekanism
{ {
public static String[] en_USNames = {"Obsidian", "Platinum", "Redstone", public static String[] en_USNames = {"Obsidian", "Platinum", "Redstone", "Glowstone"};
"Glowstone"};
public ItemIngot(int id) public ItemIngot(int id)
{ {
@ -18,6 +17,7 @@ public class ItemIngot extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public int getIconFromDamage(int meta) public int getIconFromDamage(int meta)
{ {
switch (meta) switch (meta)
@ -30,6 +30,7 @@ public class ItemIngot extends ItemMekanism
} }
} }
@Override
public void getSubItems(int id, CreativeTabs tabs, List itemList) public void getSubItems(int id, CreativeTabs tabs, List itemList)
{ {
for (int counter = 0; counter <= 3; ++counter) for (int counter = 0; counter <= 3; ++counter)
@ -38,6 +39,7 @@ public class ItemIngot extends ItemMekanism
} }
} }
@Override
public String getItemNameIS(ItemStack item) public String getItemNameIS(ItemStack item)
{ {
return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Ingot"; return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Ingot";

View file

@ -12,11 +12,13 @@ public class ItemLightningRod extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public boolean hasEffect(ItemStack par1ItemStack) public boolean hasEffect(ItemStack par1ItemStack)
{ {
return true; return true;
} }
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{ {
if(itemstack.getItemDamage() == 0) if(itemstack.getItemDamage() == 0)
@ -49,6 +51,7 @@ public class ItemLightningRod extends ItemMekanism
return itemstack; return itemstack;
} }
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{ {
if(itemstack.getItemDamage() > 0) if(itemstack.getItemDamage() > 0)

View file

@ -10,7 +10,9 @@ public class ItemMekanism extends Item
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
public String getTextureFile() { @Override
public String getTextureFile()
{
return "/textures/items.png"; return "/textures/items.png";
} }
} }

View file

@ -10,7 +10,9 @@ public class ItemMekanismArmor extends ItemArmor
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
public String getTextureFile() { @Override
public String getTextureFile()
{
return "/textures/items.png"; return "/textures/items.png";
} }
} }

View file

@ -14,10 +14,7 @@ public class ItemMekanismAxe extends ItemMekanismTool
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst); super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
} }
/** @Override
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (par2Block != null && par2Block.blockMaterial == Material.wood) if (par2Block != null && par2Block.blockMaterial == Material.wood)

View file

@ -13,6 +13,7 @@ public class ItemMekanismBow extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{ {
EntityPlayer player = (EntityPlayer)entity; EntityPlayer player = (EntityPlayer)entity;
@ -41,6 +42,7 @@ public class ItemMekanismBow extends ItemMekanism
} }
} }
@Override
public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int itemUseCount) public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int itemUseCount)
{ {
boolean flag = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, itemstack) > 0; boolean flag = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, itemstack) > 0;
@ -114,21 +116,25 @@ public class ItemMekanismBow extends ItemMekanism
} }
} }
@Override
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
return par1ItemStack; return par1ItemStack;
} }
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack) public int getMaxItemUseDuration(ItemStack par1ItemStack)
{ {
return 0x11940; return 0x11940;
} }
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) public EnumAction getItemUseAction(ItemStack par1ItemStack)
{ {
return EnumAction.bow; return EnumAction.bow;
} }
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
@ -139,6 +145,7 @@ public class ItemMekanismBow extends ItemMekanism
return par1ItemStack; return par1ItemStack;
} }
@Override
public int getItemEnchantability() public int getItemEnchantability()
{ {
return 1; return 1;

View file

@ -11,10 +11,7 @@ public class ItemMekanismHoe extends ItemMekanism
setMaxDamage(par2EnumToolMaterial.getMaxUses()); setMaxDamage(par2EnumToolMaterial.getMaxUses());
} }
/** @Override
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS !
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{ {
if (!par2EntityPlayer.func_82247_a(par4, par5, par6, par7, par1ItemStack)) if (!par2EntityPlayer.func_82247_a(par4, par5, par6, par7, par1ItemStack))
@ -47,9 +44,7 @@ public class ItemMekanismHoe extends ItemMekanism
} }
} }
/** @Override
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D() public boolean isFull3D()
{ {
return true; return true;

View file

@ -26,9 +26,7 @@ public class ItemMekanismKnife extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
/** @Override
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{ {
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack)); entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
@ -56,49 +54,50 @@ public class ItemMekanismKnife extends ItemMekanism
} }
} }
/** @Override
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack itemstack, Block block) public float getStrVsBlock(ItemStack itemstack, Block block)
{ {
return strVsBlock * (block.blockID != Block.web.blockID ? 1.0F : 10F); return strVsBlock * (block.blockID != Block.web.blockID ? 1.0F : 10F);
} }
/** @Override
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block block) public boolean canHarvestBlock(Block block)
{ {
return block.blockID == Block.web.blockID; return block.blockID == Block.web.blockID;
} }
@Override
public int getItemEnchantability() public int getItemEnchantability()
{ {
return enchantability; return enchantability;
} }
@Override
public int getMaxItemUseDuration(ItemStack itemstack) public int getMaxItemUseDuration(ItemStack itemstack)
{ {
return 0x11940; return 0x11940;
} }
@Override
public boolean isFull3D() public boolean isFull3D()
{ {
return true; return true;
} }
@Override
public int getDamageVsEntity(Entity entity) public int getDamageVsEntity(Entity entity)
{ {
return weaponDamage; return weaponDamage;
} }
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving) public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving)
{ {
itemstack.damageItem(blockDamage, entityliving); itemstack.damageItem(blockDamage, entityliving);
return true; return true;
} }
@Override
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{ {
itemstack.damageItem(entityDamage, entityliving1); itemstack.damageItem(entityDamage, entityliving1);

View file

@ -15,6 +15,7 @@ public class ItemMekanismPaxel extends ItemMekanismTool
super(i, 3, enumtoolmaterial, blocksEffectiveAgainst); super(i, 3, enumtoolmaterial, blocksEffectiveAgainst);
} }
@Override
public boolean canHarvestBlock(Block block) public boolean canHarvestBlock(Block block)
{ {
if (block == Block.obsidian) if (block == Block.obsidian)
@ -51,6 +52,7 @@ public class ItemMekanismPaxel extends ItemMekanismTool
} }
} }
@Override
public float getStrVsBlock(ItemStack itemstack, Block block) public float getStrVsBlock(ItemStack itemstack, Block block)
{ {
if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock)) if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))

View file

@ -15,9 +15,7 @@ public class ItemMekanismPickaxe extends ItemMekanismTool
super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst); super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst);
} }
/** @Override
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block) public boolean canHarvestBlock(Block par1Block)
{ {
if (par1Block == Block.obsidian) if (par1Block == Block.obsidian)
@ -58,10 +56,7 @@ public class ItemMekanismPickaxe extends ItemMekanismTool
return par1Block.blockMaterial == Material.iron; return par1Block.blockMaterial == Material.iron;
} }
/** @Override
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock)) if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))

View file

@ -13,9 +13,7 @@ public class ItemMekanismSpade extends ItemMekanismTool
super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst); super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst);
} }
/** @Override
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block) public boolean canHarvestBlock(Block par1Block)
{ {
if (par1Block == Block.snow) if (par1Block == Block.snow)

View file

@ -25,34 +25,27 @@ public class ItemMekanismSword extends ItemMekanism
weaponDamage = 4 + par2EnumToolMaterial.getDamageVsEntity(); weaponDamage = 4 + par2EnumToolMaterial.getDamageVsEntity();
} }
/** @Override
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{ {
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F; return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
} }
/** @Override
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{ {
par1ItemStack.damageItem(1, par3EntityLiving); par1ItemStack.damageItem(1, par3EntityLiving);
return true; return true;
} }
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) @Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
{ {
par1ItemStack.damageItem(2, par6EntityLiving); par1ItemStack.damageItem(2, par7EntityLiving);
return true; return true;
} }
/** @Override
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity) public int getDamageVsEntity(Entity par1Entity)
{ {
return weaponDamage; return weaponDamage;

View file

@ -16,6 +16,7 @@ public class ItemMekanismTool extends ItemTool
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public String getTextureFile() public String getTextureFile()
{ {
return "/textures/items.png"; return "/textures/items.png";

View file

@ -12,11 +12,13 @@ public class ItemStopwatch extends ItemMekanism {
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public boolean hasEffect(ItemStack itemstack) public boolean hasEffect(ItemStack itemstack)
{ {
return true; return true;
} }
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{ {
if(itemstack.getItemDamage() == 0) if(itemstack.getItemDamage() == 0)
@ -26,6 +28,7 @@ public class ItemStopwatch extends ItemMekanism {
return itemstack; return itemstack;
} }
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{ {
if(itemstack.getItemDamage() > 0) if(itemstack.getItemDamage() > 0)

View file

@ -12,11 +12,13 @@ public class ItemWeatherOrb extends ItemMekanism
setCreativeTab(Mekanism.tabMekanism); setCreativeTab(Mekanism.tabMekanism);
} }
@Override
public boolean hasEffect(ItemStack itemstack) public boolean hasEffect(ItemStack itemstack)
{ {
return true; return true;
} }
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{ {
if(itemstack.getItemDamage() == 0) if(itemstack.getItemDamage() == 0)
@ -26,6 +28,7 @@ public class ItemWeatherOrb extends ItemMekanism
return itemstack; return itemstack;
} }
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{ {
if(itemstack.getItemDamage() > 0) if(itemstack.getItemDamage() > 0)

View file

@ -213,7 +213,6 @@ public class Mekanism
public static Block ObsidianTNT; public static Block ObsidianTNT;
public static Block PowerUnit; public static Block PowerUnit;
public static Block Generator; public static Block Generator;
public static Block PlatinumWire;
//MultiID Items //MultiID Items
public static Item Dust; public static Item Dust;
@ -661,7 +660,6 @@ public class Mekanism
LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade"); LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade");
LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade"); LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade");
LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade"); LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade");
LanguageRegistry.addName(new ItemStack(PlatinumWire, 1, 0), "Platinum Wire");
//Localization for MultiBlock //Localization for MultiBlock
LanguageRegistry.instance().addStringLocalization("tile.MultiBlock.PlatinumBlock.name", "Platinum Block"); LanguageRegistry.instance().addStringLocalization("tile.MultiBlock.PlatinumBlock.name", "Platinum Block");

View file

@ -7,6 +7,7 @@ import cpw.mods.fml.common.IWorldGenerator;
public class OreHandler implements IWorldGenerator public class OreHandler implements IWorldGenerator
{ {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{ {
switch(world.provider.dimensionId) switch(world.provider.dimensionId)

View file

@ -30,6 +30,7 @@ import cpw.mods.fml.server.FMLServerHandler;
*/ */
public class PacketHandler implements IPacketHandler public class PacketHandler implements IPacketHandler
{ {
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
{ {
ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data); ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data);

View file

@ -12,6 +12,7 @@ public class SlotEnergy extends Slot
super(inventory, x, y, z); super(inventory, x, y, z);
} }
@Override
public boolean isItemValid(ItemStack itemstack) public boolean isItemValid(ItemStack itemstack)
{ {
return itemstack.getItem() instanceof IEnergizedItem || itemstack.getItem() instanceof IElectricItem || itemstack.getItem() instanceof IItemElectric || itemstack.itemID == Item.redstone.shiftedIndex; return itemstack.getItem() instanceof IEnergizedItem || itemstack.getItem() instanceof IElectricItem || itemstack.getItem() instanceof IItemElectric || itemstack.itemID == Item.redstone.shiftedIndex;

View file

@ -10,6 +10,7 @@ public class SlotMachineUpgrade extends Slot
super(inventory, x, y, z); super(inventory, x, y, z);
} }
@Override
public boolean isItemValid(ItemStack itemstack) public boolean isItemValid(ItemStack itemstack)
{ {
return itemstack.getItem() instanceof ItemMachineUpgrade; return itemstack.getItem() instanceof ItemMachineUpgrade;

View file

@ -13,6 +13,7 @@ public class ThreadGetData extends Thread
start(); start();
} }
@Override
public void run() public void run()
{ {
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion(); Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion();

View file

@ -66,6 +66,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
*/ */
public abstract int getFuelTicks(ItemStack itemstack); public abstract int getFuelTicks(ItemStack itemstack);
@Override
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
@ -244,6 +245,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
} }
} }
@Override
public void operate() public void operate()
{ {
if (!canOperate()) if (!canOperate())
@ -278,6 +280,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
} }
} }
@Override
public boolean canOperate() public boolean canOperate()
{ {
if (inventory[0] == null) if (inventory[0] == null)
@ -317,16 +320,19 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
} }
} }
@Override
public void sendPacket() public void sendPacket()
{ {
PacketHandler.sendAdvancedElectricMachinePacket(this); PacketHandler.sendAdvancedElectricMachinePacket(this);
} }
@Override
public void sendPacketWithRange() public void sendPacketWithRange()
{ {
PacketHandler.sendAdvancedElectricMachinePacketWithRange(this, 50); PacketHandler.sendAdvancedElectricMachinePacketWithRange(this, 50);
} }
@Override
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
{ {
try { try {
@ -345,6 +351,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbtTags) public void readFromNBT(NBTTagCompound nbtTags)
{ {
super.readFromNBT(nbtTags); super.readFromNBT(nbtTags);
@ -352,6 +359,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
secondaryEnergyStored = nbtTags.getInteger("secondaryEnergyStored"); secondaryEnergyStored = nbtTags.getInteger("secondaryEnergyStored");
} }
@Override
public void writeToNBT(NBTTagCompound nbtTags) public void writeToNBT(NBTTagCompound nbtTags)
{ {
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
@ -378,11 +386,13 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
return secondaryEnergyStored*i / MAX_SECONDARY_ENERGY; return secondaryEnergyStored*i / MAX_SECONDARY_ENERGY;
} }
@Override
public String[] getMethodNames() public String[] getMethodNames()
{ {
return new String[] {"getStored", "getSecondaryStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"}; return new String[] {"getStored", "getSecondaryStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"};
} }
@Override
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
{ {
switch(method) switch(method)

View file

@ -87,6 +87,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
} }
} }
@Override
public void onUpdate() public void onUpdate()
{ {
if(!registered && worldObj != null && !worldObj.isRemote) if(!registered && worldObj != null && !worldObj.isRemote)
@ -104,7 +105,6 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void handleSound() public void handleSound()
{ {
System.out.println(xCoord + " " + yCoord + " " + zCoord);
if(audio == null && worldObj != null && worldObj.isRemote) if(audio == null && worldObj != null && worldObj.isRemote)
{ {
if(FMLClientHandler.instance().getClient().sndManager.sndSystem != null) if(FMLClientHandler.instance().getClient().sndManager.sndSystem != null)
@ -127,6 +127,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbtTags) public void readFromNBT(NBTTagCompound nbtTags)
{ {
super.readFromNBT(nbtTags); super.readFromNBT(nbtTags);
@ -140,6 +141,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
isActive = nbtTags.getBoolean("isActive"); isActive = nbtTags.getBoolean("isActive");
} }
@Override
public void writeToNBT(NBTTagCompound nbtTags) public void writeToNBT(NBTTagCompound nbtTags)
{ {
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
@ -153,6 +155,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
nbtTags.setBoolean("isActive", isActive); nbtTags.setBoolean("isActive", isActive);
} }
@Override
public void invalidate() public void invalidate()
{ {
super.invalidate(); super.invalidate();
@ -168,11 +171,13 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
} }
} }
@Override
public boolean demandsEnergy() public boolean demandsEnergy()
{ {
return energyStored < currentMaxEnergy; return energyStored < currentMaxEnergy;
} }
@Override
public int injectEnergy(Direction direction, int i) public int injectEnergy(Direction direction, int i)
{ {
int rejects = 0; int rejects = 0;
@ -190,23 +195,28 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
return rejects; return rejects;
} }
@Override
public void setPowerProvider(IPowerProvider provider) public void setPowerProvider(IPowerProvider provider)
{ {
powerProvider = provider; powerProvider = provider;
} }
@Override
public IPowerProvider getPowerProvider() public IPowerProvider getPowerProvider()
{ {
return powerProvider; return powerProvider;
} }
@Override
public int powerRequest() public int powerRequest()
{ {
return getPowerProvider().getMaxEnergyReceived(); return getPowerProvider().getMaxEnergyReceived();
} }
@Override
public void doWork() {} public void doWork() {}
@Override
public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction) public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction)
{ {
return true; return true;
@ -232,41 +242,49 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
return operatingTicks*i / currentTicksRequired; return operatingTicks*i / currentTicksRequired;
} }
@Override
public double getMaxJoules() public double getMaxJoules()
{ {
return currentMaxEnergy*UniversalElectricity.IC2_RATIO; return currentMaxEnergy*UniversalElectricity.IC2_RATIO;
} }
@Override
public double getJoules(Object... data) public double getJoules(Object... data)
{ {
return energyStored*UniversalElectricity.IC2_RATIO; return energyStored*UniversalElectricity.IC2_RATIO;
} }
@Override
public void setJoules(double joules, Object... data) public void setJoules(double joules, Object... data)
{ {
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO)); setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
} }
@Override
public boolean canConnect(ForgeDirection side) public boolean canConnect(ForgeDirection side)
{ {
return true; return true;
} }
@Override
public boolean canReceiveFromSide(ForgeDirection side) public boolean canReceiveFromSide(ForgeDirection side)
{ {
return true; return true;
} }
@Override
public double getVoltage() public double getVoltage()
{ {
return 120; return 120;
} }
@Override
public double wattRequest() public double wattRequest()
{ {
return ElectricInfo.getWatts(currentMaxEnergy*UniversalElectricity.IC2_RATIO) - ElectricInfo.getWatts(energyStored*UniversalElectricity.IC2_RATIO); return ElectricInfo.getWatts(currentMaxEnergy*UniversalElectricity.IC2_RATIO) - ElectricInfo.getWatts(energyStored*UniversalElectricity.IC2_RATIO);
} }
@Override
public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side)
{ {
int energyToReceive = (int)(ElectricInfo.getJoules(amps, voltage)*UniversalElectricity.TO_IC2_RATIO); int energyToReceive = (int)(ElectricInfo.getJoules(amps, voltage)*UniversalElectricity.TO_IC2_RATIO);
@ -293,6 +311,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
energyStored = Math.max(Math.min(energy, currentMaxEnergy), 0); energyStored = Math.max(Math.min(energy, currentMaxEnergy), 0);
} }
@Override
public void setActive(boolean active) public void setActive(boolean active)
{ {
isActive = active; isActive = active;
@ -305,20 +324,25 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
prevActive = active; prevActive = active;
} }
@Override
public String getType() public String getType()
{ {
return getInvName(); return getInvName();
} }
@Override
public boolean canAttachToSide(int side) public boolean canAttachToSide(int side)
{ {
return true; return true;
} }
@Override
public void attach(IComputerAccess computer, String computerSide) {} public void attach(IComputerAccess computer, String computerSide) {}
@Override
public void detach(IComputerAccess computer) {} public void detach(IComputerAccess computer) {}
@Override
public int transferToAcceptor(int amount) public int transferToAcceptor(int amount)
{ {
int rejects = 0; int rejects = 0;
@ -336,6 +360,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
return rejects; return rejects;
} }
@Override
public boolean canReceive(ForgeDirection side) public boolean canReceive(ForgeDirection side)
{ {
return true; return true;

View file

@ -14,11 +14,13 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
super("Combiner.ogg", "Combiner", "/gui/GuiCombiner.png", 5, 1, 200, 1000, 200); super("Combiner.ogg", "Combiner", "/gui/GuiCombiner.png", 5, 1, 200, 1000, 200);
} }
@Override
public List getRecipes() public List getRecipes()
{ {
return recipes; return recipes;
} }
@Override
public int getFuelTicks(ItemStack itemstack) public int getFuelTicks(ItemStack itemstack)
{ {
if(itemstack.getItem() instanceof ItemBlock && itemstack.itemID == Block.cobblestone.blockID) if(itemstack.getItem() instanceof ItemBlock && itemstack.itemID == Block.cobblestone.blockID)

View file

@ -14,6 +14,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine
super("Crusher.ogg", "Crusher", "/gui/GuiCrusher.png", 5, 200, 1000); super("Crusher.ogg", "Crusher", "/gui/GuiCrusher.png", 5, 200, 1000);
} }
@Override
public List getRecipes() public List getRecipes()
{ {
return recipes; return recipes;

View file

@ -47,8 +47,11 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
MAX_ENERGY = maxEnergy; MAX_ENERGY = maxEnergy;
} }
@Override
public void updateEntity() public void updateEntity()
{ {
super.updateEntity();
if(!initialized && worldObj != null) if(!initialized && worldObj != null)
{ {
if(Mekanism.hooks.IC2Loaded) if(Mekanism.hooks.IC2Loaded)
@ -65,7 +68,10 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
{ {
if(playersUsing > 0) if(playersUsing > 0)
{ {
sendPacketWithRange(); if(packetTick % 3 == 0)
{
sendPacketWithRange();
}
} }
else { else {
if(packetTick % 20 == 0) if(packetTick % 20 == 0)
@ -82,6 +88,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
*/ */
public abstract void onUpdate(); public abstract void onUpdate();
@Override
public int getStartInventorySide(ForgeDirection side) public int getStartInventorySide(ForgeDirection side)
{ {
if (side == ForgeDirection.DOWN) return 1; if (side == ForgeDirection.DOWN) return 1;
@ -89,21 +96,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
return 2; return 2;
} }
@Override
public int getSizeInventorySide(ForgeDirection side) public int getSizeInventorySide(ForgeDirection side)
{ {
return 1; return 1;
} }
@Override
public int getSizeInventory() public int getSizeInventory()
{ {
return inventory.length; return inventory.length;
} }
@Override
public ItemStack getStackInSlot(int par1) public ItemStack getStackInSlot(int par1)
{ {
return inventory[par1]; return inventory[par1];
} }
@Override
public ItemStack decrStackSize(int par1, int par2) public ItemStack decrStackSize(int par1, int par2)
{ {
if (inventory[par1] != null) if (inventory[par1] != null)
@ -134,6 +145,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
} }
} }
@Override
public ItemStack getStackInSlotOnClosing(int par1) public ItemStack getStackInSlotOnClosing(int par1)
{ {
if (inventory[par1] != null) if (inventory[par1] != null)
@ -148,6 +160,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
} }
} }
@Override
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
{ {
inventory[par1] = par2ItemStack; inventory[par1] = par2ItemStack;
@ -158,6 +171,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
} }
} }
@Override
public void readFromNBT(NBTTagCompound nbtTags) public void readFromNBT(NBTTagCompound nbtTags)
{ {
super.readFromNBT(nbtTags); super.readFromNBT(nbtTags);
@ -180,6 +194,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
facing = nbtTags.getInteger("facing"); facing = nbtTags.getInteger("facing");
} }
@Override
public void writeToNBT(NBTTagCompound nbtTags) public void writeToNBT(NBTTagCompound nbtTags)
{ {
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
@ -202,21 +217,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
nbtTags.setTag("Items", tagList); nbtTags.setTag("Items", tagList);
} }
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer) public boolean isUseableByPlayer(EntityPlayer entityplayer)
{ {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D; return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
} }
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
{ {
return true; return true;
} }
@Override
public short getFacing() public short getFacing()
{ {
return (short)facing; return (short)facing;
} }
@Override
public void setFacing(short direction) public void setFacing(short direction)
{ {
if(initialized) if(initialized)
@ -237,11 +256,13 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
initialized = true; initialized = true;
} }
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) public boolean wrenchCanRemove(EntityPlayer entityPlayer)
{ {
return true; return true;
} }
@Override
public float getWrenchDropRate() public float getWrenchDropRate()
{ {
return 1.0F; return 1.0F;
@ -252,21 +273,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
return initialized; return initialized;
} }
@Override
public String getInvName() public String getInvName()
{ {
return fullName; return fullName;
} }
@Override
public int getInventoryStackLimit() public int getInventoryStackLimit()
{ {
return 64; return 64;
} }
@Override
public void openChest() public void openChest()
{ {
playersUsing++; playersUsing++;
} }
@Override
public void closeChest() public void closeChest()
{ {
playersUsing--; playersUsing--;

View file

@ -45,6 +45,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
inventory = new ItemStack[4]; inventory = new ItemStack[4];
} }
@Override
public void onUpdate() public void onUpdate()
{ {
super.onUpdate(); super.onUpdate();
@ -188,6 +189,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
} }
} }
@Override
public void operate() public void operate()
{ {
if (!canOperate()) if (!canOperate())
@ -222,6 +224,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
} }
} }
@Override
public boolean canOperate() public boolean canOperate()
{ {
if (inventory[0] == null) if (inventory[0] == null)
@ -256,16 +259,19 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
} }
} }
@Override
public void sendPacket() public void sendPacket()
{ {
PacketHandler.sendElectricMachinePacket(this); PacketHandler.sendElectricMachinePacket(this);
} }
@Override
public void sendPacketWithRange() public void sendPacketWithRange()
{ {
PacketHandler.sendElectricMachinePacketWithRange(this, 50); PacketHandler.sendElectricMachinePacketWithRange(this, 50);
} }
@Override
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
{ {
try { try {
@ -283,11 +289,13 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
} }
} }
@Override
public String[] getMethodNames() public String[] getMethodNames()
{ {
return new String[] {"getStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"}; return new String[] {"getStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"};
} }
@Override
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
{ {
switch(method) switch(method)

View file

@ -14,6 +14,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
super("Chamber.ogg", "Enrichment Chamber", "/gui/GuiChamber.png", 5, 200, 1000); super("Chamber.ogg", "Enrichment Chamber", "/gui/GuiChamber.png", 5, 200, 1000);
} }
@Override
public List getRecipes() public List getRecipes()
{ {
return recipes; return recipes;

View file

@ -63,6 +63,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
} }
} }
@Override
public void onUpdate() public void onUpdate()
{ {
if(powerProvider != null) if(powerProvider != null)
@ -283,6 +284,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0); energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0);
} }
@Override
public void readFromNBT(NBTTagCompound nbtTags) public void readFromNBT(NBTTagCompound nbtTags)
{ {
super.readFromNBT(nbtTags); super.readFromNBT(nbtTags);
@ -311,6 +313,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
facing = nbtTags.getInteger("facing"); facing = nbtTags.getInteger("facing");
} }
@Override
public void writeToNBT(NBTTagCompound nbtTags) public void writeToNBT(NBTTagCompound nbtTags)
{ {
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
@ -339,16 +342,19 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
nbtTags.setTag("Items", tagList); nbtTags.setTag("Items", tagList);
} }
@Override
public double getVoltage() public double getVoltage()
{ {
return 120; return 120;
} }
@Override
public void setJoules(double joules, Object... data) public void setJoules(double joules, Object... data)
{ {
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO)); setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
} }
@Override
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
{ {
try { try {
@ -363,26 +369,31 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
} }
} }
@Override
public void sendPacket() public void sendPacket()
{ {
PacketHandler.sendGeneratorPacket(this); PacketHandler.sendGeneratorPacket(this);
} }
@Override
public void sendPacketWithRange() public void sendPacketWithRange()
{ {
PacketHandler.sendGeneratorPacketWithRange(this, 50); PacketHandler.sendGeneratorPacketWithRange(this, 50);
} }
@Override
public String getType() public String getType()
{ {
return getInvName(); return getInvName();
} }
@Override
public String[] getMethodNames() public String[] getMethodNames()
{ {
return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded", "getFuel", "getFuelNeeded"}; return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded", "getFuel", "getFuelNeeded"};
} }
@Override
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
{ {
switch(method) switch(method)
@ -405,79 +416,97 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
} }
} }
@Override
public boolean canAttachToSide(int side) public boolean canAttachToSide(int side)
{ {
return true; return true;
} }
@Override
public void attach(IComputerAccess computer, String computerSide) {} public void attach(IComputerAccess computer, String computerSide) {}
@Override
public void detach(IComputerAccess computer) {} public void detach(IComputerAccess computer) {}
@Override
public void setPowerProvider(IPowerProvider provider) public void setPowerProvider(IPowerProvider provider)
{ {
powerProvider = provider; powerProvider = provider;
} }
@Override
public IPowerProvider getPowerProvider() public IPowerProvider getPowerProvider()
{ {
return powerProvider; return powerProvider;
} }
@Override
public void doWork() {} public void doWork() {}
@Override
public int powerRequest() public int powerRequest()
{ {
return getPowerProvider().getMaxEnergyReceived(); return getPowerProvider().getMaxEnergyReceived();
} }
@Override
public double getMaxJoules() public double getMaxJoules()
{ {
return MAX_ENERGY*UniversalElectricity.IC2_RATIO; return MAX_ENERGY*UniversalElectricity.IC2_RATIO;
} }
@Override
public double getJoules(Object... data) public double getJoules(Object... data)
{ {
return energyStored*UniversalElectricity.IC2_RATIO; return energyStored*UniversalElectricity.IC2_RATIO;
} }
@Override
public int getMaxEnergyOutput() public int getMaxEnergyOutput()
{ {
return output; return output;
} }
@Override
public boolean emitsEnergyTo(TileEntity receiver, Direction direction) public boolean emitsEnergyTo(TileEntity receiver, Direction direction)
{ {
return direction.toForgeDirection() == ForgeDirection.getOrientation(facing); return direction.toForgeDirection() == ForgeDirection.getOrientation(facing);
} }
@Override
public int getStored() public int getStored()
{ {
return energyStored; return energyStored;
} }
@Override
public int getCapacity() public int getCapacity()
{ {
return MAX_ENERGY; return MAX_ENERGY;
} }
@Override
public int getRate() public int getRate()
{ {
return output; return output;
} }
@Override
public boolean canConnect(ForgeDirection side) public boolean canConnect(ForgeDirection side)
{ {
return side == ForgeDirection.getOrientation(facing); return side == ForgeDirection.getOrientation(facing);
} }
@Override
public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) {} public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) {}
@Override
public double wattRequest() public double wattRequest()
{ {
return 0; return 0;
} }
@Override
public boolean canReceiveFromSide(ForgeDirection side) public boolean canReceiveFromSide(ForgeDirection side)
{ {
return false; return false;

View file

@ -11,6 +11,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator
super("Heat Generator", 8000, 2000); super("Heat Generator", 8000, 2000);
} }
@Override
public int getFuel(ItemStack itemstack) public int getFuel(ItemStack itemstack)
{ {
return TileEntityFurnace.getItemBurnTime(itemstack); return TileEntityFurnace.getItemBurnTime(itemstack);

View file

@ -20,11 +20,13 @@ public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMach
super("Compressor.ogg", "Platinum Compressor", "/gui/GuiCompressor.png", 5, 1, 200, 1000, 200); super("Compressor.ogg", "Platinum Compressor", "/gui/GuiCompressor.png", 5, 1, 200, 1000, 200);
} }
@Override
public List getRecipes() public List getRecipes()
{ {
return recipes; return recipes;
} }
@Override
public int getFuelTicks(ItemStack itemstack) public int getFuelTicks(ItemStack itemstack)
{ {
if (itemstack.itemID == new ItemStack(Mekanism.Ingot, 1, 1).itemID) return 200; if (itemstack.itemID == new ItemStack(Mekanism.Ingot, 1, 1).itemID) return 200;

View file

@ -75,6 +75,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
} }
} }
@Override
public void onUpdate() public void onUpdate()
{ {
if(powerProvider != null) if(powerProvider != null)
@ -229,6 +230,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0); energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0);
} }
@Override
public void readFromNBT(NBTTagCompound nbtTags) public void readFromNBT(NBTTagCompound nbtTags)
{ {
super.readFromNBT(nbtTags); super.readFromNBT(nbtTags);
@ -256,6 +258,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
facing = nbtTags.getInteger("facing"); facing = nbtTags.getInteger("facing");
} }
@Override
public void writeToNBT(NBTTagCompound nbtTags) public void writeToNBT(NBTTagCompound nbtTags)
{ {
super.writeToNBT(nbtTags); super.writeToNBT(nbtTags);
@ -283,6 +286,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
nbtTags.setTag("Items", tagList); nbtTags.setTag("Items", tagList);
} }
@Override
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
{ {
try { try {
@ -296,31 +300,37 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
} }
} }
@Override
public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction) public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction)
{ {
return direction.toForgeDirection() != ForgeDirection.getOrientation(facing); return direction.toForgeDirection() != ForgeDirection.getOrientation(facing);
} }
@Override
public int getStored() public int getStored()
{ {
return energyStored; return energyStored;
} }
@Override
public int getCapacity() public int getCapacity()
{ {
return MAX_ENERGY; return MAX_ENERGY;
} }
@Override
public int getRate() public int getRate()
{ {
return output; return output;
} }
@Override
public boolean demandsEnergy() public boolean demandsEnergy()
{ {
return energyStored < MAX_ENERGY; return energyStored < MAX_ENERGY;
} }
@Override
public int injectEnergy(Direction direction, int i) public int injectEnergy(Direction direction, int i)
{ {
int rejects = 0; int rejects = 0;
@ -338,53 +348,64 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
return rejects; return rejects;
} }
@Override
public boolean emitsEnergyTo(TileEntity receiver, Direction direction) public boolean emitsEnergyTo(TileEntity receiver, Direction direction)
{ {
return direction.toForgeDirection() == ForgeDirection.getOrientation(facing); return direction.toForgeDirection() == ForgeDirection.getOrientation(facing);
} }
@Override
public int getMaxEnergyOutput() public int getMaxEnergyOutput()
{ {
return output; return output;
} }
@Override
public double getJoules(Object... data) public double getJoules(Object... data)
{ {
return energyStored*UniversalElectricity.IC2_RATIO; return energyStored*UniversalElectricity.IC2_RATIO;
} }
@Override
public void setJoules(double joules, Object... data) public void setJoules(double joules, Object... data)
{ {
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO)); setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
} }
@Override
public double getMaxJoules() public double getMaxJoules()
{ {
return MAX_ENERGY*UniversalElectricity.IC2_RATIO; return MAX_ENERGY*UniversalElectricity.IC2_RATIO;
} }
@Override
public void setPowerProvider(IPowerProvider provider) public void setPowerProvider(IPowerProvider provider)
{ {
powerProvider = provider; powerProvider = provider;
} }
@Override
public IPowerProvider getPowerProvider() public IPowerProvider getPowerProvider()
{ {
return powerProvider; return powerProvider;
} }
@Override
public void doWork() {} public void doWork() {}
@Override
public int powerRequest() public int powerRequest()
{ {
return getPowerProvider().getMaxEnergyReceived(); return getPowerProvider().getMaxEnergyReceived();
} }
@Override
public boolean canConnect(ForgeDirection side) public boolean canConnect(ForgeDirection side)
{ {
return true; return true;
} }
@Override
public double getVoltage() public double getVoltage()
{ {
return 120; return 120;
@ -406,6 +427,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
return false; return false;
} }
@Override
public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side)
{ {
int energyToReceive = (int)(ElectricInfo.getJoules(amps, voltage)*UniversalElectricity.TO_IC2_RATIO); int energyToReceive = (int)(ElectricInfo.getJoules(amps, voltage)*UniversalElectricity.TO_IC2_RATIO);
@ -423,26 +445,31 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
setEnergy(energyStored + energyToStore); setEnergy(energyStored + energyToStore);
} }
@Override
public double wattRequest() public double wattRequest()
{ {
return ElectricInfo.getWatts(MAX_ENERGY*UniversalElectricity.IC2_RATIO) - ElectricInfo.getWatts(energyStored*UniversalElectricity.IC2_RATIO); return ElectricInfo.getWatts(MAX_ENERGY*UniversalElectricity.IC2_RATIO) - ElectricInfo.getWatts(energyStored*UniversalElectricity.IC2_RATIO);
} }
@Override
public boolean canReceiveFromSide(ForgeDirection side) public boolean canReceiveFromSide(ForgeDirection side)
{ {
return side != ForgeDirection.getOrientation(facing); return side != ForgeDirection.getOrientation(facing);
} }
@Override
public String getType() public String getType()
{ {
return getInvName(); return getInvName();
} }
@Override
public String[] getMethodNames() public String[] getMethodNames()
{ {
return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded"}; return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded"};
} }
@Override
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
{ {
switch(method) switch(method)
@ -461,15 +488,19 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
} }
} }
@Override
public boolean canAttachToSide(int side) public boolean canAttachToSide(int side)
{ {
return true; return true;
} }
@Override
public void attach(IComputerAccess computer, String computerSide) {} public void attach(IComputerAccess computer, String computerSide) {}
@Override
public void detach(IComputerAccess computer) {} public void detach(IComputerAccess computer) {}
@Override
public int transferToAcceptor(int amount) public int transferToAcceptor(int amount)
{ {
int rejects = 0; int rejects = 0;
@ -487,16 +518,19 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
return rejects; return rejects;
} }
@Override
public boolean canReceive(ForgeDirection side) public boolean canReceive(ForgeDirection side)
{ {
return side != ForgeDirection.getOrientation(facing); return side != ForgeDirection.getOrientation(facing);
} }
@Override
public void sendPacket() public void sendPacket()
{ {
PacketHandler.sendPowerUnitPacket(this); PacketHandler.sendPowerUnitPacket(this);
} }
@Override
public void sendPacketWithRange() public void sendPacketWithRange()
{ {
PacketHandler.sendPowerUnitPacketWithRange(this, 50); PacketHandler.sendPowerUnitPacketWithRange(this, 50);

View file

@ -15,11 +15,13 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
super("Elementizer.ogg", "Theoretical Elementizer", "/gui/GuiElementizer.png", 50, 1, 1000, 10000, 1000); super("Elementizer.ogg", "Theoretical Elementizer", "/gui/GuiElementizer.png", 50, 1, 1000, 10000, 1000);
} }
@Override
public List getRecipes() public List getRecipes()
{ {
return recipes; return recipes;
} }
@Override
public int getFuelTicks(ItemStack itemstack) public int getFuelTicks(ItemStack itemstack)
{ {
if (itemstack.itemID == Item.diamond.shiftedIndex) return 1000; if (itemstack.itemID == Item.diamond.shiftedIndex) return 1000;

View file

@ -37,6 +37,7 @@ public class Version
build = 0; build = 0;
} }
@Override
public String toString() public String toString()
{ {
if(major == 0 && minor == 0 && build == 0) if(major == 0 && minor == 0 && build == 0)

View file

@ -43,11 +43,13 @@ import net.minecraftforge.client.MinecraftForgeClient;
*/ */
public class ClientProxy extends CommonProxy public class ClientProxy extends CommonProxy
{ {
@Override
public int getArmorIndex(String string) public int getArmorIndex(String string)
{ {
return RenderingRegistry.addNewArmourRendererPrefix(string); return RenderingRegistry.addNewArmourRendererPrefix(string);
} }
@Override
public void registerRenderInformation() public void registerRenderInformation()
{ {
System.out.println("[Mekanism] Beginning render initiative..."); System.out.println("[Mekanism] Beginning render initiative...");
@ -79,11 +81,13 @@ public class ClientProxy extends CommonProxy
System.out.println("[Mekanism] Render initiative complete."); System.out.println("[Mekanism] Render initiative complete.");
} }
@Override
public World getClientWorld() public World getClientWorld()
{ {
return FMLClientHandler.instance().getClient().theWorld; return FMLClientHandler.instance().getClient().theWorld;
} }
@Override
public void loadUtilities() public void loadUtilities()
{ {
System.out.println("[Mekanism] Beginning utility initiative..."); System.out.println("[Mekanism] Beginning utility initiative...");
@ -91,6 +95,7 @@ public class ClientProxy extends CommonProxy
System.out.println("[Mekanism] Utility initiative complete."); System.out.println("[Mekanism] Utility initiative complete.");
} }
@Override
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z) public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
{ {
switch(ID) switch(ID)
@ -128,11 +133,13 @@ public class ClientProxy extends CommonProxy
return null; return null;
} }
@Override
public void loadTickHandler() public void loadTickHandler()
{ {
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT); TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
} }
@Override
public void loadSoundHandler() public void loadSoundHandler()
{ {
Mekanism.audioHandler = new SoundHandler(); Mekanism.audioHandler = new SoundHandler();

View file

@ -17,6 +17,7 @@ import cpw.mods.fml.common.TickType;
*/ */
public class ClientTickHandler implements ITickHandler public class ClientTickHandler implements ITickHandler
{ {
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) public void tickStart(EnumSet<TickType> type, Object... tickData)
{ {
if(Mekanism.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null) if(Mekanism.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null)
@ -26,16 +27,19 @@ public class ClientTickHandler implements ITickHandler
} }
} }
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) public void tickEnd(EnumSet<TickType> type, Object... tickData)
{ {
} }
@Override
public EnumSet<TickType> ticks() public EnumSet<TickType> ticks()
{ {
return EnumSet.of(TickType.CLIENT); return EnumSet.of(TickType.CLIENT);
} }
@Override
public String getLabel() public String getLabel()
{ {
return "Mekanism"; return "Mekanism";

View file

@ -16,18 +16,14 @@ public class GuiAdvancedElectricMachine extends GuiContainer
tileEntity = tentity; tileEntity = tentity;
} }
/** @Override
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2)
{ {
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040); fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
} }
/** @Override
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath); int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath);

View file

@ -28,6 +28,7 @@ public class GuiControlPanel extends GuiScreen
worldObj = world; worldObj = world;
} }
@Override
public void initGui() public void initGui()
{ {
super.initGui(); super.initGui();
@ -48,6 +49,7 @@ public class GuiControlPanel extends GuiScreen
zField.setText("" + 0); zField.setText("" + 0);
} }
@Override
public void drawScreen(int i, int j, float f) public void drawScreen(int i, int j, float f)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -66,6 +68,7 @@ public class GuiControlPanel extends GuiScreen
GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_DEPTH_TEST);
} }
@Override
public void keyTyped(char c, int i) public void keyTyped(char c, int i)
{ {
super.keyTyped(c, i); super.keyTyped(c, i);
@ -75,11 +78,13 @@ public class GuiControlPanel extends GuiScreen
zField.textboxKeyTyped(c, i); zField.textboxKeyTyped(c, i);
} }
@Override
public boolean doesGuiPauseGame() public boolean doesGuiPauseGame()
{ {
return false; return false;
} }
@Override
public void updateScreen() public void updateScreen()
{ {
xField.updateCursorCounter(); xField.updateCursorCounter();
@ -95,6 +100,7 @@ public class GuiControlPanel extends GuiScreen
} }
} }
@Override
public void mouseClicked(int x, int y, int z) public void mouseClicked(int x, int y, int z)
{ {
super.mouseClicked(x, y, z); super.mouseClicked(x, y, z);
@ -103,6 +109,7 @@ public class GuiControlPanel extends GuiScreen
zField.mouseClicked(x, y, z); zField.mouseClicked(x, y, z);
} }
@Override
public void actionPerformed(GuiButton guibutton) public void actionPerformed(GuiButton guibutton)
{ {
if(!guibutton.enabled) if(!guibutton.enabled)

View file

@ -14,6 +14,7 @@ public class GuiCredits extends GuiScreen {
private static String updateProgress = ""; private static String updateProgress = "";
@Override
public void initGui() public void initGui()
{ {
controlList.clear(); controlList.clear();
@ -21,6 +22,7 @@ public class GuiCredits extends GuiScreen {
controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel")); controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel"));
} }
@Override
public void onGuiClosed() public void onGuiClosed()
{ {
updateProgress = ""; updateProgress = "";
@ -36,6 +38,7 @@ public class GuiCredits extends GuiScreen {
updateProgress = EnumColor.DARK_RED + "Error updating."; updateProgress = EnumColor.DARK_RED + "Error updating.";
} }
@Override
protected void actionPerformed(GuiButton guibutton) protected void actionPerformed(GuiButton guibutton)
{ {
if(!guibutton.enabled) if(!guibutton.enabled)
@ -65,6 +68,7 @@ public class GuiCredits extends GuiScreen {
drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0); drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0);
} }
@Override
public void drawScreen(int i, int j, float f) public void drawScreen(int i, int j, float f)
{ {
drawDefaultBackground(); drawDefaultBackground();

View file

@ -16,18 +16,14 @@ public class GuiElectricMachine extends GuiContainer
tileEntity = tentity; tileEntity = tentity;
} }
/** @Override
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2)
{ {
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040); fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
} }
/** @Override
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath); int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath);

View file

@ -20,9 +20,7 @@ public class GuiGenerator extends GuiContainer
tileEntity = tentity; tileEntity = tentity;
} }
/** @Override
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2)
{ {
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040); fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
@ -32,9 +30,7 @@ public class GuiGenerator extends GuiContainer
fontRenderer.drawString("Out: " + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.output), 51, 44, 0x404040); fontRenderer.drawString("Out: " + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.output), 51, 44, 0x404040);
} }
/** @Override
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int texture = mc.renderEngine.getTexture("/gui/GuiGenerator.png"); int texture = mc.renderEngine.getTexture("/gui/GuiGenerator.png");

View file

@ -20,6 +20,7 @@ public class GuiPowerUnit extends GuiContainer
tileEntity = tentity; tileEntity = tentity;
} }
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2)
{ {
String capacityInfo = MekanismUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY); String capacityInfo = MekanismUtils.getDisplayedEnergyNoColor(tileEntity.energyStored) + "/" + MekanismUtils.getDisplayedEnergyNoColor(tileEntity.MAX_ENERGY);
@ -30,6 +31,7 @@ public class GuiPowerUnit extends GuiContainer
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 0x404040);
} }
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int texture = mc.renderEngine.getTexture("/gui/GuiPowerUnit.png"); int texture = mc.renderEngine.getTexture("/gui/GuiPowerUnit.png");

View file

@ -18,6 +18,7 @@ public class GuiStopwatch extends GuiScreen {
player = entityplayer; player = entityplayer;
} }
@Override
public void initGui() public void initGui()
{ {
controlList.clear(); controlList.clear();
@ -29,6 +30,7 @@ public class GuiStopwatch extends GuiScreen {
controlList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); controlList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close"));
} }
@Override
public void drawScreen(int i, int j, float f) public void drawScreen(int i, int j, float f)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -43,6 +45,7 @@ public class GuiStopwatch extends GuiScreen {
GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_DEPTH_TEST);
} }
@Override
public void keyTyped(char c, int i) public void keyTyped(char c, int i)
{ {
if (i == 1) if (i == 1)
@ -51,11 +54,13 @@ public class GuiStopwatch extends GuiScreen {
} }
} }
@Override
public boolean doesGuiPauseGame() public boolean doesGuiPauseGame()
{ {
return false; return false;
} }
@Override
public void actionPerformed(GuiButton guibutton) public void actionPerformed(GuiButton guibutton)
{ {
if(guibutton.id == 0) if(guibutton.id == 0)
@ -95,16 +100,4 @@ public class GuiStopwatch extends GuiScreen {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
} }
} }
protected void mouseClicked(int i, int j, int k)
{
super.mouseClicked(i, j, k);
int x = i - (width - xSize) / 2;
int y = j - (height - ySize) / 2;
if(x > 4 && x < 14 && y > 4 && y < 14)
{
mc.displayGuiScreen(null);
}
}
} }

View file

@ -15,6 +15,7 @@ public class GuiTheoreticalElementizer extends GuiAdvancedElectricMachine
super(inventory, tentity); super(inventory, tentity);
} }
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) protected void drawGuiContainerForegroundLayer(int par1, int par2)
{ {
super.drawGuiContainerForegroundLayer(par1, par2); super.drawGuiContainerForegroundLayer(par1, par2);

View file

@ -19,6 +19,7 @@ public class GuiWeatherOrb extends GuiScreen {
player = entityplayer; player = entityplayer;
} }
@Override
public void initGui() public void initGui()
{ {
controlList.clear(); controlList.clear();
@ -30,6 +31,7 @@ public class GuiWeatherOrb extends GuiScreen {
controlList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); controlList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close"));
} }
@Override
public void drawScreen(int i, int j, float f) public void drawScreen(int i, int j, float f)
{ {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -44,6 +46,7 @@ public class GuiWeatherOrb extends GuiScreen {
GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_DEPTH_TEST);
} }
@Override
public void keyTyped(char c, int i) public void keyTyped(char c, int i)
{ {
if (i == 1) if (i == 1)
@ -52,11 +55,13 @@ public class GuiWeatherOrb extends GuiScreen {
} }
} }
@Override
public boolean doesGuiPauseGame() public boolean doesGuiPauseGame()
{ {
return false; return false;
} }
@Override
public void actionPerformed(GuiButton guibutton) public void actionPerformed(GuiButton guibutton)
{ {
if(guibutton.id == 0) if(guibutton.id == 0)
@ -96,16 +101,4 @@ public class GuiWeatherOrb extends GuiScreen {
mc.displayGuiScreen(null); mc.displayGuiScreen(null);
} }
} }
protected void mouseClicked(int i, int j, int k)
{
super.mouseClicked(i, j, k);
int x = i - (width - xSize) / 2;
int y = j - (height - ySize) / 2;
if(x > 4 && x < 14 && y > 4 && y < 14)
{
mc.displayGuiScreen(null);
}
}
} }

View file

@ -86,12 +86,7 @@ public class RenderKnife extends Render
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
/** @Override
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
{ {
renderKnife((EntityKnife)entity, d, d1, d2, f, f1); renderKnife((EntityKnife)entity, d, d1, d2, f, f1);

View file

@ -62,12 +62,7 @@ public class RenderObsidianTNT extends Render
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
/** @Override
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
{ {
renderObsidianTNT((EntityObsidianTNT)entity, d, d1, d2, f, f1); renderObsidianTNT((EntityObsidianTNT)entity, d, d1, d2, f, f1);

View file

@ -119,7 +119,7 @@ public class Sound
return; return;
} }
double distanceVolume = entityplayer.getDistanceSq(xCoord, yCoord, zCoord)*0.1; double distanceVolume = entityplayer.getDistanceSq(xCoord, yCoord, zCoord)*0.01;
volume = (float)Math.max(1.0F-distanceVolume, 0); volume = (float)Math.max(1.0F-distanceVolume, 0);

View file

@ -25,6 +25,7 @@ public class TextureAnimatedFX extends ModTextureAnimation
super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 5); super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 5);
} }
@Override
public void bindImage(RenderEngine renderengine) public void bindImage(RenderEngine renderengine)
{ {
//Binds texture with GL11 to use specific icon index. //Binds texture with GL11 to use specific icon index.

View file

@ -32,6 +32,7 @@ public class ThreadClientUpdate extends Thread
} }
} }
@Override
public void run() public void run()
{ {
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString()); File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());

View file

@ -22,6 +22,7 @@ public class ThreadSendData extends Thread
start(); start();
} }
@Override
public void run() public void run()
{ {
System.out.println("[Mekanism] Initiating server protocol..."); System.out.println("[Mekanism] Initiating server protocol...");