v5 Beta #6
*@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:
parent
e3e0befa30
commit
b699e34b0e
78 changed files with 422 additions and 168 deletions
|
@ -9,6 +9,11 @@ public class ItemMachineUpgrade extends Item
|
|||
{
|
||||
super(id);
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
setCreativeTab(TabProxy.tabMekanism());
|
||||
}
|
||||
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/items.png";
|
||||
}
|
||||
}
|
||||
|
|
31
src/common/mekanism/api/TabProxy.java
Normal file
31
src/common/mekanism/api/TabProxy.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ public class BlockGenerator extends BlockContainer
|
|||
setRequiresSelfNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
|
||||
{
|
||||
TileEntityGenerator tileEntity = (TileEntityGenerator)world.getBlockTileEntity(x, y, z);
|
||||
|
@ -39,6 +40,7 @@ public class BlockGenerator extends BlockContainer
|
|||
tileEntity.setFacing((short)change);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
if(meta == 0)
|
||||
|
@ -60,6 +62,7 @@ public class BlockGenerator extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
|
||||
{
|
||||
|
@ -114,6 +119,7 @@ public class BlockGenerator extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, int i1, int i2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
|
@ -190,11 +197,13 @@ public class BlockGenerator extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
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.*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return null;
|
||||
|
|
|
@ -31,6 +31,7 @@ public class BlockMachine extends BlockContainer
|
|||
setRequiresSelfNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
|
||||
{
|
||||
if(!(world.getBlockMetadata(x, y, z) == 6))
|
||||
|
@ -51,6 +52,7 @@ public class BlockMachine extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
if(meta == 0)
|
||||
|
@ -147,6 +150,7 @@ public class BlockMachine extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
|
||||
{
|
||||
|
@ -252,6 +258,7 @@ public class BlockMachine extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, int i1, int i2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
|
@ -331,11 +339,13 @@ public class BlockMachine extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return null;
|
||||
|
|
|
@ -32,6 +32,7 @@ public class BlockMulti extends Block
|
|||
setRequiresSelfNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
switch(meta)
|
||||
|
@ -50,11 +51,13 @@ public class BlockMulti extends Block
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
|
@ -81,6 +85,7 @@ public class BlockMulti extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
@ -96,6 +101,7 @@ public class BlockMulti extends Block
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
|
@ -148,12 +154,14 @@ public class BlockMulti extends Block
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
|
||||
{
|
||||
world.markBlockAsNeedsUpdate(x, y, z);
|
||||
world.updateAllLightTypes(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
|
|
|
@ -16,6 +16,7 @@ public class BlockObsidianTNT extends Block
|
|||
setResistance(0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTextureFromSide(int side)
|
||||
{
|
||||
if(side == 1)
|
||||
|
@ -31,6 +32,7 @@ public class BlockObsidianTNT extends Block
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
|
|
|
@ -23,11 +23,13 @@ public class BlockOre extends Block
|
|||
setRequiresSelfNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDragonDestroy(World world, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockMetadata(x, y, z) != 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
switch(meta)
|
||||
|
@ -38,17 +40,20 @@ public class BlockOre extends Block
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
|
||||
{
|
||||
list.add(new ItemStack(i, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
|
|
|
@ -30,6 +30,7 @@ public class BlockPowerUnit extends BlockContainer
|
|||
setRequiresSelfNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
if(meta == 0)
|
||||
|
@ -55,6 +56,7 @@ public class BlockPowerUnit extends BlockContainer
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
|
||||
{
|
||||
TileEntityPowerUnit tileEntity = (TileEntityPowerUnit)world.getBlockTileEntity(x, y, z);
|
||||
|
@ -72,11 +74,13 @@ public class BlockPowerUnit extends BlockContainer
|
|||
tileEntity.setFacing((short)change);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
|
@ -113,6 +118,7 @@ public class BlockPowerUnit extends BlockContainer
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int par2, int par3, int par4, int i1, int i2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
|
||||
{
|
||||
if (world.isRemote)
|
||||
|
@ -189,11 +196,13 @@ public class BlockPowerUnit extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/terrain.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
if(metadata == 0)
|
||||
|
@ -207,6 +216,7 @@ public class BlockPowerUnit extends BlockContainer
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return null;
|
||||
|
|
|
@ -12,26 +12,31 @@ import net.minecraft.src.WrongUsageException;
|
|||
|
||||
public class CommandMekanism extends CommandBase
|
||||
{
|
||||
@Override
|
||||
public String getCommandName()
|
||||
{
|
||||
return "mk";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender)
|
||||
{
|
||||
return "/mk <parameters>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getCommandAliases()
|
||||
{
|
||||
return Arrays.asList(new String[] {"mekanism"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUseCommand(ICommandSender sender)
|
||||
{
|
||||
return !MinecraftServer.getServer().isSinglePlayer() && super.canCommandSenderUseCommand(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] params)
|
||||
{
|
||||
if(params.length < 1)
|
||||
|
|
|
@ -12,11 +12,13 @@ import cpw.mods.fml.common.network.IGuiHandler;
|
|||
*/
|
||||
public class CommonGuiHandler implements IGuiHandler
|
||||
{
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
|
|
|
@ -36,20 +36,20 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
tileEntity.openChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
|
|
|
@ -35,20 +35,20 @@ public class ContainerElectricMachine extends Container
|
|||
tileEntity.openChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
|
|
|
@ -32,20 +32,20 @@ public class ContainerGenerator extends Container
|
|||
tileEntity.openChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
|
|
|
@ -33,17 +33,20 @@ public class ContainerPowerUnit extends Container
|
|||
tileEntity.openChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
|
|
|
@ -9,6 +9,7 @@ public class CreativeTabMekanism extends CreativeTabs
|
|||
super("tabMekanism");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(Mekanism.Stopwatch, 1, 0);
|
||||
|
|
|
@ -19,6 +19,7 @@ public class DamageSourceMekanism extends EntityDamageSourceIndirect
|
|||
return damageSourceProjectile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getEntity()
|
||||
{
|
||||
return damageSourceEntity;
|
||||
|
|
|
@ -38,9 +38,7 @@ public class EntityKnife extends EntityProjectile
|
|||
setArrowHeading(motionX, motionY, motionZ, 0.8F, 3F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
@ -65,6 +63,7 @@ public class EntityKnife extends EntityProjectile
|
|||
soundTimer++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityHit(Entity entity)
|
||||
{
|
||||
if (worldObj.isRemote)
|
||||
|
@ -102,29 +101,31 @@ public class EntityKnife extends EntityProjectile
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean aimRotation()
|
||||
{
|
||||
return beenInGround;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxArrowShake()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGravity()
|
||||
{
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickupItem()
|
||||
{
|
||||
return thrownItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.writeEntityToNBT(nbttagcompound);
|
||||
|
@ -134,10 +135,8 @@ public class EntityKnife extends EntityProjectile
|
|||
nbttagcompound.setCompoundTag("thrownItem", thrownItem.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.readEntityFromNBT(nbttagcompound);
|
||||
|
|
|
@ -31,28 +31,22 @@ public class EntityObsidianTNT extends Entity
|
|||
prevPosZ = par6;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {}
|
||||
|
||||
/**
|
||||
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
|
||||
* prevent them from trampling crops
|
||||
*/
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if other Entities should be prevented from moving through this Entity.
|
||||
*/
|
||||
@Override
|
||||
public boolean canBeCollidedWith()
|
||||
{
|
||||
return !isDead;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
prevPosX = posX;
|
||||
|
@ -101,22 +95,19 @@ public class EntityObsidianTNT extends Entity
|
|||
hasExploded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
par1NBTTagCompound.setByte("Fuse", (byte)fuse);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
fuse = par1NBTTagCompound.getByte("Fuse");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
|
|
|
@ -37,9 +37,8 @@ public abstract class EntityProjectile extends Entity
|
|||
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)
|
||||
{
|
||||
|
@ -62,9 +61,7 @@ public abstract class EntityProjectile extends Entity
|
|||
ticksInGround = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the velocity to the args. Args: x, y, z
|
||||
*/
|
||||
@Override
|
||||
public void setVelocity(double d, double d1, double d2)
|
||||
{
|
||||
motionX = d;
|
||||
|
@ -87,9 +84,7 @@ public abstract class EntityProjectile extends Entity
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
@ -324,13 +319,9 @@ public abstract class EntityProjectile extends Entity
|
|||
return 7;
|
||||
}
|
||||
|
||||
public void playHitSound()
|
||||
{
|
||||
}
|
||||
public void playHitSound() {}
|
||||
|
||||
/**
|
||||
* Called by a player entity when they collide with an entity
|
||||
*/
|
||||
@Override
|
||||
public void onCollideWithPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
if (worldObj.isRemote)
|
||||
|
@ -358,9 +349,7 @@ public abstract class EntityProjectile extends Entity
|
|||
return 0.0F;
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
nbttagcompound.setShort("xTile", (short)xTile);
|
||||
|
@ -375,9 +364,7 @@ public abstract class EntityProjectile extends Entity
|
|||
nbttagcompound.setBoolean("beenInGround", beenInGround);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
xTile = nbttagcompound.getShort("xTile");
|
||||
|
|
|
@ -32,6 +32,7 @@ public enum EnumColor
|
|||
code = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return code;
|
||||
|
|
|
@ -19,16 +19,19 @@ public class ItemBlockGenerator extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
String name = "";
|
||||
|
|
|
@ -25,16 +25,19 @@ public class ItemBlockMachine extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
String name = "";
|
||||
|
|
|
@ -23,16 +23,19 @@ public class ItemBlockMulti extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
String name = "";
|
||||
|
|
|
@ -19,16 +19,19 @@ public class ItemBlockOre extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
String name = "";
|
||||
|
|
|
@ -20,16 +20,19 @@ public class ItemBlockPowerUnit extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getBlockTextureFromSideAndMetadata(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
String name = "";
|
||||
|
|
|
@ -18,6 +18,7 @@ public class ItemDust extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
|
@ -30,6 +31,7 @@ public class ItemDust extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int id, CreativeTabs tabs, List itemList)
|
||||
{
|
||||
for (int counter = 0; counter <= 3; ++counter)
|
||||
|
@ -38,6 +40,7 @@ public class ItemDust extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack item)
|
||||
{
|
||||
return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Dust";
|
||||
|
|
|
@ -31,6 +31,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
int energy = getEnergy(itemstack);
|
||||
|
@ -38,17 +39,20 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
list.add("Stored Energy: " + MekanismUtils.getDisplayedEnergy(energy));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
itemstack = getUnchargedItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
ItemEnergized item = ((ItemEnergized)itemstack.getItem());
|
||||
item.setEnergy(itemstack, item.getEnergy(itemstack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergy(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
|
@ -67,6 +71,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return stored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergy(ItemStack itemstack, int energy)
|
||||
{
|
||||
if(itemstack.stackTagCompound == null)
|
||||
|
@ -86,6 +91,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return charged;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int i, CreativeTabs tabs, List list)
|
||||
{
|
||||
ItemStack discharged = new ItemStack(this);
|
||||
|
@ -96,16 +102,19 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
list.add(charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergy()
|
||||
{
|
||||
return maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRate()
|
||||
{
|
||||
return transferRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int charge(ItemStack itemstack, int amount)
|
||||
{
|
||||
int rejects = Math.max((getEnergy(itemstack) + amount) - maxEnergy, 0);
|
||||
|
@ -113,6 +122,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return rejects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int discharge(ItemStack itemstack, int amount)
|
||||
{
|
||||
int energyToUse = Math.min(getEnergy(itemstack), amount);
|
||||
|
@ -120,6 +130,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return energyToUse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJoules(Object... data)
|
||||
{
|
||||
if(data[0] instanceof ItemStack)
|
||||
|
@ -130,6 +141,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJoules(double joules, Object... data)
|
||||
{
|
||||
if(data[0] instanceof ItemStack)
|
||||
|
@ -140,16 +152,19 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules()
|
||||
{
|
||||
return maxEnergy*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
|
@ -157,6 +172,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, IItem
|
|||
return rejects*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double onUse(double joulesNeeded, ItemStack itemStack)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveElectricity()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProduceElectricity()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDivider()
|
||||
{
|
||||
return divider;
|
||||
|
|
|
@ -8,8 +8,7 @@ import net.minecraft.src.*;
|
|||
|
||||
public class ItemIngot extends ItemMekanism
|
||||
{
|
||||
public static String[] en_USNames = {"Obsidian", "Platinum", "Redstone",
|
||||
"Glowstone"};
|
||||
public static String[] en_USNames = {"Obsidian", "Platinum", "Redstone", "Glowstone"};
|
||||
|
||||
public ItemIngot(int id)
|
||||
{
|
||||
|
@ -18,6 +17,7 @@ public class ItemIngot extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
|
@ -30,6 +30,7 @@ public class ItemIngot extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int id, CreativeTabs tabs, List itemList)
|
||||
{
|
||||
for (int counter = 0; counter <= 3; ++counter)
|
||||
|
@ -38,6 +39,7 @@ public class ItemIngot extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack item)
|
||||
{
|
||||
return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Ingot";
|
||||
|
|
|
@ -12,11 +12,13 @@ public class ItemLightningRod extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
if(itemstack.getItemDamage() == 0)
|
||||
|
@ -49,6 +51,7 @@ public class ItemLightningRod extends ItemMekanism
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(itemstack.getItemDamage() > 0)
|
||||
|
|
|
@ -10,7 +10,9 @@ public class ItemMekanism extends Item
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
public String getTextureFile() {
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/items.png";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,9 @@ public class ItemMekanismArmor extends ItemArmor
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
public String getTextureFile() {
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/items.png";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,10 +14,7 @@ public class ItemMekanismAxe extends ItemMekanismTool
|
|||
super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block != null && par2Block.blockMaterial == Material.wood)
|
||||
|
|
|
@ -13,6 +13,7 @@ public class ItemMekanismBow extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
||||
{
|
||||
return 0x11940;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
|
||||
|
@ -139,6 +145,7 @@ public class ItemMekanismBow extends ItemMekanism
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
return 1;
|
||||
|
|
|
@ -11,10 +11,7 @@ public class ItemMekanismHoe extends ItemMekanism
|
|||
setMaxDamage(par2EnumToolMaterial.getMaxUses());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 !
|
||||
*/
|
||||
@Override
|
||||
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))
|
||||
|
@ -47,9 +44,7 @@ public class ItemMekanismHoe extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns True is the item is renderer in full 3D when hold.
|
||||
*/
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -26,9 +26,7 @@ public class ItemMekanismKnife extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
|
||||
|
@ -56,49 +54,50 @@ public class ItemMekanismKnife extends ItemMekanism
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack itemstack, Block block)
|
||||
{
|
||||
return strVsBlock * (block.blockID != Block.web.blockID ? 1.0F : 10F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the item (tool) can harvest results from the block type.
|
||||
*/
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block)
|
||||
{
|
||||
return block.blockID == Block.web.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
return enchantability;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack itemstack)
|
||||
{
|
||||
return 0x11940;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageVsEntity(Entity entity)
|
||||
{
|
||||
return weaponDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving)
|
||||
{
|
||||
itemstack.damageItem(blockDamage, entityliving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
|
||||
{
|
||||
itemstack.damageItem(entityDamage, entityliving1);
|
||||
|
|
|
@ -15,6 +15,7 @@ public class ItemMekanismPaxel extends ItemMekanismTool
|
|||
super(i, 3, enumtoolmaterial, blocksEffectiveAgainst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block)
|
||||
{
|
||||
if (block == Block.obsidian)
|
||||
|
@ -51,6 +52,7 @@ public class ItemMekanismPaxel extends ItemMekanismTool
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack itemstack, Block block)
|
||||
{
|
||||
if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock))
|
||||
|
|
|
@ -15,9 +15,7 @@ public class ItemMekanismPickaxe extends ItemMekanismTool
|
|||
super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the item (tool) can harvest results from the block type.
|
||||
*/
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block par1Block)
|
||||
{
|
||||
if (par1Block == Block.obsidian)
|
||||
|
@ -58,10 +56,7 @@ public class ItemMekanismPickaxe extends ItemMekanismTool
|
|||
return par1Block.blockMaterial == Material.iron;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
|
||||
|
|
|
@ -13,9 +13,7 @@ public class ItemMekanismSpade extends ItemMekanismTool
|
|||
super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the item (tool) can harvest results from the block type.
|
||||
*/
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block par1Block)
|
||||
{
|
||||
if (par1Block == Block.snow)
|
||||
|
|
|
@ -25,34 +25,27 @@ public class ItemMekanismSword extends ItemMekanism
|
|||
weaponDamage = 4 + par2EnumToolMaterial.getDamageVsEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
|
||||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
|
||||
* the damage on the stack.
|
||||
*/
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
|
||||
{
|
||||
par1ItemStack.damageItem(1, par3EntityLiving);
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the damage against a given entity.
|
||||
*/
|
||||
@Override
|
||||
public int getDamageVsEntity(Entity par1Entity)
|
||||
{
|
||||
return weaponDamage;
|
||||
|
|
|
@ -16,6 +16,7 @@ public class ItemMekanismTool extends ItemTool
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return "/textures/items.png";
|
||||
|
|
|
@ -12,11 +12,13 @@ public class ItemStopwatch extends ItemMekanism {
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack itemstack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
if(itemstack.getItemDamage() == 0)
|
||||
|
@ -26,6 +28,7 @@ public class ItemStopwatch extends ItemMekanism {
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(itemstack.getItemDamage() > 0)
|
||||
|
|
|
@ -12,11 +12,13 @@ public class ItemWeatherOrb extends ItemMekanism
|
|||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack itemstack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
if(itemstack.getItemDamage() == 0)
|
||||
|
@ -26,6 +28,7 @@ public class ItemWeatherOrb extends ItemMekanism
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(itemstack.getItemDamage() > 0)
|
||||
|
|
|
@ -213,7 +213,6 @@ public class Mekanism
|
|||
public static Block ObsidianTNT;
|
||||
public static Block PowerUnit;
|
||||
public static Block Generator;
|
||||
public static Block PlatinumWire;
|
||||
|
||||
//MultiID Items
|
||||
public static Item Dust;
|
||||
|
@ -661,7 +660,6 @@ public class Mekanism
|
|||
LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade");
|
||||
LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade");
|
||||
LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade");
|
||||
LanguageRegistry.addName(new ItemStack(PlatinumWire, 1, 0), "Platinum Wire");
|
||||
|
||||
//Localization for MultiBlock
|
||||
LanguageRegistry.instance().addStringLocalization("tile.MultiBlock.PlatinumBlock.name", "Platinum Block");
|
||||
|
|
|
@ -7,6 +7,7 @@ import cpw.mods.fml.common.IWorldGenerator;
|
|||
|
||||
public class OreHandler implements IWorldGenerator
|
||||
{
|
||||
@Override
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
switch(world.provider.dimensionId)
|
||||
|
|
|
@ -30,6 +30,7 @@ import cpw.mods.fml.server.FMLServerHandler;
|
|||
*/
|
||||
public class PacketHandler implements IPacketHandler
|
||||
{
|
||||
@Override
|
||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
ByteArrayDataInput dataStream = ByteStreams.newDataInput(packet.data);
|
||||
|
|
|
@ -12,6 +12,7 @@ public class SlotEnergy extends Slot
|
|||
super(inventory, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemstack)
|
||||
{
|
||||
return itemstack.getItem() instanceof IEnergizedItem || itemstack.getItem() instanceof IElectricItem || itemstack.getItem() instanceof IItemElectric || itemstack.itemID == Item.redstone.shiftedIndex;
|
||||
|
|
|
@ -10,6 +10,7 @@ public class SlotMachineUpgrade extends Slot
|
|||
super(inventory, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemstack)
|
||||
{
|
||||
return itemstack.getItem() instanceof ItemMachineUpgrade;
|
||||
|
|
|
@ -13,6 +13,7 @@ public class ThreadGetData extends Thread
|
|||
start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion();
|
||||
|
|
|
@ -66,6 +66,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
*/
|
||||
public abstract int getFuelTicks(ItemStack itemstack);
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
@ -244,6 +245,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operate()
|
||||
{
|
||||
if (!canOperate())
|
||||
|
@ -278,6 +280,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
|
@ -317,16 +320,19 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
PacketHandler.sendAdvancedElectricMachinePacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
PacketHandler.sendAdvancedElectricMachinePacketWithRange(this, 50);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
|
||||
{
|
||||
try {
|
||||
|
@ -345,6 +351,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
@ -352,6 +359,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
secondaryEnergyStored = nbtTags.getInteger("secondaryEnergyStored");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
@ -378,11 +386,13 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
return secondaryEnergyStored*i / MAX_SECONDARY_ENERGY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
return new String[] {"getStored", "getSecondaryStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
|
||||
{
|
||||
switch(method)
|
||||
|
|
|
@ -87,6 +87,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(!registered && worldObj != null && !worldObj.isRemote)
|
||||
|
@ -104,7 +105,6 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void handleSound()
|
||||
{
|
||||
System.out.println(xCoord + " " + yCoord + " " + zCoord);
|
||||
if(audio == null && worldObj != null && worldObj.isRemote)
|
||||
{
|
||||
if(FMLClientHandler.instance().getClient().sndManager.sndSystem != null)
|
||||
|
@ -127,6 +127,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
@ -140,6 +141,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
isActive = nbtTags.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
@ -153,6 +155,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
nbtTags.setBoolean("isActive", isActive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
|
@ -168,11 +171,13 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean demandsEnergy()
|
||||
{
|
||||
return energyStored < currentMaxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int injectEnergy(Direction direction, int i)
|
||||
{
|
||||
int rejects = 0;
|
||||
|
@ -190,23 +195,28 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
return rejects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPowerProvider(IPowerProvider provider)
|
||||
{
|
||||
powerProvider = provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerProvider getPowerProvider()
|
||||
{
|
||||
return powerProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int powerRequest()
|
||||
{
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork() {}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction)
|
||||
{
|
||||
return true;
|
||||
|
@ -232,41 +242,49 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
return operatingTicks*i / currentTicksRequired;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules()
|
||||
{
|
||||
return currentMaxEnergy*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJoules(Object... data)
|
||||
{
|
||||
return energyStored*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJoules(double joules, Object... data)
|
||||
{
|
||||
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveFromSide(ForgeDirection side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage()
|
||||
{
|
||||
return 120;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double wattRequest()
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActive(boolean active)
|
||||
{
|
||||
isActive = active;
|
||||
|
@ -305,20 +324,25 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
prevActive = active;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttachToSide(int side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attach(IComputerAccess computer, String computerSide) {}
|
||||
|
||||
@Override
|
||||
public void detach(IComputerAccess computer) {}
|
||||
|
||||
@Override
|
||||
public int transferToAcceptor(int amount)
|
||||
{
|
||||
int rejects = 0;
|
||||
|
@ -336,6 +360,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
return rejects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceive(ForgeDirection side)
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -14,11 +14,13 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
|
|||
super("Combiner.ogg", "Combiner", "/gui/GuiCombiner.png", 5, 1, 200, 1000, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getRecipes()
|
||||
{
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuelTicks(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.getItem() instanceof ItemBlock && itemstack.itemID == Block.cobblestone.blockID)
|
||||
|
|
|
@ -14,6 +14,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine
|
|||
super("Crusher.ogg", "Crusher", "/gui/GuiCrusher.png", 5, 200, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getRecipes()
|
||||
{
|
||||
return recipes;
|
||||
|
|
|
@ -47,8 +47,11 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
MAX_ENERGY = maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if(!initialized && worldObj != null)
|
||||
{
|
||||
if(Mekanism.hooks.IC2Loaded)
|
||||
|
@ -65,7 +68,10 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
{
|
||||
if(playersUsing > 0)
|
||||
{
|
||||
sendPacketWithRange();
|
||||
if(packetTick % 3 == 0)
|
||||
{
|
||||
sendPacketWithRange();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(packetTick % 20 == 0)
|
||||
|
@ -82,6 +88,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
*/
|
||||
public abstract void onUpdate();
|
||||
|
||||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if (side == ForgeDirection.DOWN) return 1;
|
||||
|
@ -89,21 +96,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inventory.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1)
|
||||
{
|
||||
return inventory[par1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2)
|
||||
{
|
||||
if (inventory[par1] != null)
|
||||
|
@ -134,6 +145,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int par1)
|
||||
{
|
||||
if (inventory[par1] != null)
|
||||
|
@ -148,6 +160,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
|
||||
{
|
||||
inventory[par1] = par2ItemStack;
|
||||
|
@ -158,6 +171,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
@ -180,6 +194,7 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
facing = nbtTags.getInteger("facing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
@ -202,21 +217,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
nbtTags.setTag("Items", tagList);
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing()
|
||||
{
|
||||
return (short)facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short direction)
|
||||
{
|
||||
if(initialized)
|
||||
|
@ -237,11 +256,13 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate()
|
||||
{
|
||||
return 1.0F;
|
||||
|
@ -252,21 +273,25 @@ public abstract class TileEntityElectricBlock extends TileEntityDisableable impl
|
|||
return initialized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
{
|
||||
return fullName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest()
|
||||
{
|
||||
playersUsing++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest()
|
||||
{
|
||||
playersUsing--;
|
||||
|
|
|
@ -45,6 +45,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
inventory = new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
@ -188,6 +189,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operate()
|
||||
{
|
||||
if (!canOperate())
|
||||
|
@ -222,6 +224,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
|
@ -256,16 +259,19 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
PacketHandler.sendElectricMachinePacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
PacketHandler.sendElectricMachinePacketWithRange(this, 50);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
|
||||
{
|
||||
try {
|
||||
|
@ -283,11 +289,13 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
return new String[] {"getStored", "getProgress", "isActive", "facing", "canOperate", "getMaxEnergy", "getEnergyNeeded"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
|
||||
{
|
||||
switch(method)
|
||||
|
|
|
@ -14,6 +14,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
|
|||
super("Chamber.ogg", "Enrichment Chamber", "/gui/GuiChamber.png", 5, 200, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getRecipes()
|
||||
{
|
||||
return recipes;
|
||||
|
|
|
@ -63,6 +63,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(powerProvider != null)
|
||||
|
@ -283,6 +284,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
@ -311,6 +313,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
facing = nbtTags.getInteger("facing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
@ -339,16 +342,19 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
nbtTags.setTag("Items", tagList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage()
|
||||
{
|
||||
return 120;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJoules(double joules, Object... data)
|
||||
{
|
||||
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
|
||||
{
|
||||
try {
|
||||
|
@ -363,26 +369,31 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
PacketHandler.sendGeneratorPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
PacketHandler.sendGeneratorPacketWithRange(this, 50);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded", "getFuel", "getFuelNeeded"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
|
||||
{
|
||||
switch(method)
|
||||
|
@ -405,79 +416,97 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttachToSide(int side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attach(IComputerAccess computer, String computerSide) {}
|
||||
|
||||
@Override
|
||||
public void detach(IComputerAccess computer) {}
|
||||
|
||||
@Override
|
||||
public void setPowerProvider(IPowerProvider provider)
|
||||
{
|
||||
powerProvider = provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerProvider getPowerProvider()
|
||||
{
|
||||
return powerProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork() {}
|
||||
|
||||
@Override
|
||||
public int powerRequest()
|
||||
{
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules()
|
||||
{
|
||||
return MAX_ENERGY*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJoules(Object... data)
|
||||
{
|
||||
return energyStored*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean emitsEnergyTo(TileEntity receiver, Direction direction)
|
||||
{
|
||||
return direction.toForgeDirection() == ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStored()
|
||||
{
|
||||
return energyStored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity()
|
||||
{
|
||||
return MAX_ENERGY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRate()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection side)
|
||||
{
|
||||
return side == ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) {}
|
||||
|
||||
@Override
|
||||
public double wattRequest()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveFromSide(ForgeDirection side)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -11,6 +11,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator
|
|||
super("Heat Generator", 8000, 2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuel(ItemStack itemstack)
|
||||
{
|
||||
return TileEntityFurnace.getItemBurnTime(itemstack);
|
||||
|
|
|
@ -19,12 +19,14 @@ public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMach
|
|||
{
|
||||
super("Compressor.ogg", "Platinum Compressor", "/gui/GuiCompressor.png", 5, 1, 200, 1000, 200);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List getRecipes()
|
||||
{
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuelTicks(ItemStack itemstack)
|
||||
{
|
||||
if (itemstack.itemID == new ItemStack(Mekanism.Ingot, 1, 1).itemID) return 200;
|
||||
|
|
|
@ -75,6 +75,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(powerProvider != null)
|
||||
|
@ -229,6 +230,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
energyStored = Math.max(Math.min(energy, MAX_ENERGY), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
@ -256,6 +258,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
facing = nbtTags.getInteger("facing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
@ -283,6 +286,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
nbtTags.setTag("Items", tagList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream)
|
||||
{
|
||||
try {
|
||||
|
@ -296,31 +300,37 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, Direction direction)
|
||||
{
|
||||
return direction.toForgeDirection() != ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStored()
|
||||
{
|
||||
return energyStored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity()
|
||||
{
|
||||
return MAX_ENERGY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRate()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean demandsEnergy()
|
||||
{
|
||||
return energyStored < MAX_ENERGY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int injectEnergy(Direction direction, int i)
|
||||
{
|
||||
int rejects = 0;
|
||||
|
@ -338,53 +348,64 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
return rejects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean emitsEnergyTo(TileEntity receiver, Direction direction)
|
||||
{
|
||||
return direction.toForgeDirection() == ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJoules(Object... data)
|
||||
{
|
||||
return energyStored*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJoules(double joules, Object... data)
|
||||
{
|
||||
setEnergy((int)(joules*UniversalElectricity.TO_IC2_RATIO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules()
|
||||
{
|
||||
return MAX_ENERGY*UniversalElectricity.IC2_RATIO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPowerProvider(IPowerProvider provider)
|
||||
{
|
||||
powerProvider = provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerProvider getPowerProvider()
|
||||
{
|
||||
return powerProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork() {}
|
||||
|
||||
@Override
|
||||
public int powerRequest()
|
||||
{
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage()
|
||||
{
|
||||
return 120;
|
||||
|
@ -406,6 +427,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double wattRequest()
|
||||
{
|
||||
return ElectricInfo.getWatts(MAX_ENERGY*UniversalElectricity.IC2_RATIO) - ElectricInfo.getWatts(energyStored*UniversalElectricity.IC2_RATIO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveFromSide(ForgeDirection side)
|
||||
{
|
||||
return side != ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getMethodNames()
|
||||
{
|
||||
return new String[] {"getStored", "getOutput", "getMaxEnergy", "getEnergyNeeded"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception
|
||||
{
|
||||
switch(method)
|
||||
|
@ -461,15 +488,19 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttachToSide(int side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attach(IComputerAccess computer, String computerSide) {}
|
||||
|
||||
@Override
|
||||
public void detach(IComputerAccess computer) {}
|
||||
|
||||
@Override
|
||||
public int transferToAcceptor(int amount)
|
||||
{
|
||||
int rejects = 0;
|
||||
|
@ -487,16 +518,19 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne
|
|||
return rejects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceive(ForgeDirection side)
|
||||
{
|
||||
return side != ForgeDirection.getOrientation(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket()
|
||||
{
|
||||
PacketHandler.sendPowerUnitPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketWithRange()
|
||||
{
|
||||
PacketHandler.sendPowerUnitPacketWithRange(this, 50);
|
||||
|
|
|
@ -15,11 +15,13 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
super("Elementizer.ogg", "Theoretical Elementizer", "/gui/GuiElementizer.png", 50, 1, 1000, 10000, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getRecipes()
|
||||
{
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuelTicks(ItemStack itemstack)
|
||||
{
|
||||
if (itemstack.itemID == Item.diamond.shiftedIndex) return 1000;
|
||||
|
|
|
@ -37,6 +37,7 @@ public class Version
|
|||
build = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if(major == 0 && minor == 0 && build == 0)
|
||||
|
|
|
@ -43,11 +43,13 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
|||
*/
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public int getArmorIndex(String string)
|
||||
{
|
||||
return RenderingRegistry.addNewArmourRendererPrefix(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderInformation()
|
||||
{
|
||||
System.out.println("[Mekanism] Beginning render initiative...");
|
||||
|
@ -79,11 +81,13 @@ public class ClientProxy extends CommonProxy
|
|||
System.out.println("[Mekanism] Render initiative complete.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld()
|
||||
{
|
||||
return FMLClientHandler.instance().getClient().theWorld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUtilities()
|
||||
{
|
||||
System.out.println("[Mekanism] Beginning utility initiative...");
|
||||
|
@ -91,6 +95,7 @@ public class ClientProxy extends CommonProxy
|
|||
System.out.println("[Mekanism] Utility initiative complete.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
switch(ID)
|
||||
|
@ -128,11 +133,13 @@ public class ClientProxy extends CommonProxy
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTickHandler()
|
||||
{
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadSoundHandler()
|
||||
{
|
||||
Mekanism.audioHandler = new SoundHandler();
|
||||
|
|
|
@ -17,6 +17,7 @@ import cpw.mods.fml.common.TickType;
|
|||
*/
|
||||
public class ClientTickHandler implements ITickHandler
|
||||
{
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks()
|
||||
{
|
||||
return EnumSet.of(TickType.CLIENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel()
|
||||
{
|
||||
return "Mekanism";
|
||||
|
|
|
@ -16,18 +16,14 @@ public class GuiAdvancedElectricMachine extends GuiContainer
|
|||
tileEntity = tentity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
|
||||
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the background layer for the GuiContainer (everything behind the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath);
|
||||
|
|
|
@ -28,6 +28,7 @@ public class GuiControlPanel extends GuiScreen
|
|||
worldObj = world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
|
@ -48,6 +49,7 @@ public class GuiControlPanel extends GuiScreen
|
|||
zField.setText("" + 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(char c, int i)
|
||||
{
|
||||
super.keyTyped(c, i);
|
||||
|
@ -75,11 +78,13 @@ public class GuiControlPanel extends GuiScreen
|
|||
zField.textboxKeyTyped(c, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
xField.updateCursorCounter();
|
||||
|
@ -95,6 +100,7 @@ public class GuiControlPanel extends GuiScreen
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int z)
|
||||
{
|
||||
super.mouseClicked(x, y, z);
|
||||
|
@ -103,6 +109,7 @@ public class GuiControlPanel extends GuiScreen
|
|||
zField.mouseClicked(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if(!guibutton.enabled)
|
||||
|
|
|
@ -14,6 +14,7 @@ public class GuiCredits extends GuiScreen {
|
|||
|
||||
private static String updateProgress = "";
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
controlList.clear();
|
||||
|
@ -21,6 +22,7 @@ public class GuiCredits extends GuiScreen {
|
|||
controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
{
|
||||
updateProgress = "";
|
||||
|
@ -36,6 +38,7 @@ public class GuiCredits extends GuiScreen {
|
|||
updateProgress = EnumColor.DARK_RED + "Error updating.";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if(!guibutton.enabled)
|
||||
|
@ -65,6 +68,7 @@ public class GuiCredits extends GuiScreen {
|
|||
drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
drawDefaultBackground();
|
||||
|
|
|
@ -16,18 +16,14 @@ public class GuiElectricMachine extends GuiContainer
|
|||
tileEntity = tentity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
|
||||
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the background layer for the GuiContainer (everything behind the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
int texture = mc.renderEngine.getTexture(tileEntity.guiTexturePath);
|
||||
|
|
|
@ -20,9 +20,7 @@ public class GuiGenerator extends GuiContainer
|
|||
tileEntity = tentity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the background layer for the GuiContainer (everything behind the items)
|
||||
*/
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
int texture = mc.renderEngine.getTexture("/gui/GuiGenerator.png");
|
||||
|
|
|
@ -20,6 +20,7 @@ public class GuiPowerUnit extends GuiContainer
|
|||
tileEntity = tentity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||
{
|
||||
int texture = mc.renderEngine.getTexture("/gui/GuiPowerUnit.png");
|
||||
|
|
|
@ -18,6 +18,7 @@ public class GuiStopwatch extends GuiScreen {
|
|||
player = entityplayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(char c, int i)
|
||||
{
|
||||
if (i == 1)
|
||||
|
@ -51,11 +54,13 @@ public class GuiStopwatch extends GuiScreen {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if(guibutton.id == 0)
|
||||
|
@ -95,16 +100,4 @@ public class GuiStopwatch extends GuiScreen {
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ public class GuiTheoreticalElementizer extends GuiAdvancedElectricMachine
|
|||
super(inventory, tentity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
super.drawGuiContainerForegroundLayer(par1, par2);
|
||||
|
|
|
@ -19,6 +19,7 @@ public class GuiWeatherOrb extends GuiScreen {
|
|||
player = entityplayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(char c, int i)
|
||||
{
|
||||
if (i == 1)
|
||||
|
@ -52,11 +55,13 @@ public class GuiWeatherOrb extends GuiScreen {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
if(guibutton.id == 0)
|
||||
|
@ -96,16 +101,4 @@ public class GuiWeatherOrb extends GuiScreen {
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,12 +86,7 @@ public class RenderKnife extends Render
|
|||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
renderKnife((EntityKnife)entity, d, d1, d2, f, f1);
|
||||
|
|
|
@ -62,12 +62,7 @@ public class RenderObsidianTNT extends Render
|
|||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
renderObsidianTNT((EntityObsidianTNT)entity, d, d1, d2, f, f1);
|
||||
|
|
|
@ -119,7 +119,7 @@ public class Sound
|
|||
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);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ public class TextureAnimatedFX extends ModTextureAnimation
|
|||
super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindImage(RenderEngine renderengine)
|
||||
{
|
||||
//Binds texture with GL11 to use specific icon index.
|
||||
|
|
|
@ -32,6 +32,7 @@ public class ThreadClientUpdate extends Thread
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
File download = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/mods/Mekanism.jar").toString());
|
||||
|
|
|
@ -22,6 +22,7 @@ public class ThreadSendData extends Thread
|
|||
start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
System.out.println("[Mekanism] Initiating server protocol...");
|
||||
|
|
Loading…
Reference in a new issue