-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from xinyihl/master
删除无用import & 添加是否开启告示牌添加标记配置选项 & 分离api
- Loading branch information
Showing
14 changed files
with
76 additions
and
83 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/main/java/org/siberianhusy/bluemapsetmarkers/api/Api.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.siberianhusy.bluemapsetmarkers.api; | ||
|
||
import com.flowpowered.math.vector.Vector2i; | ||
import com.flowpowered.math.vector.Vector3d; | ||
import de.bluecolored.bluemap.api.markers.POIMarker; | ||
import org.bukkit.Location; | ||
import org.bukkit.World; | ||
import org.siberianhusy.bluemapsetmarkers.data.Data; | ||
import org.siberianhusy.bluemapsetmarkers.utils.Judge; | ||
|
||
import java.awt.image.BufferedImage; | ||
|
||
import static org.siberianhusy.bluemapsetmarkers.utils.Get.getBufferedImage; | ||
|
||
public class Api { | ||
//删除标记点 | ||
public static boolean delMarker(String name, World world){ | ||
if (!Judge.judgeMarkerName(name)){ | ||
return false; | ||
}else { | ||
Data.worldMarkers.get(world).getMarkers().remove(name); | ||
return true; | ||
} | ||
} | ||
|
||
//添加标记 | ||
public static void addMarker(Location location, String name, String icon){ | ||
Vector2i anchor; | ||
BufferedImage image = getBufferedImage(icon); | ||
int width = image.getWidth(); | ||
int height = image.getHeight(); | ||
anchor = new Vector2i(height/2, width/2); | ||
Vector3d pos = new Vector3d(location.getX(), location.getY(), location.getZ()); | ||
POIMarker marker = POIMarker.builder().label(name).position(pos).maxDistance(100000).icon(icon,anchor).build(); | ||
Data.worldMarkers.get(location.getWorld()).put(name, marker); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
src/main/java/org/siberianhusy/bluemapsetmarkers/commands/PlayerCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/main/java/org/siberianhusy/bluemapsetmarkers/data/PlayerData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/main/java/org/siberianhusy/bluemapsetmarkers/events/PlayerGUIEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#默认标记图片直链 | ||
iconUrl: "https://i.mcmod.cn/item/icon/32x32/0/3167.png?v=4" | ||
iconUrl: "https://i.mcmod.cn/item/icon/32x32/0/3167.png?v=4" | ||
#是否允许使用告示牌添加标记 | ||
isSignWatcher: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters