本文整理匯總了Java中org.bukkit.entity.EntityType.OCELOT屬性的典型用法代碼示例。如果您正苦於以下問題:Java EntityType.OCELOT屬性的具體用法?Java EntityType.OCELOT怎麽用?Java EntityType.OCELOT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.OCELOT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPlayerInteractEntity
@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent event)
{
if (event.getRightClicked().getType() == EntityType.OCELOT)
{
if (this.lock.contains(event.getPlayer().getUniqueId()))
return;
// Event called twice
this.lock.add(event.getPlayer().getUniqueId());
this.hub.getServer().getScheduler().runTaskLater(this.hub, () -> this.lock.remove(event.getPlayer().getUniqueId()), 10L);
for (Graou graou : this.interactions)
{
if (graou.getGraouEntity().getBukkitEntity().getUniqueId().equals(event.getRightClicked().getUniqueId()))
{
graou.play(event.getPlayer());
break;
}
}
}
}
示例2: onPlayerInteractEntity
@EventHandler
public void onPlayerInteractEntity(PlayerInteractEntityEvent event)
{
if (event.getRightClicked().getType() == EntityType.OCELOT)
{
if (this.lock.contains(event.getPlayer().getUniqueId()))
return;
// Event called twice
this.lock.add(event.getPlayer().getUniqueId());
this.hub.getServer().getScheduler().runTaskLater(this.hub, () -> this.lock.remove(event.getPlayer().getUniqueId()), 10L);
for (Meow meow : this.interactions)
{
if (meow.getMeowEntity().getBukkitEntity().getUniqueId().equals(event.getRightClicked().getUniqueId()))
{
meow.play(event.getPlayer());
break;
}
}
}
}
示例3: getType
@Override
public EntityType getType() {
return EntityType.OCELOT;
}