Merge branch 'master' into fix/heightmaps
This commit is contained in:
commit
c336036872
|
@ -1 +1 @@
|
|||
Subproject commit 40140f87c672792f3b39076986c2643d83eda1ec
|
||||
Subproject commit 2cdc5c8a8770a8b26fcdd4ad6d742b13cc4770f5
|
|
@ -855,7 +855,7 @@ public class Commands<S> {
|
|||
TextColor.DARK_GRAY, helper.formatTime(map.getRenderState().getLatestRenderTime())));
|
||||
|
||||
if (frozen)
|
||||
lines.add(Text.of(TextColor.AQUA, TextFormat.ITALIC, "This map is frozen!"));
|
||||
lines.add(Text.of(TextColor.AQUA, TextFormat.ITALIC, "\u00A0\u00A0\u00A0This map is frozen!"));
|
||||
}
|
||||
|
||||
CommandSource source = commandSourceInterface.apply(context.getSource());
|
||||
|
|
|
@ -120,7 +120,26 @@ public class HttpConnection implements SelectionConsumer {
|
|||
|
||||
private void handleIOException(Channel channel, IOException e) {
|
||||
request.clear();
|
||||
response = null;
|
||||
|
||||
if (response != null) {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e2) {
|
||||
Logger.global.logWarning("Failed to close response: " + e2);
|
||||
}
|
||||
response = null;
|
||||
}
|
||||
|
||||
if (futureResponse != null) {
|
||||
futureResponse.thenAccept(response -> {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e2) {
|
||||
Logger.global.logWarning("Failed to close response: " + e2);
|
||||
}
|
||||
});
|
||||
futureResponse = null;
|
||||
}
|
||||
|
||||
Logger.global.logDebug("Failed to process selection: " + e);
|
||||
try {
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
title: "Menu"
|
||||
tooltip: "Menu"
|
||||
}
|
||||
map: {
|
||||
unloaded: "Geen kaart geladen."
|
||||
loading: "Kaart laden..."
|
||||
errored: "Er is een probleem opgetreden tijdens het laden van deze kaart!"
|
||||
}
|
||||
maps: {
|
||||
title: "Kaarten"
|
||||
button: "Kaarten"
|
||||
|
@ -14,9 +19,17 @@
|
|||
button: "Markers"
|
||||
tooltip: "Markerlijst"
|
||||
marker: "marker | markers"
|
||||
markerSet: "Markerset | Markersets"
|
||||
markerSet: "markerset | markersets"
|
||||
searchPlaceholder: "Zoek..."
|
||||
followPlayerTitle: "Volg Speler"
|
||||
sort {
|
||||
title: "Sorteer op"
|
||||
by {
|
||||
default: "standaard"
|
||||
label: "naam"
|
||||
distance: "afstand"
|
||||
}
|
||||
}
|
||||
}
|
||||
settings: {
|
||||
title: "Instellingen"
|
||||
|
@ -47,6 +60,10 @@
|
|||
normal: "Normaal (Standaard x1)"
|
||||
low: "Laag (Opgeschaald x0.5)"
|
||||
}
|
||||
mapControls: {
|
||||
title: "Kaartbesturing"
|
||||
showZoomButtons: "Laat zoomknoppen zien"
|
||||
}
|
||||
freeFlightControls: {
|
||||
title: "Vrije camera"
|
||||
mouseSensitivity: "Muis gevoeligheid"
|
||||
|
@ -56,12 +73,15 @@
|
|||
title: "Renderafstand"
|
||||
hiresLayer: "Hires-Laag"
|
||||
lowersLayer: "Lowres-Laag"
|
||||
loadHiresWhileMoving: "Laad hires tijdens het bewegen"
|
||||
off: "Uit"
|
||||
}
|
||||
theme: {
|
||||
title: "Kleurmodus"
|
||||
default: "Standaard (Systeem/Browser)"
|
||||
dark: "Donker"
|
||||
light: "Licht"
|
||||
contrast: "Contrast"
|
||||
}
|
||||
debug: {
|
||||
button: "Debug"
|
||||
|
@ -76,6 +96,11 @@
|
|||
compass: {
|
||||
tooltip: "Kompas / Naar het noorden richten"
|
||||
}
|
||||
screenshot: {
|
||||
title: "Schermafdruk"
|
||||
button: "Schermafdruk nemen"
|
||||
clipboard: "Kopieer naar klembord"
|
||||
}
|
||||
controls: {
|
||||
title: "Aanzicht / Besturing"
|
||||
perspective: {
|
||||
|
|
|
@ -4,17 +4,32 @@
|
|||
title: "選單"
|
||||
tooltip: "選單"
|
||||
}
|
||||
map: {
|
||||
unloaded: "未載入任何地圖。"
|
||||
loading: "載入地圖中..."
|
||||
errored: "載入地圖時發生錯誤!"
|
||||
}
|
||||
maps: {
|
||||
title: "地圖"
|
||||
button: "地圖"
|
||||
tooltip: "地圖列表"
|
||||
}
|
||||
markers: {
|
||||
title: "圖釘"
|
||||
button: "圖釘"
|
||||
tooltip: "圖釘列表"
|
||||
marker: "圖釘 | 圖釘"
|
||||
markerSet: "圖釘設定 | 圖釘設定"
|
||||
title: "標記"
|
||||
button: "標記"
|
||||
tooltip: "標記列表"
|
||||
marker: "標記 | 標記"
|
||||
markerSet: "標記組 | 標記組"
|
||||
searchPlaceholder: "搜尋..."
|
||||
followPlayerTitle: "跟隨玩家"
|
||||
sort: {
|
||||
title: "排序方式"
|
||||
by: {
|
||||
default: "預設"
|
||||
label: "名稱"
|
||||
distance: "距離"
|
||||
}
|
||||
}
|
||||
}
|
||||
settings: {
|
||||
title: "設定"
|
||||
|
@ -24,69 +39,81 @@
|
|||
button: "全螢幕模式"
|
||||
}
|
||||
resetCamera: {
|
||||
button: "重置視角"
|
||||
tooltip: "重置視角 & 位置"
|
||||
button: "重設視角"
|
||||
tooltip: "重設視角與位置"
|
||||
}
|
||||
updateMap: {
|
||||
button: "更新地圖"
|
||||
tooltip: "清除暫存"
|
||||
}
|
||||
lighting: {
|
||||
title: "亮度"
|
||||
title: "光照"
|
||||
dayNightSwitch: {
|
||||
tooltip: "白天/夜晚"
|
||||
tooltip: "白天/黑夜模式"
|
||||
}
|
||||
sunlight: "時間"
|
||||
sunlight: "陽光"
|
||||
ambientLight: "環境光"
|
||||
}
|
||||
resolution: {
|
||||
title: "解析度"
|
||||
high: "高 (最高畫質SSAA x2)"
|
||||
normal: "預設 (畫質優先Native x1)"
|
||||
low: "低 (效能優先Upscaling x0.5)"
|
||||
high: "高 (SSAA反鋸齒 x2)"
|
||||
normal: "正常 (原生 x1)"
|
||||
low: "低 (縮放 x0.5)"
|
||||
}
|
||||
mapControls: {
|
||||
title: "地圖控制"
|
||||
showZoomButtons: "顯示縮放按鈕"
|
||||
}
|
||||
freeFlightControls: {
|
||||
title: "滑鼠設定"
|
||||
title: "自由飛行控制"
|
||||
mouseSensitivity: "滑鼠靈敏度"
|
||||
invertMouseY: "反轉Y軸"
|
||||
invertMouseY: "反轉滑鼠Y軸"
|
||||
}
|
||||
renderDistance: {
|
||||
title: "顯示範圍"
|
||||
hiresLayer: "高畫質的距離"
|
||||
lowersLayer: "低畫質的距離"
|
||||
title: "渲染距離"
|
||||
hiresLayer: "高解析度層"
|
||||
lowersLayer: "低解析度層"
|
||||
loadHiresWhileMoving: "移動時加載高解析度層"
|
||||
off: "關閉"
|
||||
}
|
||||
theme: {
|
||||
title: "主題"
|
||||
default: "預設 (系統/瀏覽器)"
|
||||
dark: "黑暗"
|
||||
light: "明亮"
|
||||
dark: "深色模式"
|
||||
light: "明亮模式"
|
||||
contrast: "對比模式"
|
||||
}
|
||||
debug: {
|
||||
button: "除錯"
|
||||
button: "除錯模式"
|
||||
}
|
||||
resetAllSettings: {
|
||||
button: "重設所有設定"
|
||||
button: "重置所有設定"
|
||||
}
|
||||
players: {
|
||||
title: "玩家"
|
||||
tooltip: "玩家列表"
|
||||
}
|
||||
compass: {
|
||||
tooltip: "指北針"
|
||||
tooltip: "指南針 / 面向北方"
|
||||
}
|
||||
screenshot: {
|
||||
title: "截圖"
|
||||
button: "截圖"
|
||||
clipboard: "複製到剪貼板"
|
||||
}
|
||||
controls: {
|
||||
title: "顯示/控制"
|
||||
title: "視圖 / 控制"
|
||||
perspective: {
|
||||
button: "立體"
|
||||
tooltip: "立體顯示"
|
||||
button: "透視圖"
|
||||
tooltip: "透視視圖"
|
||||
}
|
||||
flatView: {
|
||||
button: "平面"
|
||||
tooltip: "正射/平面顯示"
|
||||
button: "平面視圖"
|
||||
tooltip: "正交視圖 / 平面視圖"
|
||||
}
|
||||
freeFlight: {
|
||||
button: "觀察者"
|
||||
tooltip: "觀察者模式"
|
||||
button: "自由飛行"
|
||||
tooltip: "自由飛行 / 旁觀模式"
|
||||
}
|
||||
}
|
||||
language: {
|
||||
|
@ -94,16 +121,16 @@
|
|||
}
|
||||
blockTooltip: {
|
||||
block: "方塊"
|
||||
position: "座標"
|
||||
position: "位置"
|
||||
chunk: "區塊"
|
||||
region: {
|
||||
region: "區域"
|
||||
file: "檔案"
|
||||
}
|
||||
light: {
|
||||
light: "亮度"
|
||||
light: "光線"
|
||||
sun: "日光"
|
||||
block: "光源"
|
||||
block: "方塊"
|
||||
}
|
||||
}
|
||||
info: {
|
||||
|
@ -112,32 +139,32 @@
|
|||
content: """
|
||||
<img src="assets/logo.png" style="display: block; width: 40%; margin: 3em auto; border-radius: 50%">
|
||||
<p>
|
||||
<h2>滑鼠控制:</h2>
|
||||
<h2>滑鼠控制:</h2>
|
||||
<table>
|
||||
<tr><th>移動:</th><td><kbd>左鍵</kbd>長按</td></tr>
|
||||
<tr><th>縮放:</th><td><kbd>滑鼠滾輪</kbd> (測試)</td></tr>
|
||||
<tr><th>旋轉/傾斜:</th><td><kbd>右鍵</kbd>長按</td></tr>
|
||||
<tr><th>移動</th><td><kbd>左鍵點擊</kbd> + 拖曳</td></tr>
|
||||
<tr><th>縮放</th><td><kbd>滑鼠滾輪</kbd> (滾動)</td></tr>
|
||||
<tr><th>旋轉 / 傾斜</th><td><kbd>右鍵點擊</kbd> + 拖曳</td></tr>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<h2>鍵盤控制:</h2>
|
||||
<h2>鍵盤控制:</h2>
|
||||
<table>
|
||||
<tr><th>移動:</th><td><kbd>點擊</kbd> / <kbd>方向鍵</kbd></td></tr>
|
||||
<tr><th>縮放:</th><td>Numpad: <kbd>+</kbd>/<kbd>-</kbd> or <kbd>Ins</kbd>/<kbd>Home</kbd></td></tr>
|
||||
<tr><th>旋轉/傾斜:</th><td><kbd>左Alt</kbd> + <kbd>點擊</kbd> / <kbd>方向鍵</kbd> 或 <kbd>Delete</kbd>/<kbd>End</kbd>/<kbd>Page Up</kbd>/<kbd>Page Down</kbd></td></tr>
|
||||
<tr><th>移動</th><td><kbd>wasd</kbd> / <kbd>方向鍵</kbd></td></tr>
|
||||
<tr><th>縮放</th><td>Numpad(數字鍵盤):<kbd>+</kbd>/<kbd>-</kbd> 或 <kbd>Ins</kbd>/<kbd>Home</kbd></td></tr>
|
||||
<tr><th>旋轉 / 傾斜</th><td><kbd>左Alt</kbd> + <kbd>wasd</kbd> / <kbd>方向鍵</kbd> 或 <kbd>Delete</kbd>/<kbd>End</kbd>/<kbd>Page Up</kbd>/<kbd>Page Down</kbd></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<h2>觸控:</h2>
|
||||
<h2>觸控控制:</h2>
|
||||
<table>
|
||||
<tr><th>移動:</th><td>拖動</td></tr>
|
||||
<tr><th>縮放:</th><td>用兩根手指觸摸</td></tr>
|
||||
<tr><th>旋轉/傾斜:</th><td>用兩根手指觸摸旋轉</td></tr>
|
||||
<tr><th>移動</th><td>觸控 + 拖曳</td></tr>
|
||||
<tr><th>縮放</th><td>用兩根手指觸碰旋轉</td></tr>
|
||||
<tr><th>旋轉/傾斜</th><td>用兩指觸控 + 旋轉 / 上下移動</td></tr>
|
||||
</table>
|
||||
</p>
|
||||
<br><hr>
|
||||
<p class="info-footer">
|
||||
This map has been generated with ♥ using <a href="https://bluecolo.red/bluemap">BlueMap</a> {version}
|
||||
此地圖使用 ♥ 以 {version} 版本的 <a href="https://bluecolo.red/bluemap">BlueMap</a> 生成
|
||||
</p>
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -349,7 +349,7 @@ export class BlueMapApp {
|
|||
return new Promise((resolve, reject) => {
|
||||
let loader = new FileLoader();
|
||||
loader.setResponseType("json");
|
||||
loader.load(map.data.dataUrl + "live/players?" + generateCacheHash(),
|
||||
loader.load(map.data.dataUrl + "live/players.json?" + generateCacheHash(),
|
||||
fileData => {
|
||||
if (!fileData) reject(`Failed to parse '${this.fileUrl}'!`);
|
||||
else resolve(fileData);
|
||||
|
@ -564,7 +564,7 @@ export class BlueMapApp {
|
|||
try {
|
||||
this.mapViewer.clearTileCache();
|
||||
if (this.mapViewer.map) {
|
||||
await this.switchMap(this.mapViewer.map.data.id);
|
||||
await this.switchMap(this.mapViewer.map.data.id, false);
|
||||
}
|
||||
this.saveUserSettings();
|
||||
} catch (e) {
|
||||
|
|
|
@ -79,7 +79,7 @@ export class PlayerMarkerManager extends MarkerManager {
|
|||
}
|
||||
|
||||
clear() {
|
||||
this.getPlayerMarkerSet(false).clear();
|
||||
this.getPlayerMarkerSet(false)?.clear();
|
||||
}
|
||||
|
||||
}
|
|
@ -374,7 +374,7 @@ public class ResourcePack {
|
|||
if (!usedTextures.contains(resourcePath)) return null; // don't load unused textures
|
||||
|
||||
try (InputStream in = Files.newInputStream(file)) {
|
||||
return Texture.from(resourcePath, ImageIO.read(in));
|
||||
return Texture.from(resourcePath, ImageIO.read(in), Files.exists(file.resolveSibling(file.getFileName() + ".mcmeta")));
|
||||
}
|
||||
}, textures));
|
||||
|
||||
|
|
|
@ -99,8 +99,12 @@ public class Texture {
|
|||
}
|
||||
|
||||
public static Texture from(ResourcePath<Texture> resourcePath, BufferedImage image) throws IOException {
|
||||
return from(resourcePath, image, true);
|
||||
}
|
||||
|
||||
public static Texture from(ResourcePath<Texture> resourcePath, BufferedImage image, boolean animated) throws IOException {
|
||||
//crop off animation frames
|
||||
if (image.getHeight() > image.getWidth()){
|
||||
if (animated && image.getHeight() > image.getWidth()){
|
||||
image = image.getSubimage(0, 0, image.getWidth(), image.getWidth());
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public enum Compression {
|
|||
|
||||
NONE("none", "", out -> out, in -> in),
|
||||
GZIP("gzip", ".gz", GZIPOutputStream::new, GZIPInputStream::new),
|
||||
ZLIB("zlib", ".zlib", DeflaterOutputStream::new, DeflaterInputStream::new),
|
||||
DEFLATE("deflate", ".deflate", DeflaterOutputStream::new, DeflaterInputStream::new),
|
||||
ZSTD("zstd", ".zst", ZstdOutputStream::new, ZstdInputStream::new);
|
||||
|
||||
private final String typeId;
|
||||
|
|
|
@ -39,14 +39,10 @@ public class FileHelper {
|
|||
public static OutputStream createFilepartOutputStream(final Path file) throws IOException {
|
||||
final Path partFile = getPartFile(file);
|
||||
FileHelper.createDirectories(partFile.getParent());
|
||||
|
||||
OutputStream os = Files.newOutputStream(partFile, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
||||
return new WrappedOutputStream(os, () -> {
|
||||
if (!Files.exists(partFile)) return;
|
||||
|
||||
Files.deleteIfExists(file);
|
||||
FileHelper.createDirectories(file.getParent());
|
||||
|
||||
FileHelper.move(partFile, file);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ modrinth {
|
|||
versionNumber.set("${project.version}-${project.name}")
|
||||
changelog.set("Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
uploadFile.set(tasks.findByName("remappedShadowJar"))
|
||||
gameVersions.addAll("1.20")
|
||||
gameVersions.addAll("1.20", "1.20.1")
|
||||
dependencies {
|
||||
required.project("P7dR8mSH") // Fabric API
|
||||
}
|
||||
|
@ -162,6 +162,7 @@ curseforge {
|
|||
addGameVersion("Java 17")
|
||||
|
||||
addGameVersion("1.20")
|
||||
addGameVersion("1.20.1")
|
||||
|
||||
mainArtifact(tasks.findByName("remappedShadowJar"), closureOf<CurseArtifact> {
|
||||
relations(closureOf<CurseRelation> {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
rootProject.name = "folia"
|
||||
|
||||
includeBuild("../../BlueMapCommon")
|
|
@ -175,7 +175,7 @@ modrinth {
|
|||
versionNumber = "${project.version}-${project.name}"
|
||||
changelog = "Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}"
|
||||
uploadFile = shadowJar
|
||||
gameVersions = ["1.20"]
|
||||
gameVersions = ["1.20", "1.20.1"]
|
||||
}
|
||||
|
||||
curseforge {
|
||||
|
@ -192,6 +192,7 @@ curseforge {
|
|||
addGameVersion "Java 17"
|
||||
|
||||
addGameVersion "1.20"
|
||||
addGameVersion "1.20.1"
|
||||
|
||||
mainArtifact shadowJar
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ plugins {
|
|||
id ("com.github.node-gradle.node") version "3.0.1"
|
||||
id ("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id ("com.modrinth.minotaur") version "2.+"
|
||||
id ("io.papermc.hangar-publish-plugin") version "0.1.0"
|
||||
}
|
||||
|
||||
group = "de.bluecolored.bluemap.bukkit"
|
||||
|
@ -39,7 +40,7 @@ dependencies {
|
|||
exclude( group = "com.google.code.gson", module = "gson" )
|
||||
}
|
||||
|
||||
shadow ("dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT")
|
||||
shadow ("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
||||
implementation ("org.bstats:bstats-bukkit:2.2.1")
|
||||
|
||||
testImplementation ("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
|
@ -118,14 +119,35 @@ modrinth {
|
|||
token.set(System.getenv("MODRINTH_TOKEN"))
|
||||
projectId.set("swbUV1cr")
|
||||
versionNumber.set("${project.version}-${project.name}")
|
||||
changelog.set("Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
uploadFile.set(tasks.findByName("shadowJar"))
|
||||
loaders.addAll("folia")
|
||||
loaders.addAll("paper","purpur","folia")
|
||||
gameVersions.addAll(
|
||||
"1.19.4"
|
||||
"1.20.1"
|
||||
)
|
||||
}
|
||||
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set(project.version as String)
|
||||
id.set("BlueMap")
|
||||
channel.set("Release")
|
||||
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
|
||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||
|
||||
// register platforms
|
||||
platforms {
|
||||
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
|
||||
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
platformVersions.set(listOf(
|
||||
"1.20.1"
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("publish") {
|
||||
dependsOn("modrinth")
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
rootProject.name = "paper"
|
||||
|
||||
includeBuild("../../BlueMapCommon")
|
|
@ -34,7 +34,6 @@ import org.bukkit.Location;
|
|||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Optional;
|
||||
|
@ -51,12 +50,7 @@ public class BukkitCommandSource implements CommandSource {
|
|||
|
||||
@Override
|
||||
public void sendMessage(Text text) {
|
||||
if (delegate instanceof Player player) {
|
||||
player.sendMessage(GsonComponentSerializer.gson().deserialize(text.toJSONString()));
|
||||
return;
|
||||
}
|
||||
|
||||
delegate.sendMessage(text.toPlainString());
|
||||
delegate.sendMessage(GsonComponentSerializer.gson().deserialize(text.toJSONString()));
|
||||
}
|
||||
|
||||
@Override
|
|
@ -31,15 +31,17 @@ import com.mojang.brigadier.suggestion.Suggestions;
|
|||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import de.bluecolored.bluemap.common.plugin.Plugin;
|
||||
import de.bluecolored.bluemap.common.plugin.commands.Commands;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.RemoteConsoleCommandSender;
|
||||
import org.bukkit.command.defaults.BukkitCommand;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.TabCompleteEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -118,7 +120,7 @@ public class BukkitCommands implements Listener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) {
|
||||
String command = commandLabel;
|
||||
if (args.length > 0) {
|
||||
command += " " + StringUtils.join(args, ' ');
|
||||
|
@ -127,10 +129,10 @@ public class BukkitCommands implements Listener {
|
|||
try {
|
||||
return dispatcher.execute(command, sender) > 0;
|
||||
} catch (CommandSyntaxException ex) {
|
||||
sender.sendMessage(ChatColor.RED + ex.getRawMessage().getString());
|
||||
sender.sendMessage(Component.text(ex.getRawMessage().getString()).color(NamedTextColor.RED));
|
||||
|
||||
String context = ex.getContext();
|
||||
if (context != null) sender.sendMessage(ChatColor.GRAY + context);
|
||||
if (context != null) sender.sendMessage(Component.text(context).color(NamedTextColor.GRAY));
|
||||
|
||||
return false;
|
||||
}
|
|
@ -28,7 +28,6 @@ import de.bluecolored.bluemap.common.serverinterface.Dimension;
|
|||
import de.bluecolored.bluemap.common.serverinterface.ServerWorld;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -85,7 +84,14 @@ public class BukkitWorld implements ServerWorld {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean persistWorldChanges() throws IOException {
|
||||
public boolean persistWorldChanges() {
|
||||
/* Not supported by folia
|
||||
World world = delegate.get();
|
||||
if (world != null) {
|
||||
world.save();
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
|
@ -24,12 +24,13 @@
|
|||
*/
|
||||
package de.bluecolored.bluemap.bukkit;
|
||||
|
||||
import de.bluecolored.bluemap.common.serverinterface.ServerEventListener;
|
||||
import de.bluecolored.bluemap.common.plugin.text.Text;
|
||||
import de.bluecolored.bluemap.common.serverinterface.ServerEventListener;
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
|
@ -63,8 +64,8 @@ public class EventForwarder implements Listener {
|
|||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public synchronized void onPlayerChat(AsyncPlayerChatEvent evt) {
|
||||
String message = String.format(evt.getFormat(), evt.getPlayer().getDisplayName(), evt.getMessage());
|
||||
public synchronized void onPlayerChat(AsyncChatEvent evt) {
|
||||
String message = String.format(PlainTextComponentSerializer.plainText().serialize(evt.message()));
|
||||
for (ServerEventListener listener : listeners) listener.onChatMessage(Text.of(message));
|
||||
}
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
*/
|
||||
package de.bluecolored.bluemap.bukkit;
|
||||
|
||||
import de.bluecolored.bluemap.core.logger.AbstractLogger;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import de.bluecolored.bluemap.core.logger.AbstractLogger;
|
||||
|
||||
public class JavaLogger extends AbstractLogger {
|
||||
|
||||
private Logger out;
|
||||
private final Logger out;
|
||||
|
||||
public JavaLogger(Logger out) {
|
||||
this.out = out;
|
|
@ -5,7 +5,6 @@ plugins {
|
|||
id ("com.github.node-gradle.node") version "3.0.1"
|
||||
id ("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id ("com.modrinth.minotaur") version "2.+"
|
||||
id ("io.papermc.hangar-publish-plugin") version "0.0.4"
|
||||
}
|
||||
|
||||
group = "de.bluecolored.bluemap.bukkit"
|
||||
|
@ -124,7 +123,7 @@ modrinth {
|
|||
versionNumber.set("${project.version}-${project.name}")
|
||||
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
uploadFile.set(tasks.findByName("shadowJar"))
|
||||
loaders.addAll("spigot")
|
||||
loaders.addAll("spigot", "paper", "purpur")
|
||||
gameVersions.addAll(
|
||||
"1.13.2",
|
||||
"1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4",
|
||||
|
@ -132,38 +131,11 @@ modrinth {
|
|||
"1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
|
||||
"1.17", "1.17.1",
|
||||
"1.18", "1.18.1", "1.18.2",
|
||||
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4"
|
||||
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
|
||||
"1.20", "1.20.1"
|
||||
)
|
||||
}
|
||||
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set(project.version as String)
|
||||
namespace("Blue", "BlueMap")
|
||||
channel.set("Release")
|
||||
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
||||
|
||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||
|
||||
// register platforms
|
||||
platforms {
|
||||
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
|
||||
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
platformVersions.set(listOf(
|
||||
"1.13.2",
|
||||
"1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4",
|
||||
"1.15", "1.15.1", "1.15.2",
|
||||
"1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
|
||||
"1.17", "1.17.1",
|
||||
"1.18", "1.18.1", "1.18.2",
|
||||
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4"
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("publish") {
|
||||
dependsOn("modrinth")
|
||||
dependsOn("publishPluginPublicationToHangar")
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ includeBuild("implementations/forge-1.19.4")
|
|||
includeBuild("implementations/forge-1.20")
|
||||
|
||||
includeBuild("implementations/spigot")
|
||||
includeBuild("implementations/folia")
|
||||
includeBuild("implementations/paper")
|
||||
|
||||
includeBuild("implementations/sponge-8.0.0")
|
||||
includeBuild("implementations/sponge-9.0.0")
|
||||
|
|
Loading…
Reference in New Issue