Java Code Examples for org.bukkit.OfflinePlayer#isOp()

The following examples show how to use org.bukkit.OfflinePlayer#isOp() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RentRegion.java    From AreaShop with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean checkInactive() {
	if(isDeleted() || !isRented()) {
		return false;
	}
	long inactiveSetting = getInactiveTimeUntilUnrent();
	OfflinePlayer player = Bukkit.getOfflinePlayer(getRenter());
	if(inactiveSetting <= 0 || player.isOp()) {
		return false;
	}
	long lastPlayed = getLastActiveTime();
	//AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
	if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
		AreaShop.info("Region " + getName() + " unrented because of inactivity for player " + getPlayerName());
		AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis() - player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
		return this.unRent(true, null);
	}
	return false;
}
 
Example 2
Source File: BuyRegion.java    From AreaShop with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean checkInactive() {
	if(isDeleted() || !isSold()) {
		return false;
	}
	long inactiveSetting = getInactiveTimeUntilSell();
	OfflinePlayer player = Bukkit.getOfflinePlayer(getBuyer());
	if(inactiveSetting <= 0 || player.isOp()) {
		return false;
	}
	long lastPlayed = getLastActiveTime();
	//AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
	if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
		AreaShop.info("Region " + getName() + " unrented because of inactivity for player " + getPlayerName());
		AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis() - player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
		return this.sell(true, null);
	}
	return false;
}
 
Example 3
Source File: PermissionUtils.java    From FunnyGuilds with Apache License 2.0 4 votes vote down vote up
public static boolean isPrivileged(User user, String permission) {
    OfflinePlayer offlinePlayer = user.getOfflinePlayer();

    return offlinePlayer.isOp() ||
            VaultHook.isPermissionHooked() && VaultHook.hasPermission(offlinePlayer, permission);
}
 
Example 4
Source File: Players.java    From CardinalPGM with MIT License 4 votes vote down vote up
public static double getSnowflakeMultiplier(OfflinePlayer player) {
    if (player.isOp()) return 2.5;
    if (PermissionModule.isDeveloper(player.getUniqueId())) return 2.0;
    return 1.0;
}