本文整理汇总了Java中org.bukkit.entity.Player.hasPlayedBefore方法的典型用法代码示例。如果您正苦于以下问题:Java Player.hasPlayedBefore方法的具体用法?Java Player.hasPlayedBefore怎么用?Java Player.hasPlayedBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Player
的用法示例。
在下文中一共展示了Player.hasPlayedBefore方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerSpawnLocation
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerSpawnLocation(PlayerSpawnLocationEvent event) {
Player player = event.getPlayer();
if (!player.hasPlayedBefore()) {
if (this.canApply() && this.setCooldown(player, player.getUniqueId(), this.defaultCooldown, true)) {
this.setPaused(player.getUniqueId(), true);
player.sendMessage(ChatColor.GREEN + "You now have your " + getDisplayName() + ChatColor.GREEN + " timer.");
}
} else {
// If a player has their timer paused and they are not in a safezone, un-pause for them.
// We do this because disconnection pauses PVP Protection.
if (this.isPaused(player) && getRemaining(player) > 0L && !plugin.getFactionManager().getFactionAt(event.getSpawnLocation()).isSafezone()) {
this.setPaused(player.getUniqueId(), false);
}
}
}
示例2: allowNewPlayer
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@EventHandler(
ignoreCancelled = false,
priority = EventPriority.HIGH)
public void allowNewPlayer(PlayerLoginEvent event) {
Player player = event.getPlayer();
if(!player.hasPlayedBefore() && event.getResult() == Result.KICK_FULL && !player.isBanned()) {
if(!inst.getConfig().getBoolean("new-players-kick-if-full")) {
event.allow();
}
}
}
示例3: onJoin
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
showAllSleeping(player);
if(!player.hasPlayedBefore())
{
fatigue.getScore(player).setScore(0);
}
}
示例4: onFirstJoin
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onFirstJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if(!player.hasPlayedBefore())
{
carbon.getScore(player).setScore(960);
protein.getScore(player).setScore(240);
salts.getScore(player).setScore(360);
}
}
示例5: onFirstJoin
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onFirstJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if(!player.hasPlayedBefore())
{
thirst.getScore(player).setScore(30);
}
}
示例6: onPlayerJoin
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e)
{
Player player = e.getPlayer();
if(!player.hasPlayedBefore())
{
boardHunger.getScore(player).setScore(0);
boardThirst.getScore(player).setScore(0);
boardFatigue.getScore(player).setScore(1);
boardNutrients.getScore(player).setScore(1);
}
SetupScorebard(player);
}
示例7: onFirstJoin
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onFirstJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if(!player.hasPlayedBefore())
{
fatigue.getScore(player).setScore(0);
}
}
示例8: onPlayerSpawn
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
public void onPlayerSpawn(PlayerSpawnLocationEvent event) {
Player player = event.getPlayer();
if (!player.hasPlayedBefore()) {
plugin.getEconomyManager().addBalance(player.getUniqueId(), 250); // give player some starting money
event.setSpawnLocation(Bukkit.getWorld(DEFAULT_WORLD_NAME).getSpawnLocation().add(-3.5, 76, 6.5));
}
}
示例9: getMoney
import org.bukkit.entity.Player; //导入方法依赖的package包/类
public double getMoney(UUID player) {
Player ply = getPlayer(player);
if (ply != null && ply.hasPlayedBefore()) {
return econ.getBalance(ply);
}
return -1.0d;
}
示例10: isNew
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@Override
protected boolean isNew(Player player) {
return !player.hasPlayedBefore();
}