Skip to content

Commit

Permalink
合并 Dynmap,现已支持 Dynmap 卫星地图渲染。
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Jul 18, 2024
1 parent 81e7cdd commit 4d1325a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 简介

鉴于 Residence 插件的作者项目较多,维护压力大,无法及时跟进新版本以及适配Folia核心。故开发此插件,旨在平替纯净版生存服Residence的使用。
鉴于 Residence 插件的作者项目较多,维护压力大,无法及时跟进新版本以及适配Folia核心。故开发此插件,旨在平替纯净版生存服Residence的使用(支持从 Res 迁移数据)

**请注意,本插件目前处于中期测试稳定阶段,绝大多数bug或漏洞已被修复,目前已具备完全可用性。但不排除仍然存在某些问题,如果遇到任何 BUG 欢迎及时发送邮件或添加QQ群告知,感激不尽。**

Expand All @@ -29,7 +29,7 @@
## 功能介绍

- 支持 Postgresql、Mysql、Sqlite3 存储数据;
- 支持BlueMap卫星地图渲染
- 支持 BlueMap、Dynmap 卫星地图渲染
- 支持为玩家单独设置特权;
- 支持设置领地管理员;
- 支持子领地;
Expand Down
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.37.1-beta</version>
<version>1.38.0-beta</version>
<packaging>jar</packaging>

<name>Dominion</name>
Expand Down Expand Up @@ -70,6 +70,10 @@
<id>lunadeer-repo</id>
<url>https://ssl.lunadeer.cn:14454/repository/maven-snapshots/</url>
</repository>
<repository>
<id>MikeRepo</id>
<url>https://repo.mikeprimm.com/</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -95,5 +99,11 @@
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>us.dynmap</groupId>
<artifactId>dynmap-api</artifactId>
<version>3.4-beta-3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
10 changes: 9 additions & 1 deletion src/main/java/cn/lunadeer/dominion/utils/DynmapConnect.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void apiEnabled(DynmapCommonAPI dynmapCommonAPI) {
}
}

public void setDominionMarker(DominionDTO dominion) {
private void setDominionMarker(DominionDTO dominion) {
String nameLabel = "<div>" + dominion.getName() + "</div>";
double[] xx = {dominion.getX1(), dominion.getX2()};
double[] zz = {dominion.getZ1(), dominion.getZ2()};
Expand All @@ -55,6 +55,10 @@ public void setDominionMarker(DominionDTO dominion) {

public void setDominionMarkers(List<DominionDTO> dominions) {
Scheduler.runTaskAsync(() -> {
if (this.markerSet_dominion == null) {
XLogger.warn("无法连接到 Dynmap,如果你不打算使用卫星地图渲染建议前往配置文件关闭此功能。");
return;
}
this.markerSet_dominion.getAreaMarkers().forEach(AreaMarker::deleteMarker);
for (DominionDTO dominion : dominions) {
this.setDominionMarker(dominion);
Expand All @@ -64,6 +68,10 @@ public void setDominionMarkers(List<DominionDTO> dominions) {

public void setMCAMarkers(Map<String, List<String>> mca_files) {
Scheduler.runTaskAsync(() -> {
if (this.markerSet_mca == null) {
XLogger.warn("无法连接到 Dynmap,如果你不打算使用卫星地图渲染建议前往配置文件关闭此功能。");
return;
}
this.markerSet_mca.getAreaMarkers().forEach(AreaMarker::deleteMarker);
for (Map.Entry<String, List<String>> entry : mca_files.entrySet()) {
for (String file : entry.getValue()) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/cn/lunadeer/dominion/utils/Particle.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
public class Particle {

public static void showBorder(Player player, DominionDTO dominion) {
// 由于领地的坐标系统是方块坐标,所以大端需要减去1才是实际角点坐标
ParticleRender.showBoxFace(player,
dominion.getLocation1().getWorld(),
dominion.getLocation1().getBlockX(),
Expand Down

0 comments on commit 4d1325a

Please sign in to comment.