Little clean and format change
This commit is contained in:
parent
ce4312a578
commit
20a9cabf93
9 changed files with 126 additions and 263 deletions
|
@ -30,59 +30,47 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem,
|
|||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
|
||||
public ItemGravityChest(ArmorMaterial material, int par3, int par4)
|
||||
{
|
||||
public ItemGravityChest(ArmorMaterial material, int par3, int par4){
|
||||
super(material, par3, par4);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.gravitychestplate");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(120);
|
||||
// isDamageable();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "items/gravitychestplate");
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:" + "items/gravitychestplate");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
|
||||
String type)
|
||||
{
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
|
||||
return "techreborn:" + "textures/models/gravitychestplate.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack){
|
||||
if (world.isRemote)
|
||||
;
|
||||
if (ElectricItem.manager.canUse(stack, cost))
|
||||
{
|
||||
if (ElectricItem.manager.canUse(stack, cost)){
|
||||
player.capabilities.allowFlying = true;
|
||||
|
||||
if (player.fallDistance > 0.0F)
|
||||
|
@ -101,56 +89,45 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem,
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage()
|
||||
{
|
||||
public int getEnergyPerDamage(){
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player,
|
||||
ItemStack armor, DamageSource source, double damage, int slot)
|
||||
{
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot){
|
||||
if (source.isUnblockable()){
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(
|
||||
0, 0.0D, 3);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio()
|
||||
* getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
|
@ -163,33 +140,25 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem,
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
|
||||
{
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
|
||||
{
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot){
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()){
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio()
|
||||
* getDamageAbsorptionRatio());
|
||||
} else
|
||||
{
|
||||
} else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack,
|
||||
DamageSource source, int damage, int slot)
|
||||
{
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(),
|
||||
0x7fffffff, true, false, false);
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot){
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio()
|
||||
{
|
||||
public double getDamageAbsorptionRatio(){
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio()
|
||||
{
|
||||
private double getBaseAbsorptionRatio(){
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ public class ItemLapotronPack extends ItemArmor implements IElectricItem {
|
|||
public static final int tier = ConfigTechReborn.LapotronPackTier;
|
||||
public double transferLimit = 100000;
|
||||
|
||||
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3)
|
||||
{
|
||||
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3){
|
||||
super(armormaterial, par2, par3);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.lapotronpack");
|
||||
|
@ -32,73 +31,58 @@ public class ItemLapotronPack extends ItemArmor implements IElectricItem {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "tool/lapotronicEnergyOrb");
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lapotronicEnergyOrb");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
|
||||
String type)
|
||||
{
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot,String type){
|
||||
return "techreborn:" + "textures/models/lapotronpack.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ public class ItemLithiumBatpack extends ItemArmor implements IElectricItem {
|
|||
public static final int tier = ConfigTechReborn.LithiumBatpackTier;
|
||||
public double transferLimit = 10000;
|
||||
|
||||
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4)
|
||||
{
|
||||
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4){
|
||||
super(armorMaterial, par3, par4);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("techreborn.lithiumbatpack");
|
||||
|
@ -32,73 +31,59 @@ public class ItemLithiumBatpack extends ItemArmor implements IElectricItem {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "tool/lithiumBatpack");
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lithiumBatpack");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
|
||||
String type)
|
||||
{
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
|
||||
return "techreborn:" + "textures/models/lithiumbatpack.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,7 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem {
|
|||
public static final int tier = ConfigTechReborn.AdvancedDrillTier;
|
||||
public double transferLimit = 100;
|
||||
|
||||
public ItemAdvancedDrill()
|
||||
{
|
||||
public ItemAdvancedDrill(){
|
||||
super(ToolMaterial.EMERALD);
|
||||
efficiencyOnProperMaterial = 20F;
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
|
@ -40,8 +39,7 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "tool/advancedDrill");
|
||||
}
|
||||
|
@ -49,111 +47,86 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem {
|
|||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block,
|
||||
int par4, int par5, int par6, EntityLivingBase entityLiving)
|
||||
{
|
||||
int par4, int par5, int par6, EntityLivingBase entityLiving){
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack)
|
||||
{
|
||||
return Items.diamond_pickaxe.canHarvestBlock(block, stack)
|
||||
|| Items.diamond_shovel.canHarvestBlock(block, stack);
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack){
|
||||
return Items.diamond_pickaxe.canHarvestBlock(block, stack)|| Items.diamond_shovel.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
{
|
||||
if (!ElectricItem.manager.canUse(stack, cost))
|
||||
{
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta){
|
||||
if (!ElectricItem.manager.canUse(stack, cost)){
|
||||
return 4.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|
||||
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F)
|
||||
{
|
||||
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F){
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack,
|
||||
EntityLivingBase entityliving, EntityLivingBase entityliving1)
|
||||
{
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float xOffset, float yOffset,
|
||||
float zOffset)
|
||||
{
|
||||
return TorchHelper.placeTorch(stack, player, world, x, y, z, side,
|
||||
xOffset, yOffset, zOffset);
|
||||
int x, int y, int z, int side, float xOffset, float yOffset, float zOffset){
|
||||
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
public boolean isRepairable(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,7 @@ import net.minecraft.item.ItemBucket;
|
|||
public class ItemFluidbucket extends ItemBucket{
|
||||
private String iconName;
|
||||
|
||||
public ItemFluidbucket(Block block)
|
||||
{
|
||||
public ItemFluidbucket(Block block){
|
||||
super(block);
|
||||
setContainerItem(Items.bucket);
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
|
@ -22,16 +21,14 @@ public class ItemFluidbucket extends ItemBucket{
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str)
|
||||
{
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
iconName = par1Str;
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
this.itemIcon = par1IconRegister.registerIcon("techreborn:bucket/" + iconName);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ public class ItemHammer extends ItemTR{
|
|||
public boolean getShareTag(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,7 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem {
|
|||
public int cost = 100;
|
||||
public int hitCost = 125;
|
||||
|
||||
public ItemOmniTool(ToolMaterial toolMaterial)
|
||||
{
|
||||
public ItemOmniTool(ToolMaterial toolMaterial){
|
||||
super(toolMaterial);
|
||||
efficiencyOnProperMaterial = 13F;
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
|
@ -41,43 +40,38 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "tool/omnitool");
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/omnitool");
|
||||
}
|
||||
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block,
|
||||
int par4, int par5, int par6, EntityLivingBase entityLiving)
|
||||
{
|
||||
int par4, int par5, int par6, EntityLivingBase entityLiving){
|
||||
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack)
|
||||
{
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack){
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack)
|
||||
|| Items.diamond_sword.canHarvestBlock(block, stack)
|
||||
|| Items.diamond_pickaxe.canHarvestBlock(block, stack)
|
||||
|
@ -86,10 +80,8 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
{
|
||||
if (!ElectricItem.manager.canUse(stack, cost))
|
||||
{
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta){
|
||||
if (!ElectricItem.manager.canUse(stack, cost)){
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
|
@ -97,76 +89,59 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem {
|
|||
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F
|
||||
|| Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|
||||
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F
|
||||
|| Items.shears.getDigSpeed(stack, block, meta) > 1.0F)
|
||||
{
|
||||
|| Items.shears.getDigSpeed(stack, block, meta) > 1.0F){
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
} else{
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack,
|
||||
EntityLivingBase entityliving, EntityLivingBase attacker)
|
||||
{
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving
|
||||
.attackEntityFrom(DamageSource
|
||||
.causePlayerDamage((EntityPlayer) attacker), 8F);
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker){
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)){
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float xOffset, float yOffset,
|
||||
float zOffset)
|
||||
{
|
||||
return TorchHelper.placeTorch(stack, player, world, x, y, z, side,
|
||||
xOffset, yOffset, zOffset);
|
||||
int x, int y, int z, int side, float xOffset, float yOffset, float zOffset){
|
||||
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
public boolean isRepairable(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ public class ItemRockCutter extends ItemPickaxe implements IElectricItem {
|
|||
public int cost = 500;
|
||||
public static final int tier = ConfigTechReborn.RockCutterTier;
|
||||
|
||||
public ItemRockCutter(ToolMaterial toolMaterial)
|
||||
{
|
||||
public ItemRockCutter(ToolMaterial toolMaterial){
|
||||
super(toolMaterial);
|
||||
setUnlocalizedName("techreborn.rockcutter");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
|
@ -37,83 +36,68 @@ public class ItemRockCutter extends ItemPickaxe implements IElectricItem {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:"
|
||||
+ "tool/rockcutter");
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/rockcutter");
|
||||
}
|
||||
|
||||
@SuppressWarnings(
|
||||
{ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List itemList)
|
||||
{
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList){
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this)
|
||||
{
|
||||
if (getChargedItem(itemStack) == this){
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,
|
||||
false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this)
|
||||
{
|
||||
|
||||
if (getEmptyItem(itemStack) == this){
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack)
|
||||
{
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack){
|
||||
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
public boolean isRepairable(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onCreated(ItemStack par1ItemStack, World par2World,
|
||||
EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
|
||||
par1ItemStack.addEnchantment(Enchantment.silkTouch, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
{
|
||||
public boolean canProvideEnergy(ItemStack itemStack){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getChargedItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
{
|
||||
public Item getEmptyItem(ItemStack itemStack){
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
public double getMaxCharge(ItemStack itemStack){
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
{
|
||||
public int getTier(ItemStack itemStack){
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
{
|
||||
public double getTransferLimit(ItemStack itemStack){
|
||||
return 300;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,23 +11,19 @@ import techreborn.client.TechRebornCreativeTab;
|
|||
|
||||
public class ItemTechPda extends Item {
|
||||
|
||||
public ItemTechPda()
|
||||
{
|
||||
public ItemTechPda(){
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.pda");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IIconRegister iconRegister){
|
||||
itemIcon = iconRegister.registerIcon("techreborn:" + "tool/pda");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world,
|
||||
EntityPlayer player)
|
||||
{
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player){
|
||||
player.openGui(Core.INSTANCE, GuiHandler.pdaID, world,
|
||||
(int) player.posX, (int) player.posY, (int) player.posY);
|
||||
return itemStack;
|
||||
|
|
Loading…
Reference in a new issue