當前位置: 首頁>>代碼示例>>Java>>正文


Java ItemHoe類代碼示例

本文整理匯總了Java中net.minecraft.item.ItemHoe的典型用法代碼示例。如果您正苦於以下問題:Java ItemHoe類的具體用法?Java ItemHoe怎麽用?Java ItemHoe使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ItemHoe類屬於net.minecraft.item包,在下文中一共展示了ItemHoe類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyBackers

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static void applyBackers(List<MaterialDefinition> definitions) {
    for (MaterialDefinition definition : definitions) {
        ToolMaterial toolMaterial = definition.getToolMaterial();
        ArmorMaterial armorMaterial = definition.getArmorMaterial();

        RandoresItemData itemData = definition.getData();

        RandoresItems.hoe.registerBacker(itemData, new ItemHoe(toolMaterial));
        RandoresItems.sword.registerBacker(itemData, new ItemSword(toolMaterial));
        RandoresItems.axe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 5f, -3f));
        RandoresItems.shovel.registerBacker(itemData, new ItemSpade(toolMaterial));
        RandoresItems.pickaxe.registerBacker(itemData, new ConstructablePickaxe(toolMaterial));
        RandoresItems.battleaxe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 8f, -3.5f));
        RandoresItems.helmet.registerBacker(itemData, armorMaterial);
        RandoresItems.chestplate.registerBacker(itemData, armorMaterial);
        RandoresItems.leggings.registerBacker(itemData, armorMaterial);
        RandoresItems.boots.registerBacker(itemData, armorMaterial);
    }
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:20,代碼來源:MaterialDefinitionGenerator.java

示例2: instanceOf

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public boolean instanceOf(IItemType type) {
	if (type.equals(IItemType.ItemFishingRod)) {
		return item instanceof ItemFishingRod;
	} else if (type.equals(IItemType.ItemPotion)) {
		return item instanceof ItemPotion;
	} else if (type.equals(IItemType.ItemFood)) {
		return item instanceof ItemFood;
	} else if (type.equals(IItemType.ItemSword)) {
		return item instanceof ItemSword;
	} else if (type.equals(IItemType.ItemTool)) {
		return item instanceof ItemTool;
	} else if (type.equals(IItemType.ItemNameTag)) {
		return item instanceof ItemNameTag;
	} else if (type.equals(IItemType.ItemBlock)) {
		return item instanceof ItemBlock;
	} else if (type.equals(IItemType.ItemHoe)) {
		return item instanceof ItemHoe;
	}
	return false;
}
 
開發者ID:Moudoux,項目名稱:EMC,代碼行數:21,代碼來源:IItem.java

示例3: PopulateHoe

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
/**
 * Finds or creates a hoe for an ore.
 */
public static void PopulateHoe(OreStuff stuff)
{
	if (!stuff.HasHoe)
	{
		Item Hoe = Util.FindItemFromString(stuff.BaseName + "hoe");
		
		if (Hoe != null)
		{
			stuff.HasHoe = true;
		}
		else
		{
			ItemHoe hoe;
			hoe = AutoItemAndBlock.CreateHoe(stuff.MetalMaterial, ModTabs.maintab, stuff.MetalMaterial.getHarvestLevel(), Reference.MODID + ":MissingHoeTexture", stuff.BaseName + "Hoe");
			stuff.Hoe = hoe;
		}
	}
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:22,代碼來源:AutoCreateForOres.java

示例4: isBlazonium

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public boolean isBlazonium(EntityPlayer player){
	ItemStack item=player.getHeldItemMainhand();
	if(item==null)
		return false;
	if(item.getItem()instanceof ItemTool){
		if(((ItemTool)(item.getItem())).getToolMaterial()==ToolMaterials.Blazonium)
				return true;
	}
	if(item.getItem()instanceof ItemSword){
		if(((ItemSword)(item.getItem())).getToolMaterialName().equals("Blazonium"))
				return true;
	}
	if(item.getItem()instanceof ItemHoe){
		if(((ItemHoe)(item.getItem())).getMaterialName().equals("Blazonium"))
				return true;
	}
	return false;
}
 
開發者ID:EnderiumSmith,項目名稱:Nuclear-Foundation,代碼行數:19,代碼來源:EventHandler.java

示例5: isEmerald

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public boolean isEmerald(EntityPlayer player){
	ItemStack item=player.getHeldItemMainhand();
	if(item==null)
		return false;
	if(item.getItem()instanceof ItemTool){
		if(((ItemTool)(item.getItem())).getToolMaterial()==ToolMaterials.Emerald)
				return true;
	}
	if(item.getItem()instanceof ItemSword){
		if(((ItemSword)(item.getItem())).getToolMaterialName().equals("Emerald"))
				return true;
	}
	if(item.getItem()instanceof ItemHoe){
		if(((ItemHoe)(item.getItem())).getMaterialName().equals("Emerald"))
				return true;
	}
	return false;
}
 
開發者ID:EnderiumSmith,項目名稱:Nuclear-Foundation,代碼行數:19,代碼來源:EventHandler.java

示例6: getItemBurnTime

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
private int getItemBurnTime(ItemStack stack) {
    if (stack == null || stack.stackSize <= 0) {
        return 0;
    } else {
        Item item = stack.getItem();
        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
            Block block = Block.getBlockFromItem(item);
            if (block == Blocks.wooden_slab) return 150;
            if (block.getMaterial() == Material.wood) return 300;
            if (block == Blocks.coal_block) return 16000;
        }
        if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
        if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
        if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
        if (item == Items.stick) return 100;
        if (item == Items.coal) return 1600;
        if (item == Items.lava_bucket) return 20000;
        if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
        if (item == Items.blaze_rod) return 2400;
        return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(stack);
    }
}
 
開發者ID:Darkyoooooo,項目名稱:DimsumCraft,代碼行數:23,代碼來源:ESteamFurnace.java

示例7: addVanillaTools

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
@SubscribeEvent
public void addVanillaTools(ValidatingToolsEvent event){
	Iterator<Item> iterator = Item.itemRegistry.iterator();
	while(iterator.hasNext()){
		Item i = iterator.next();
		if(i instanceof ItemSword){
			event.addSword(i);
		}
		if(i instanceof ItemPickaxe){
			event.addPickaxe(i);
		}
		if(i instanceof ItemSpade){
			event.addShovel(i);
		}
		if(i instanceof ItemAxe){
			event.addAxe(i);
		}
		if(i instanceof ItemHoe){
			event.addHoe(i);
		}
	}
}
 
開發者ID:Elix-x,項目名稱:toolscompressor,代碼行數:23,代碼來源:ScanningForToolsEvent.java

示例8: onBlockActivated

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
	if (playerIn.getHeldItem() != null)
	{
		if (playerIn.getHeldItem().getItem() instanceof ItemHoe && state.getValue(VARIANT).getMetadata() == 1)
		{
			if (playerIn.getHeldItem().getItemDamage() < playerIn.getHeldItem().getMaxDamage())
				playerIn.getHeldItem().damageItem(1, playerIn);
			else
				playerIn.destroyCurrentEquippedItem();
			worldIn.setBlockState(pos, MBlocks.virtian_soil.getDefaultState());
			worldIn.playSoundEffect((double) ((float) pos.getX() + 0.5F), (double) ((float) pos.getY() + 0.5F),
			                        (double) ((float) pos.getZ() + 0.5F),
			                        MBlocks.virtian_soil.stepSound.getStepSound(),
			                        (MBlocks.virtian_soil.stepSound.getVolume() + 1.0F) / 2.0F,
			                        MBlocks.virtian_soil.stepSound.getFrequency() * 0.8F);
			return true;
		}
	}
	return false;
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:23,代碼來源:BlockVirtianSoil.java

示例9: initializeItems

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static void initializeItems(){
	
	timeToolMaterial = EnumHelper.addToolMaterial("timeToolMaterial", 6, 1620, 8.0F, 4.0F, 7);
	pheromoneArmor = EnumHelper.addArmorMaterial("pheromoneArmor", 12, new int[]{2, 4, 2, 1}, 9);

	fossil_Shard = new Item().setUnlocalizedName("iat.fossil_Shard").setTextureName("iat:fossil").setCreativeTab(ItsAboutTime.iatTab);
	rockPick = new ItemRockPick().setUnlocalizedName("iat.rockPick").setTextureName("iat:rockPick").setCreativeTab(ItsAboutTime.iatTab);
	fossil_Broken = new ItemFossilBroken().setUnlocalizedName("iat.fossil_Broken").setCreativeTab(ItsAboutTime.iatTab);
	fossil = new ItemFossil().setUnlocalizedName("iat.fossil").setCreativeTab(ItsAboutTime.iatTab);
	for (int i = 0; i < EnumFossilSkeleton.values().length; i++) {
		EnumFossilSkeleton.values()[i].fossilItem = new Item().setTextureName("iat:fossil").setUnlocalizedName("iat.fossil" + EnumFossilSkeleton.values()[i].name).setCreativeTab(ItsAboutTime.iatTab);
		EnumFossilSkeleton.values()[i].fossilBrokenItem = new Item().setTextureName("iat:fossil").setUnlocalizedName("iat.fossil_Broken" + EnumFossilSkeleton.values()[i].name).setCreativeTab(ItsAboutTime.iatTab);
	}
	amber = new ItemAmber().setUnlocalizedName("iat.amber").setCreativeTab(ItsAboutTime.iatTab);
	plaster_Ball = new Item().setUnlocalizedName("iat.plaster_Ball").setTextureName("iat:plaster").setCreativeTab(ItsAboutTime.iatTab);
	time_Crystal = new ItemTimeCrystal().setUnlocalizedName("iat.time_Crystal").setTextureName("iat:time_Crystal").setCreativeTab(ItsAboutTime.iatTab);
	time_Shovel = new ItemModSpade(timeToolMaterial).setUnlocalizedName("iat.time_Shovel").setTextureName("iat:time_Shovel").setCreativeTab(ItsAboutTime.iatTab);
	time_Pickaxe = new ItemModPickaxe(timeToolMaterial).setUnlocalizedName("iat.time_Pickaxe").setTextureName("iat:time_Pickaxe").setCreativeTab(ItsAboutTime.iatTab);
	time_Axe = new ItemModAxe(timeToolMaterial).setUnlocalizedName("iat.time_Axe").setTextureName("iat:time_Axe").setCreativeTab(ItsAboutTime.iatTab);
	time_Sword = new ItemSword(timeToolMaterial).setUnlocalizedName("iat.time_Sword").setTextureName("iat:time_Sword").setCreativeTab(ItsAboutTime.iatTab);
	time_Hoe = new ItemHoe(timeToolMaterial).setUnlocalizedName("iat.time_Hoe").setTextureName("iat:time_Hoe").setCreativeTab(ItsAboutTime.iatTab);
	pheromoneChest = new ItemPheromoneArmor(pheromoneArmor, 0, 1).setUnlocalizedName("iat.pheromoneCanester").setTextureName("iat:pheromoneCanester").setCreativeTab(ItsAboutTime.iatTab);
	bucket_Time = new ItemBucket(ModBlocks.fluidTimeBlock).setUnlocalizedName("iat.bucket_Time").setTextureName("iat:bucket_Time").setContainerItem(Items.bucket);
	ginkoNuts = new ItemFood(2, 0.2F, false).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("iat.ginkoNut").setTextureName("iat:ginko_nut").setCreativeTab(ItsAboutTime.iatTab);
}
 
開發者ID:Alex-the-666,項目名稱:It-s-About-Time-Minecraft-Mod,代碼行數:26,代碼來源:ModItems.java

示例10: getItemBurnTime

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static int getItemBurnTime(ItemStack stack) {
	if (stack == null) {
		return 0;
	} else {
		Item item = stack.getItem();
		//If block
		if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
			Block block = Block.getBlockFromItem(item);
			if (block == Blocks.wooden_slab) return 150;
			if (block.getMaterial() == Material.wood) return 300;
			if (block == Blocks.coal_block) return 16000;
		}

           if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200;
           if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200;
           if (item instanceof ItemHoe && ((ItemHoe)item).getToolMaterialName().equals("WOOD")) return 200;
           if (item == Items.stick) return 100;
           if (item == Items.coal) return 1600;
           if (item == Items.lava_bucket) return 20000;
           if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
           if (item == Items.blaze_rod) return 2400;
           return GameRegistry.getFuelValue(stack);
	}
}
 
開發者ID:TheDarkEra,項目名稱:TheDarkEra,代碼行數:25,代碼來源:TESmeltery.java

示例11: isItemValid

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
@Override
protected boolean isItemValid(TileEntity tileEntity, ItemStack itemStack)
{
    Class<?> cls = tileEntity.getClass();
    
    if(cls != TEToolRack.class)
        return false;
    
    Item item = itemStack.getItem();
    
    return item instanceof ItemTool ||
        item instanceof ItemWeapon ||
        item instanceof ItemHoe ||
        item instanceof ItemProPick ||
        item instanceof ItemBow ||
        item instanceof ItemSword ||
        item instanceof ItemAxe ||
        item instanceof ItemSpade ||
        item instanceof ItemShears ||
        item instanceof ItemSpindle
        ;
}
 
開發者ID:Aleksey-Terzi,項目名稱:MerchantsTFC,代碼行數:23,代碼來源:ToolRackContainer.java

示例12: func_70398_a

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static int func_70398_a(ItemStack p_70398_0_) {
   if(p_70398_0_ == null) {
      return 0;
   } else {
      int var1 = p_70398_0_.func_77973_b().field_77779_bT;
      Item var2 = p_70398_0_.func_77973_b();
      if(var1 < 256 && Block.field_71973_m[var1] != null) {
         Block var3 = Block.field_71973_m[var1];
         if(var3 == Block.field_72092_bO) {
            return 150;
         }

         if(var3.field_72018_cp == Material.field_76245_d) {
            return 300;
         }

         if(var3 == Block.field_111034_cE) {
            return 16000;
         }
      }

      return var2 instanceof ItemTool && ((ItemTool)var2).func_77861_e().equals("WOOD")?200:(var2 instanceof ItemSword && ((ItemSword)var2).func_77825_f().equals("WOOD")?200:(var2 instanceof ItemHoe && ((ItemHoe)var2).func_77842_f().equals("WOOD")?200:(var1 == Item.field_77669_D.field_77779_bT?100:(var1 == Item.field_77705_m.field_77779_bT?1600:(var1 == Item.field_77775_ay.field_77779_bT?20000:(var1 == Block.field_71987_y.field_71990_ca?100:(var1 == Item.field_77731_bo.field_77779_bT?2400:0)))))));
   }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:25,代碼來源:TileEntityFurnace.java

示例13: preInit

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static void preInit() {
	for (final Object o : IceAndShadow2.getPreRegistrationHandlers()) {
		IaSRegistry.doAdd(o);
	}
	setPrimarilyTransfusionTarget(ItemArmor.class);
	setPrimarilyTransfusionTarget(ItemTool.class);
	setPrimarilyTransfusionTarget(ItemSword.class);
	setPrimarilyTransfusionTarget(ItemHoe.class);
	setPrimarilyTransfusionTarget(ItemShears.class);
	setPrimarilyTransfusionTarget(ItemFlintAndSteel.class);
	setPrimarilyTransfusionTarget(ItemBow.class);
	setPrimarilyTransfusionTarget(ItemFishingRod.class);
	setPrimarilyTransfusionTarget(IaSItemEchirArmorActive.class);
	setPrimarilyTransfusionTarget(IaSItemEchirKnifeActive.class);
	setPrimarilyTransfusionTarget(IaSItemEchirToolActive.class);
	setPrimarilyTransfusionTarget(IaSItemToolBroken.class);
	setPrimarilyTransfusionTarget(NyxBaseItemBow.class);
	setPrimarilyTransfusionTarget(NyxItemFlask.class);
	setPrimarilyTransfusionTarget(NyxItemSwordFrost.class);

	addGrenadeLogic(new NyxGrenadeExplosive());
	addGrenadeLogic(new NyxGrenadeIceWall());
	addGrenadeLogic(new NyxGrenadeShadow());
}
 
開發者ID:TheDaemoness,項目名稱:IceAndShadow2,代碼行數:25,代碼來源:IaSRegistry.java

示例14: getType

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static int getType(ItemStack itemStack) {
	Item item = itemStack.getItem();
	if (item instanceof ItemPickaxe) {
		return TYPE_PICKAXE;
	} else if (item instanceof ItemAxe) {
		return TYPE_AXE;
	} else if (item instanceof ItemSpade) {
		return TYPE_SHOVEL;
	} else if (item instanceof ItemSword) {
		return TYPE_SWORD;
	} else if (item instanceof ItemHoe) {
		return TYPE_HOE;
	} else if (item instanceof ItemTool) {
		Set<String> toolClasses = ((ItemTool)item).getToolClasses(itemStack);
		if (toolClasses.contains("pickaxe")) return TYPE_PICKAXE;
		else if (toolClasses.contains("axe")) return TYPE_AXE;
		else if (toolClasses.contains("shovel")) return TYPE_SHOVEL;
		else if (toolClasses.contains("hoe")) return TYPE_HOE;
		else return -1;
	} else if (tinkersType(item)>=0) { //see if it's a tinkers type
		return tinkersType(item);
	} else {
		return -1;
	}
}
 
開發者ID:Vanhal,項目名稱:ProgressiveAutomation,代碼行數:26,代碼來源:ToolHelper.java

示例15: getLevel

import net.minecraft.item.ItemHoe; //導入依賴的package包/類
public static int getLevel(ItemStack itemStack) {
	//Vanilla Tools
	if (itemStack.getItem() instanceof ItemTool) {
		return ((ItemTool)itemStack.getItem()).getToolMaterial().getHarvestLevel();
	} else if ((itemStack.getItem() instanceof ItemSword) ||
		(itemStack.getItem() instanceof ItemHoe)) {
		String material = "";
		if (itemStack.getItem() instanceof ItemSword) material = ((ItemSword)itemStack.getItem()).getToolMaterialName();
		else if (itemStack.getItem() instanceof ItemHoe) material = ((ItemHoe)itemStack.getItem()).getMaterialName();
		if (material.equals("WOOD")) return LEVEL_WOOD;
		else if (material.equals("STONE")) return LEVEL_STONE;
		else if (material.equals("IRON")) return LEVEL_IRON;
		else if (material.equals("GOLD")) return LEVEL_GOLD;
		else if (material.equals("EMERALD")) return LEVEL_DIAMOND;
		else if (material.equals("DIAMOND")) return LEVEL_DIAMOND;
	} else {
		//Tinkers Tools
		if (itemStack.hasTagCompound()) {
			return tinkersLevel(itemStack);
		}
	}

	return -1;
}
 
開發者ID:Vanhal,項目名稱:ProgressiveAutomation,代碼行數:25,代碼來源:ToolHelper.java


注:本文中的net.minecraft.item.ItemHoe類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。