本文整理汇总了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);
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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
;
}
示例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)))))));
}
}
示例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());
}
示例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;
}
}
示例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;
}