當前位置: 首頁>>代碼示例>>Java>>正文


Java ResidenceDeleteEvent類代碼示例

本文整理匯總了Java中com.bekvon.bukkit.residence.event.ResidenceDeleteEvent的典型用法代碼示例。如果您正苦於以下問題:Java ResidenceDeleteEvent類的具體用法?Java ResidenceDeleteEvent怎麽用?Java ResidenceDeleteEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ResidenceDeleteEvent類屬於com.bekvon.bukkit.residence.event包,在下文中一共展示了ResidenceDeleteEvent類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onRemoveEvent

import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent; //導入依賴的package包/類
@EventHandler
public void onRemoveEvent(ResidenceDeleteEvent event) throws SQLException {

    // Ensure that the Database database connection is established
    Database.connect();
    if (!Database.isConnected()) {
        Database.connect();
    }

    if (event.getResidence().isSubzone()) {
    } else {
        Player p = event.getPlayer();
        String pUUID = p.getUniqueId().toString().replace("-", "");
        long plotArea = event.getResidence().getMainArea().getSize();
        String playerWorld = Database.getPlayerWorld(p.getWorld().getName());
        String playerWorldReplaced = playerWorld.replace("_count", "");
        String preMessage = Main.getPlugin().getConfig().getString("MessagesConfig.PreMessage");

        ResultSet RSland = Database.getPlayerLand(pUUID);
        if (Database.isConnected()) {
            while (RSland.next()) {
                if (p.getName().equals(event.getResidence().getOwner())) {
                    Long prevWildLand = RSland.getLong(playerWorld);
                    Long newWildLand = prevWildLand - plotArea;
                    Database.changePlayerWildLand(pUUID, newWildLand, playerWorld);
                    p.sendMessage(preMessage + "§A Removed §6" + plotArea + "§A Tiles from " + StringUtils.capitalize(playerWorldReplaced) + " land");
                    p.sendMessage(String.valueOf(preMessage + "§A New " + StringUtils.capitalize(playerWorldReplaced) + " Land Count: §6" + newWildLand));
                }
            }


        }
    }
}
 
開發者ID:L-E-iT,項目名稱:Eldin-Land-Plugin,代碼行數:35,代碼來源:PlotRemoveListener.java

示例2: onResidenceDelete

import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent; //導入依賴的package包/類
@EventHandler
public void onResidenceDelete(ResidenceDeleteEvent event) {
	event.getResidence().getAreaMap().values().forEach(area -> {
		area.getChunks().forEach(chunkRef -> {
			
		});
	});
}
 
開發者ID:redstone,項目名稱:FreshWilderness,代碼行數:9,代碼來源:ResidenceEngine.java

示例3: onResidenceDeleteEvent

import com.bekvon.bukkit.residence.event.ResidenceDeleteEvent; //導入依賴的package包/類
@EventHandler
public void onResidenceDeleteEvent(final ResidenceDeleteEvent event) {
    if (event.getPlayer() != null) {                    
        ClaimedResidence res = Residence.getResidenceManager().getByLoc(event.getPlayer().getLocation());
        if (res != null) {                   
            for (Player player : res.getPlayersInResidence()) {
                if (player != null) {
                    ServerWorldUtil.sendResidenceInfo(player, res);
                }
            }
        } else {
            ServerWorldUtil.sendResidenceInfo(event.getPlayer(), res);
        }
    }
}
 
開發者ID:AlmuraDev,項目名稱:AlmuraForgeBridge,代碼行數:16,代碼來源:PlayerListener.java


注:本文中的com.bekvon.bukkit.residence.event.ResidenceDeleteEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。