本文整理汇总了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;未经允许,请勿转载。 |
请发表评论