mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Fix the compile errors in MekTools
This commit is contained in:
1 parent
70f440446f
commit
1dfba5e6c9
8 files changed
+39
-28
No files matched your search
@@ -390,7 +390,7 @@ public class MekanismTools implements IModule
|
||||
);
|
||||
|
||||
//Armors
|
||||
armorOBSIDIAN = EnumHelper.addArmorMaterial("OBSIDIAN"
|
||||
armorOBSIDIAN = EnumHelper.addArmorMaterial("OBSIDIAN", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.obsidian", "durability", 50).getInt()
|
||||
, new int[]
|
||||
{
|
||||
@@ -401,7 +401,7 @@ public class MekanismTools implements IModule
|
||||
}
|
||||
, Mekanism.configuration.get("tools.armor-balance.obsidian", "enchantability", 40).getInt()
|
||||
);
|
||||
armorLAZULI = EnumHelper.addArmorMaterial("LAZULI"
|
||||
armorLAZULI = EnumHelper.addArmorMaterial("LAZULI", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.lapis", "durability", 13).getInt()
|
||||
, new int[]
|
||||
{
|
||||
@@ -412,7 +412,7 @@ public class MekanismTools implements IModule
|
||||
}
|
||||
, Mekanism.configuration.get("tools.armor-balance.lapis", "enchantability", 8).getInt()
|
||||
);
|
||||
armorOSMIUM = EnumHelper.addArmorMaterial("OSMIUM"
|
||||
armorOSMIUM = EnumHelper.addArmorMaterial("OSMIUM", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.osmium", "durability", 30).getInt()
|
||||
, new int[]
|
||||
{
|
||||
@@ -423,7 +423,7 @@ public class MekanismTools implements IModule
|
||||
}
|
||||
, Mekanism.configuration.get("tools.armor-balance.osmium", "enchantability", 12).getInt()
|
||||
);
|
||||
armorBRONZE = EnumHelper.addArmorMaterial("BRONZE"
|
||||
armorBRONZE = EnumHelper.addArmorMaterial("BRONZE", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.bronze", "durability", 35).getInt()
|
||||
, new int[]
|
||||
{
|
||||
@@ -434,7 +434,7 @@ public class MekanismTools implements IModule
|
||||
}
|
||||
, Mekanism.configuration.get("tools.armor-balance.bronze", "enchantability", 10).getInt()
|
||||
);
|
||||
armorGLOWSTONE = EnumHelper.addArmorMaterial("GLOWSTONE"
|
||||
armorGLOWSTONE = EnumHelper.addArmorMaterial("GLOWSTONE", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.glowstone", "durability", 18).getInt()
|
||||
, new int[]
|
||||
{
|
||||
@@ -445,7 +445,7 @@ public class MekanismTools implements IModule
|
||||
}
|
||||
, Mekanism.configuration.get("tools.armor-balance.glowstone", "enchantability", 18).getInt()
|
||||
);
|
||||
armorSTEEL = EnumHelper.addArmorMaterial("STEEL"
|
||||
armorSTEEL = EnumHelper.addArmorMaterial("STEEL", "TODO"
|
||||
, Mekanism.configuration.get("tools.armor-balance.steel", "durability", 40).getInt()
|
||||
, new int[]
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@ import mekanism.common.util.LangUtils;
|
||||
import mekanism.tools.common.MekanismTools;
|
||||
import mekanism.tools.common.ToolsItems;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -34,11 +33,13 @@ public class ItemMekanismArmor extends ItemArmor
|
||||
list.add(LangUtils.localize("tooltip.hp") + ": " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
itemIcon = register.registerIcon("mekanism:" + getUnlocalizedName().replace("item.", ""));
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||
@@ -80,7 +81,7 @@ public class ItemMekanismArmor extends ItemArmor
|
||||
return new ItemStack(MekanismItems.Ingot, 1, 4);
|
||||
}
|
||||
|
||||
return new ItemStack(getArmorMaterial().func_151685_b());
|
||||
return new ItemStack(getArmorMaterial().getRepairItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package mekanism.tools.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -15,14 +16,14 @@ public class ItemMekanismAxe extends ItemMekanismTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack itemstack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack itemstack, IBlockState blockState)
|
||||
{
|
||||
if(block != null && block.getMaterial() == Material.wood)
|
||||
if(blockState != null && blockState.getBlock() != null && blockState.getBlock().getMaterial() == Material.wood)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
else {
|
||||
return super.getDigSpeed(itemstack, block, meta);
|
||||
return super.getDigSpeed(itemstack, blockState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,14 @@ import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.item.ItemMekanism;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
@@ -37,14 +41,14 @@ public class ItemMekanismHoe extends ItemMekanism
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int x, int y, int z, int side, float entityX, float entityY, float entityZ)
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos pos, EnumFacing side, float entityX, float entityY, float entityZ)
|
||||
{
|
||||
if(!entityplayer.canPlayerEdit(x, y, z, side, itemstack))
|
||||
if(!entityplayer.canPlayerEdit(pos, side, itemstack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
UseHoeEvent event = new UseHoeEvent(entityplayer, itemstack, world, x, y, z);
|
||||
UseHoeEvent event = new UseHoeEvent(entityplayer, itemstack, world, pos);
|
||||
|
||||
if(MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
@@ -57,23 +61,23 @@ public class ItemMekanismHoe extends ItemMekanism
|
||||
return true;
|
||||
}
|
||||
|
||||
Block blockID = world.getBlock(x, y, z);
|
||||
Block aboveBlock = world.getBlock(x, y + 1, z);
|
||||
Block blockID = world.getBlockState(pos).getBlock();
|
||||
Block aboveBlock = world.getBlockState(pos.add(0, 1, 0)).getBlock();
|
||||
|
||||
if((side == 0 || !aboveBlock.isAir(world, x, y, z+1) || blockID != Blocks.grass) && blockID != Blocks.dirt)
|
||||
if((side == EnumFacing.DOWN || !aboveBlock.isAir(world, pos.add(0, 1, 0)) || blockID != Blocks.grass) && blockID != Blocks.dirt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
Block block = Blocks.farmland;
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getStepResourcePath(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
IBlockState block = Blocks.farmland.getDefaultState();
|
||||
world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, block.getBlock().stepSound.getStepSound(), (block.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, block.getBlock().stepSound.getFrequency() * 0.8F);
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
world.setBlock(x, y, z, block);
|
||||
world.setBlockState(pos, block);
|
||||
itemstack.damageItem(1, entityplayer);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package mekanism.tools.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -13,9 +15,9 @@ public class ItemMekanismPaxel extends ItemMekanismTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack stack, IBlockState blockState)
|
||||
{
|
||||
return block != Blocks.bedrock ? efficiencyOnProperMaterial : 1.0F;
|
||||
return blockState.getBlock() != Blocks.bedrock ? efficiencyOnProperMaterial : 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package mekanism.tools.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -61,14 +62,14 @@ public class ItemMekanismPickaxe extends ItemMekanismTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack itemstack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack itemstack, IBlockState blockState)
|
||||
{
|
||||
if(block != null && (block.getMaterial() == Material.iron || block.getMaterial() == Material.anvil || block.getMaterial() == Material.rock))
|
||||
if(blockState != null && blockState.getBlock() != null && (blockState.getBlock().getMaterial() == Material.iron || blockState.getBlock().getMaterial() == Material.anvil || blockState.getBlock().getMaterial() == Material.rock))
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
else {
|
||||
return super.getDigSpeed(itemstack, block, meta);
|
||||
return super.getDigSpeed(itemstack, blockState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
@@ -23,9 +22,11 @@ public class ItemMekanismSword extends ItemSword
|
||||
list.add(LangUtils.localize("tooltip.hp") + ": " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
itemIcon = register.registerIcon("mekanism:" + getUnlocalizedName().replace("item.", ""));
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import mekanism.common.MekanismItems;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.tools.common.MekanismTools;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -68,12 +67,14 @@ public class ItemMekanismTool extends ItemTool
|
||||
return new ItemStack(MekanismItems.Ingot, 1, 4);
|
||||
}
|
||||
|
||||
return new ItemStack(material.func_150995_f());
|
||||
return material.getRepairItemStack();
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
itemIcon = register.registerIcon("mekanism:" + getUnlocalizedName().replace("item.", ""));
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in new issue
Block a user