本文整理汇总了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;
}
示例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);
}
示例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;
}
示例4: addFish
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addFish(WeightedRandomFishable fish) {
FishingHooks.addFish(toNms(fish));
}
示例5: addJunk
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addJunk(WeightedRandomFishable fish) {
FishingHooks.addJunk(toNms(fish));
}
示例6: addTreasure
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void addTreasure(WeightedRandomFishable fish) {
FishingHooks.addTreasure(toNms(fish));
}
示例7: removeMatchingFish
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingFish(Predicate<WeightedRandomFishable> test) {
FishingHooks.removeFish(toNms(test));
}
示例8: removeMatchingJunk
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingJunk(Predicate<WeightedRandomFishable> test) {
FishingHooks.removeJunk(toNms(test));
}
示例9: removeMatchingTreasure
import net.minecraftforge.common.FishingHooks; //导入依赖的package包/类
@Override
public void removeMatchingTreasure(Predicate<WeightedRandomFishable> test) {
FishingHooks.removeTreasure(toNms(test));
}
示例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));
}