本文整理匯總了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));
}
}
}
}
}
示例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 -> {
});
});
}
示例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);
}
}
}