Package cn.nukkit
Class AdventureSettings
java.lang.Object
cn.nukkit.AdventureSettings
- All Implemented Interfaces:
Cloneable
- Author:
- MagicDroidX (Nukkit Project)
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAdventureSettings
(Player player) AdventureSettings
(Player player, CompoundTag nbt) -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(AdventureSettings.Type type) boolean
get
(PlayerAbility ability) void
init
(CompoundTag nbt) void
onOpChange
(boolean op) 当玩家OP身份变动时此方法将被调用 注意此方法并不会向客户端发包刷新权限信息,你需要手动调用update()方法刷新void
readNBT
(CompoundTag nbt) 从nbt读取权限数据void
saveNBT()
保存权限到nbtvoid
sendAbilities
(Collection<Player> players) set
(AdventureSettings.Type type, boolean value) set
(PlayerAbility ability, boolean value) void
setCommandPermission
(CommandPermission commandPermission) void
setPlayerPermission
(PlayerPermission playerPermission) void
update()
void
-
Field Details
-
PERMISSION_NORMAL
public static final int PERMISSION_NORMAL- See Also:
-
PERMISSION_OPERATOR
public static final int PERMISSION_OPERATOR- See Also:
-
PERMISSION_HOST
public static final int PERMISSION_HOST- See Also:
-
PERMISSION_AUTOMATION
public static final int PERMISSION_AUTOMATION- See Also:
-
PERMISSION_ADMIN
public static final int PERMISSION_ADMIN- See Also:
-
KEY_ABILITIES
- See Also:
-
KEY_PLAYER_PERMISSION
- See Also:
-
KEY_COMMAND_PERMISSION
- See Also:
-
-
Constructor Details
-
AdventureSettings
-
AdventureSettings
-
-
Method Details
-
setPlayerPermission
@PowerNukkitXOnly @Since("1.19.50-r3") public void setPlayerPermission(PlayerPermission playerPermission) -
init
-
clone
-
set
@PowerNukkitXOnly @Since("1.19.50-r3") public AdventureSettings set(PlayerAbility ability, boolean value) -
set
-
get
-
get
-
update
@PowerNukkitDifference(info="Players in spectator mode will be flagged as member even if they are OP due to a client-side limitation", since="1.3.1.2-PN") @PowerNukkitXDifference(info="updateAdventureSettingsPacket now will be sent to all players") public void update() -
onOpChange
当玩家OP身份变动时此方法将被调用 注意此方法并不会向客户端发包刷新权限信息,你需要手动调用update()方法刷新- Parameters:
op
- 是否是OP
-
sendAbilities
-
saveNBT
保存权限到nbt -
readNBT
从nbt读取权限数据 -
updateAdventureSettings
-
getPlayerPermission
-
getCommandPermission
-
setCommandPermission
-