• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FishingHooks类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: catchFish

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
public int catchFish()
{
    byte var1 = 0;

    if (this.bobber != null)
    {
        double var2 = this.angler.posX - this.posX;
        double var4 = this.angler.posY - this.posY;
        double var6 = this.angler.posZ - this.posZ;
        double var8 = (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
        double var10 = 0.1D;
        this.bobber.motionX += var2 * var10;
        this.bobber.motionY += var4 * var10 + (double)MathHelper.sqrt_double(var8) * 0.08D;
        this.bobber.motionZ += var6 * var10;
        var1 = 3;
    }
    else if (this.ticksCatchable > 0)
    {
        ItemStack fish = FishingHooks.getRandomFishable(this.rand, this.worldObj.rand.nextFloat());
        EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, fish);
        double var3 = this.angler.posX - this.posX;
        double var5 = this.angler.posY - this.posY;
        double var7 = this.angler.posZ - this.posZ;
        double var9 = (double)MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7);
        double var11 = 0.1D;
        var13.motionX = var3 * var11;
        var13.motionY = var5 * var11 + (double)MathHelper.sqrt_double(var9) * 0.08D;
        var13.motionZ = var7 * var11;
        this.worldObj.spawnEntityInWorld(var13);
        var1 = 1;
    }

    if (this.inGround)
    {
        var1 = 2;
    }

    this.setDead();
    return var1;
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:41,代码来源:FairyEntityFishHook.java


示例2: init

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
public static void init() {
	
	FishingHooks.addFish(new WeightedRandomFishable(new ItemStack(InitItems.fusion_fish), 100));
	
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.sword, 1, 1, 10);
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.pickaxe, 1, 1, 10);
	
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.helmet, 1, 1, 7);
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.chestplate, 1, 1, 5);
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.leggings, 1, 1, 5);
	addItemToChest(ChestGenHooks.VILLAGE_BLACKSMITH, InitItems.steel.boots, 1, 1, 7);
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:13,代码来源:InitHooks.java


示例3: catchFish

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
private boolean catchFish(double fish, double time) {
	double probability = time - 0.3 + fish;
	double target = Math.random();
	if (target <= probability) {
		this.storeItemStack(FishingHooks.getRandomFishable(this.world.rand, this.world.rand.nextFloat(), 0, 0));
		return true;
	}
	return false;
}
 
开发者ID:SlimeVoid,项目名称:TurtleExtension,代码行数:10,代码来源:FishingUpgrade.java


示例4: addFish

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addFish(WeightedRandomFishable fish) {
    FishingHooks.addFish(toNms(fish));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例5: addJunk

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addJunk(WeightedRandomFishable fish) {
    FishingHooks.addJunk(toNms(fish));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例6: addTreasure

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addTreasure(WeightedRandomFishable fish) {
    FishingHooks.addTreasure(toNms(fish));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例7: removeMatchingFish

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingFish(Predicate<WeightedRandomFishable> test) {
    FishingHooks.removeFish(toNms(test));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例8: removeMatchingJunk

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingJunk(Predicate<WeightedRandomFishable> test) {
    FishingHooks.removeJunk(toNms(test));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例9: removeMatchingTreasure

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingTreasure(Predicate<WeightedRandomFishable> test) {
    FishingHooks.removeTreasure(toNms(test));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java


示例10: getRandomFishable

import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public ItemStack getRandomFishable(Random rand, float baseChance, int fishingLuckEnchantmentLevel, int fishingSpeedEnchantmentLevel) {
    return CraftItemStack.asCraftMirror(FishingHooks.getRandomFishable(rand, baseChance, fishingLuckEnchantmentLevel, fishingSpeedEnchantmentLevel));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContentLengthInputStream类代码示例发布时间:2022-05-21
下一篇:
Java RowSorterEvent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap