本文整理汇总了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);
}
}
}