Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
ColdeZhang committed Jul 13, 2024
2 parents cc2423d + ba81403 commit 4c8066f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/main/java/cn/lunadeer/dominion/events/SelectPointEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,31 @@ public void selectPoint(PlayerInteractEvent event) {
if (action == Action.LEFT_CLICK_BLOCK) {
event.setCancelled(true);
Notification.info(player, "已选择第一个点: %d %d %d", block.getX(), block.getY(), block.getZ());
points.put(0, block.getLocation());
Location loc = block.getLocation();
if (Dominion.config.getLimitVert()) {
loc.setY(Dominion.config.getLimitMinY());
}
points.put(0, loc);
} else if (action == Action.RIGHT_CLICK_BLOCK) {
event.setCancelled(true);
Notification.info(player, "已选择第二个点: %d %d %d", block.getX(), block.getY(), block.getZ());
points.put(1, block.getLocation());
Location loc = block.getLocation();
if (Dominion.config.getLimitVert()) {
loc.setY(Dominion.config.getLimitMaxY());
}
points.put(1, loc);
} else {
return;
}
Dominion.pointsSelect.put(player.getUniqueId(), points);

if (points.size() == 2) {
World world = points.get(0).getWorld();
if (world == null) {
return;
}
if (!points.get(0).getWorld().equals(points.get(1).getWorld())) {
Notification.error(player, "两个点不在同一个世界");
Notification.warn(player, "两个点不在同一个世界");
return;
}
Notification.info(player, "已选择两个点,可以使用 /dominion create <领地名称> 创建领地");
Expand All @@ -69,10 +78,6 @@ public void selectPoint(PlayerInteractEvent event) {
int maxX = Math.max(loc1.getBlockX(), loc2.getBlockX());
int maxY = Math.max(loc1.getBlockY(), loc2.getBlockY());
int maxZ = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
if (Dominion.config.getLimitVert()) {
minY = Dominion.config.getLimitMinY();
maxY = Dominion.config.getLimitMaxY();
}
DominionDTO dominion = new DominionDTO(player.getUniqueId(), "", loc1.getWorld().getName(),
minX, minY, minZ, maxX, maxY, maxZ);
if (Dominion.config.getEconomyEnable()) {
Expand All @@ -95,6 +100,5 @@ public void selectPoint(PlayerInteractEvent event) {
Notification.info(player, "高度: %d", dominion.getHeight());
Notification.info(player, "体积: %d", dominion.getVolume());
}
Dominion.pointsSelect.put(player.getUniqueId(), points);
}
}
2 changes: 1 addition & 1 deletion src/main/java/cn/lunadeer/dominion/tuis/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void show(CommandSender sender, String[] args) {
.append(Button.create("所有领地").setExecuteCommand("/dominion all_dominion").build())
.append("查看所有领地");
Line config = Line.create()
.append(Button.create("系统配置").setExecuteCommand("/dominion config").build())
.append(Button.create("系统配置").setExecuteCommand("/dominion sys_config").build())
.append("查看/修改系统配置");
Line reload_cache = Line.create()
.append(Button.create("重载缓存").setExecuteCommand("/dominion reload_cache").build())
Expand Down

0 comments on commit 4c8066f

Please sign in to comment.