本文整理汇总了Java中org.bukkit.entity.EntityType.HORSE属性的典型用法代码示例。如果您正苦于以下问题:Java EntityType.HORSE属性的具体用法?Java EntityType.HORSE怎么用?Java EntityType.HORSE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.HORSE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMountPet
@EventHandler
public void onMountPet(VehicleEnterEvent event) {
if (event.getEntered().getType() != EntityType.PLAYER || event.getVehicle().getType() != EntityType.HORSE) {
return;
}
Player player = (Player) event.getEntered();
if (!InventoryManager.playerIsLoaded(player)) {
return;
}
Horse vehicle = (Horse) event.getVehicle();
if (PetManager.getPetFromEntity(vehicle, player) != null && player != vehicle.getOwner()) {
PlayerUtils.sendMessage(player, RPGInventory.getLanguage().getMessage("error.mount.owner", vehicle.getOwner().getName()));
event.setCancelled(true);
}
}
示例2: onEntitySpawn
@EventHandler
public void onEntitySpawn(CreatureSpawnEvent e) {
if (e.getEntityType().isAlive() && e.getEntityType() != EntityType.PLAYER
&& e.getEntityType() != EntityType.ZOMBIE && e.getEntityType() != EntityType.ENDERMAN
&& e.getEntityType() != EntityType.PIG && e.getEntityType() != EntityType.COW
&& e.getEntityType() != EntityType.SHEEP && e.getEntityType() != EntityType.HORSE
&& e.getEntityType() != EntityType.SQUID) {
e.setCancelled(true);
e.getLocation().getWorld().spawn(e.getLocation(), Zombie.class);
}
}
示例3: getType
public EntityType getType() {
return EntityType.HORSE;
}
示例4: isHorse
public boolean isHorse(Entity e) {
return e.getType() == EntityType.HORSE;
}