本文整理汇总了Java中cn.nukkit.AdventureSettings类的典型用法代码示例。如果您正苦于以下问题:Java AdventureSettings类的具体用法?Java AdventureSettings怎么用?Java AdventureSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AdventureSettings类属于cn.nukkit包,在下文中一共展示了AdventureSettings类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: floatAt
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
@Override
public void floatAt(int x, int y, int z, boolean alwaysGlass) {
if (alwaysGlass || !player.getAllowFlight()) {
super.floatAt(x, y, z, alwaysGlass);
return;
}
setPosition(new Vector(x + 0.5, y, z + 0.5));
player.getAdventureSettings().set(AdventureSettings.Type.ALLOW_FLIGHT, true);
player.getAdventureSettings().set(AdventureSettings.Type.FLYING, true);
player.getAdventureSettings().update();
}
示例2: PlayerGameModeChangeEvent
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
public PlayerGameModeChangeEvent(Player player, int newGameMode, AdventureSettings newAdventureSettings) {
this.player = player;
this.gamemode = newGameMode;
this.newAdventureSettings = newAdventureSettings;
}
示例3: getNewAdventureSettings
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
public AdventureSettings getNewAdventureSettings() {
return newAdventureSettings;
}
示例4: setNewAdventureSettings
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
public void setNewAdventureSettings(AdventureSettings newAdventureSettings) {
this.newAdventureSettings = newAdventureSettings;
}
示例5: canFly
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
public boolean canFly(Player player) {
return player.getAdventureSettings().get(AdventureSettings.Type.ALLOW_FLIGHT);
}
示例6: setCanFly
import cn.nukkit.AdventureSettings; //导入依赖的package包/类
public void setCanFly(Player player, boolean canFly) {
player.getAdventureSettings().set(AdventureSettings.Type.ALLOW_FLIGHT, canFly);
player.getAdventureSettings().update();
}