本文整理汇总了Java中org.bukkit.event.player.PlayerToggleFlightEvent.isCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerToggleFlightEvent.isCancelled方法的具体用法?Java PlayerToggleFlightEvent.isCancelled怎么用?Java PlayerToggleFlightEvent.isCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.player.PlayerToggleFlightEvent
的用法示例。
在下文中一共展示了PlayerToggleFlightEvent.isCancelled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processPlayerAbilities
import org.bukkit.event.player.PlayerToggleFlightEvent; //导入方法依赖的package包/类
public void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_)
{
// CraftBukkit start - d() should be isFlying()
if (this.playerEntity.capabilities.allowFlying && this.playerEntity.capabilities.isFlying != p_147348_1_.func_149488_d())
{
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.playerEntity), p_147348_1_.func_149488_d());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled())
{
this.playerEntity.capabilities.isFlying = p_147348_1_.func_149488_d(); // Actually set the player's flying status
}
else
{
this.playerEntity.sendPlayerAbilities(); // Tell the player their ability was reverted
}
}
// CraftBukkit end
}
示例2: a
import org.bukkit.event.player.PlayerToggleFlightEvent; //导入方法依赖的package包/类
public void a(PacketPlayInAbilities packetplayinabilities) {
// CraftBukkit start
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.isFlying()) {
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.isFlying());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.player.abilities.isFlying = packetplayinabilities.isFlying(); // Actually set the player's flying status
} else {
this.player.updateAbilities(); // Tell the player their ability was reverted
}
}
// CraftBukkit end
}
示例3: a
import org.bukkit.event.player.PlayerToggleFlightEvent; //导入方法依赖的package包/类
public void a(Packet202Abilities packet202abilities) {
// CraftBukkit start
if (this.player.abilities.canFly && this.player.abilities.isFlying != packet202abilities.f()) {
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packet202abilities.f());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.player.abilities.isFlying = packet202abilities.f(); // Actually set the player's flying status
}
else {
this.player.updateAbilities(); // Tell the player their ability was reverted
}
}
// CraftBukkit end
}
示例4: onFlightToggle
import org.bukkit.event.player.PlayerToggleFlightEvent; //导入方法依赖的package包/类
@EventHandler
public void onFlightToggle(final PlayerToggleFlightEvent event) {
if (!this.frozenPlayers.isEmpty() && !event.isCancelled() && this.frozenPlayers.containsKey(event.getPlayer().getUniqueId())) {
if (!event.isFlying()) {
event.setCancelled(true);
final Location3w location = this.frozenPlayers.get(event.getPlayer().getUniqueId());
location.setYaw(event.getPlayer().getLocation().getYaw());
location.setPitch(event.getPlayer().getLocation().getPitch());
event.getPlayer().teleport(location);
}
}
}
示例5: a
import org.bukkit.event.player.PlayerToggleFlightEvent; //导入方法依赖的package包/类
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
// CraftBukkit start
if (this.player.abilities.canFly && this.player.abilities.isFlying != packetplayinabilities.isFlying()) {
PlayerToggleFlightEvent event = new PlayerToggleFlightEvent(this.server.getPlayer(this.player), packetplayinabilities.isFlying());
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.player.abilities.isFlying = packetplayinabilities.isFlying(); // Actually set the player's flying status
} else {
this.player.updateAbilities(); // Tell the player their ability was reverted
}
}
// CraftBukkit end
}