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

Java Fish类代码示例

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

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



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

示例1: iceFishing

import org.bukkit.entity.Fish; //导入依赖的package包/类
public void iceFishing(Fish hook, Block block) {
    // Make a hole
    block.setType(Material.STATIONARY_WATER);

    for (int x = -1; x <= 1; x++) {
        for (int z = -1; z <= 1; z++) {
            Block relative = block.getRelative(x, 0, z);

            if (relative.getType() == Material.ICE) {
                relative.setType(Material.STATIONARY_WATER);
            }
        }
    }

    // Recast in the new spot
    EventUtils.callFakeFishEvent(getPlayer(), hook);
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:18,代码来源:FishingManager.java


示例2: masterAngler

import org.bukkit.entity.Fish; //导入依赖的package包/类
public void masterAngler(Fish hook) {
    Player player = getPlayer();
    Location location = hook.getLocation();
    double biteChance = hook.getBiteChance();

    hookLocation = location;

    if (Fishing.masterAnglerBiomes.contains(location.getBlock().getBiome())) {
        biteChance = biteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
    }

    if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
        biteChance = biteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
    }

    hook.setBiteChance(Math.min(biteChance, 1.0));
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:18,代码来源:FishingManager.java


示例3: isFishing

import org.bukkit.entity.Fish; //导入依赖的package包/类
@Override
public boolean isFishing() {
	if(player.getItemInHand().getType() == Material.FISHING_ROD) {
		for(Entity entity : player.getNearbyEntities(16, 16, 16)) {
			if(entity instanceof Fish) {
				Fish fish = (Fish) entity;
				if(fish.getShooter() instanceof Player) {
					Player p = (Player) fish.getShooter();
					if(p.equals(player)) {
						return true;
					}
				}
			}
		}
	}
	return false;
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:18,代码来源:xEssentialsPlayer.java


示例4: onPlayerFishEvent

import org.bukkit.entity.Fish; //导入依赖的package包/类
@EventHandler
public void onPlayerFishEvent(PlayerFishEvent event) {
    Fish hook = event.getHook();
    if (event.getState() != PlayerFishEvent.State.FISHING) {
        boolean isBlock = false;
        for (int dx = -1; dx <= 1; dx++) {
            for (int dy = -1; dy <= 1; dy++) {
                for (int dz = -1; dz <= 1; dz++) {
                    if (!RParticles.isAirlike(hook.getWorld().getBlockAt(hook.getLocation().getBlockX() + dx, hook.getLocation().getBlockY() + dy, hook.getLocation().getBlockZ() + dz))) {
                        isBlock = true;
                        break;
                    }
                }
            }
        }
        try {
            event.getPlayer().getEquipment().getItemInMainHand().setDurability((short) 0);
        } catch (Exception e) {

        }
        if (isBlock) {
            pullEntityToLocation(event.getPlayer(), hook.getLocation());
        } else {
            event.getPlayer().sendMessage(ChatColor.RED + "Your grapple wasn't hooked on anything.");
        }
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:28,代码来源:GrappleManager.java


示例5: launchProjectile

import org.bukkit.entity.Fish; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:45,代码来源:CraftLivingEntity.java


示例6: PlayerFishEvent

import org.bukkit.entity.Fish; //导入依赖的package包/类
public PlayerFishEvent(final Player player, final Entity entity, final Fish hookEntity, final State state) {
    super(player);
    this.entity = entity;
    this.hookEntity = hookEntity;
    this.state = state;
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:7,代码来源:PlayerFishEvent.java


示例7: getReturnType

import org.bukkit.entity.Fish; //导入依赖的package包/类
public Class<? extends Fish> getReturnType() {
	return Fish.class;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:4,代码来源:ExprFishingGetHook.java


示例8: get

import org.bukkit.entity.Fish; //导入依赖的package包/类
@Nullable
protected Fish[] get(Event e) {
	return new Fish[]{((PlayerFishEvent)e).getHook()};
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:5,代码来源:ExprFishingGetHook.java


示例9: FakePlayerFishEvent

import org.bukkit.entity.Fish; //导入依赖的package包/类
public FakePlayerFishEvent(Player player, Entity entity, Fish hookEntity, State state) {
    super(player, entity, hookEntity, state);
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:4,代码来源:FakePlayerFishEvent.java


示例10: callFakeFishEvent

import org.bukkit.entity.Fish; //导入依赖的package包/类
public static FakePlayerFishEvent callFakeFishEvent(Player player, Fish hook) {
    FakePlayerFishEvent event = new FakePlayerFishEvent(player, null, hook, PlayerFishEvent.State.FISHING);
    mcMMO.p.getServer().getPluginManager().callEvent(event);

    return event;
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:7,代码来源:EventUtils.java


示例11: getHook

import org.bukkit.entity.Fish; //导入依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public Fish getHook() {
    throw new NotImplementedException("TODO"); // TODO
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:6,代码来源:PorePlayerFishEvent.java


示例12: PlayerFishEvent

import org.bukkit.entity.Fish; //导入依赖的package包/类
public PlayerFishEvent(Player player, Entity entity, Fish hookEntity, PlayerFishEvent.State state) {
       super(player);
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:PlayerFishEvent.java


示例13: getHook

import org.bukkit.entity.Fish; //导入依赖的package包/类
public Fish getHook() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:PlayerFishEvent.java


示例14: getHook

import org.bukkit.entity.Fish; //导入依赖的package包/类
/**
 * Gets the fishing hook.
 *
 * @return Fish the entity representing the fishing hook/bobber.
 */
public Fish getHook() {
    return hookEntity;
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:9,代码来源:PlayerFishEvent.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java User类代码示例发布时间:2022-05-21
下一篇:
Java BaseFullChunk类代码示例发布时间: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