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