当前位置: 首页>>代码示例>>Java>>正文


Java ItemFishingRod类代码示例

本文整理汇总了Java中net.minecraft.item.ItemFishingRod的典型用法代码示例。如果您正苦于以下问题:Java ItemFishingRod类的具体用法?Java ItemFishingRod怎么用?Java ItemFishingRod使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ItemFishingRod类属于net.minecraft.item包,在下文中一共展示了ItemFishingRod类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: instanceOf

import net.minecraft.item.ItemFishingRod; //导入依赖的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

示例2: isEquipmentValid

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
public boolean isEquipmentValid() {
  ItemStack equip = this.getStackInSlot(toolSlot);
  if (equip.isEmpty()) {
    return false;
  }
  if (equip.getItem() instanceof ItemFishingRod) {
    return true;
  }
  String itemsClass = equip.getItem().getClass().getName();
  //TODO: why was i being dum. i should use resourcelocations: "modid:itemid"
  String aquaBase = "com.teammetallurgy.aquaculture.items.";
  if (itemsClass.equals(aquaBase + "ItemAquacultureWoodenFishingRod")
      || itemsClass.equals(aquaBase + "ItemAquacultureFishingRod")
      || itemsClass.equals(aquaBase + "ItemAdminAquacultureFishingRod")
      || itemsClass.equals(aquaBase + "ItemAdminFishingRod")) {
    return true;
  }
  return false;
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:20,代码来源:TileEntityFishing.java

示例3: preInit

import net.minecraft.item.ItemFishingRod; //导入依赖的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

示例4: onUpdate

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
@SubscribeEvent
public void onUpdate(LocalPlayerUpdateEvent event) {
    EntityPlayer me = getLocalPlayer();
    ItemStack heldStack = me.getHeldItemMainhand();

    // update tick delay if hook is deployed
    if(ticksCastDelay > casting_delay.get())
        ticksCastDelay = casting_delay.get(); // greater than current delay, set to the current delay
    else if(ticksCastDelay > 0)
        --ticksCastDelay;

    // check if player is holding a fishing rod
    if(
            heldStack != null &&                                // item not null (shouldn't be, but I am being safe)
            heldStack.getItem() instanceof ItemFishingRod      // item being held is a fishing rod
            ) {
        if(!previouslyHadRodEquipped) {
            ticksCastDelay = casting_delay.get();
            previouslyHadRodEquipped = true;
        } else if(me.fishEntity == null) { // no hook is deployed
            // cast hook
            rightClick();
        } else { // hook is deployed and rod was not previously equipped
            // increment the number of ticks that the hook entity has existed
            ++ticksHookDeployed;

            if(fail_safe_time.get() != 0 && (ticksHookDeployed > fail_safe_time.get())) {
                rightClick(); // reel in hook if the fail safe time has passed
                resetLocals();
            }
        }
    } else resetLocals();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:34,代码来源:AutoFishMod.java

示例5: rightClick

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
private void rightClick()
{
	// check held item
	ItemStack stack = WMinecraft.getPlayer().inventory.getCurrentItem();
	if(WItem.isNull(stack) || !(stack.getItem() instanceof ItemFishingRod))
		return;
	
	// right click
	mc.rightClickMouse();
	
	// reset timer
	timer = 15;
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:14,代码来源:AutoFishMod.java

示例6: isThrowable

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
public boolean isThrowable() {
	if (item instanceof ItemBow || item instanceof ItemSnowball || item instanceof ItemEgg
			|| item instanceof ItemEnderPearl || item instanceof ItemSplashPotion
			|| item instanceof ItemLingeringPotion || item instanceof ItemFishingRod) {
		return true;
	}
	return false;
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:9,代码来源:IItem.java

示例7: playerIsHoldingRod

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
private boolean playerIsHoldingRod() {
    ItemStack heldItem = this.player.getHeldItemMainhand();

    return (heldItem != null
            && heldItem.getItem() instanceof ItemFishingRod
            && heldItem.getItemDamage() <= heldItem.getMaxDamage());
}
 
开发者ID:freneticfeline,项目名称:mod_autofish,代码行数:8,代码来源:AutoFish.java

示例8: tryToSwitchRods

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
private void tryToSwitchRods() {
    InventoryPlayer inventory = this.player.inventory;
    for (int i = 0; i < 9; i++) {
        ItemStack curItemStack = inventory.mainInventory.get(i);
        if (curItemStack != null 
                && curItemStack.getItem() instanceof ItemFishingRod
                && (!ModAutoFish.config_autofish_preventBreak || (curItemStack.getMaxDamage() - curItemStack.getItemDamage() > AUTOFISH_BREAKPREVENT_THRESHOLD))
            ) {
            inventory.currentItem = i;
            break;
        }
    }
}
 
开发者ID:freneticfeline,项目名称:mod_autofish,代码行数:14,代码来源:AutoFish.java

示例9: getAdditionalCosts

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
private static AdditionalCosts getAdditionalCosts (final Item output)
{
    int index = 0;

    if (output instanceof ItemArmor)
    {
        index = ((ItemArmor) output).armorType;
    }
    else if (output instanceof ItemPickaxe)
    {
        index = 4;
    }
    else if (output instanceof ItemSword)
    {
        index = 5;
    }
    else if (output instanceof ItemAxe)
    {
        index = 6;
    }
    else if (output instanceof ItemSpade)
    {
        index = 7;
    }
    else if (output instanceof ItemHoe)
    {
        index = 8;
    }
    else if (output instanceof ItemBow)
    {
        index = 9;
    }
    else if (output instanceof ItemShears)
    {
        index = 10;
    }
    else if (output instanceof ItemFishingRod)
    {
        index = 11;
    }

    return AdditionalCosts.values()[index];
}
 
开发者ID:UndeadZeratul,项目名称:TWBB-Tweaks,代码行数:44,代码来源:BetterBeginningsHandler.java

示例10: playerIsHoldingFishingRod

import net.minecraft.item.ItemFishingRod; //导入依赖的package包/类
private boolean playerIsHoldingFishingRod(EntityPlayer player) {
    return (!Minecraft.getMinecraft().isGamePaused()
            && player != null
            && player.getHeldItemMainhand() != null
            && player.getHeldItemMainhand().getItem() instanceof ItemFishingRod);
}
 
开发者ID:freneticfeline,项目名称:mod_autofish,代码行数:7,代码来源:KeyInputHandler.java


注:本文中的net.minecraft.item.ItemFishingRod类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。