mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-19 15:09:23 +00:00
Fix build
This commit is contained in:
@@ -2,9 +2,6 @@ plugins {
|
|||||||
id("io.github.goooler.shadow") version "8.1.8"
|
id("io.github.goooler.shadow") version "8.1.8"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(project(":common"))
|
compileOnly(project(":common"))
|
||||||
compileOnly(project(":api"))
|
compileOnly(project(":api"))
|
||||||
@@ -26,12 +23,6 @@ dependencies {
|
|||||||
compileOnly("com.github.ben-manes.caffeine:caffeine:${rootProject.properties["caffeine_version"]}")
|
compileOnly("com.github.ben-manes.caffeine:caffeine:${rootProject.properties["caffeine_version"]}")
|
||||||
// COMMONS IO
|
// COMMONS IO
|
||||||
compileOnly("commons-io:commons-io:${rootProject.properties["commons_io_version"]}")
|
compileOnly("commons-io:commons-io:${rootProject.properties["commons_io_version"]}")
|
||||||
// FOP
|
// lwjgl
|
||||||
compileOnly("org.apache.pdfbox:fontbox:${rootProject.properties["fontbox_version"]}")
|
implementation("org.lwjgl:lwjgl-freetype:3.3.4")
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
shadowJar {
|
|
||||||
relocate ("net.kyori", "net.momirealms.customnameplates.libraries")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -51,9 +51,6 @@ import net.momirealms.customnameplates.api.placeholder.SharedPlaceholder;
|
|||||||
import net.momirealms.customnameplates.api.util.CharacterUtils;
|
import net.momirealms.customnameplates.api.util.CharacterUtils;
|
||||||
import net.momirealms.customnameplates.common.util.Tuple;
|
import net.momirealms.customnameplates.common.util.Tuple;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.fontbox.ttf.CmapSubtable;
|
|
||||||
import org.apache.fontbox.ttf.TTFParser;
|
|
||||||
import org.apache.fontbox.ttf.TrueTypeFont;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
@@ -780,35 +777,7 @@ public class AdvanceManagerImpl implements AdvanceManager {
|
|||||||
plugin.getPluginLogger().warn(ttfFile.getAbsolutePath() + " is not a .ttf");
|
plugin.getPluginLogger().warn(ttfFile.getAbsolutePath() + " is not a .ttf");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try (InputStream inputStream = new FileInputStream(ttfFile)) {
|
|
||||||
ttfCache.getParentFile().mkdirs();
|
|
||||||
ttfCache.createNewFile();
|
|
||||||
YamlDocument yml = plugin.getConfigManager().loadData(ttfCache);
|
|
||||||
TTFParser parser = new TTFParser();
|
|
||||||
TrueTypeFont ttf = parser.parseEmbedded(inputStream);
|
|
||||||
CmapSubtable[] cMaps = ttf.getCmap().getCmaps();
|
|
||||||
Set<Integer> codePoints = new HashSet<>();
|
|
||||||
for (CmapSubtable cMap : cMaps) {
|
|
||||||
for (int codepoint = Character.MIN_CODE_POINT; codepoint <= Character.MAX_CODE_POINT; codepoint++) {
|
|
||||||
int glyphId = cMap.getGlyphId(codepoint);
|
|
||||||
if (glyphId != 0) {
|
|
||||||
codePoints.add(codepoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int skippedCodePoint : skippCodePoints) {
|
|
||||||
codePoints.remove(skippedCodePoint);
|
|
||||||
}
|
|
||||||
for (int codePoint : codePoints) {
|
|
||||||
float advanceWidth = ttf.getWidth(Character.toString(codePoint));
|
|
||||||
char[] text = Character.toChars(codePoint);
|
|
||||||
yml.set(CharacterUtils.char2Unicode(text), ((advanceWidth) / ttf.getUnitsPerEm()) * size);
|
|
||||||
}
|
|
||||||
ttf.close();
|
|
||||||
yml.save(ttfCache);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registerCharacterFontData(id, ttfCache, (properties) -> {
|
registerCharacterFontData(id, ttfCache, (properties) -> {
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ tasks {
|
|||||||
relocate("com.github.benmanes.caffeine", "net.momirealms.customnameplates.libraries.caffeine")
|
relocate("com.github.benmanes.caffeine", "net.momirealms.customnameplates.libraries.caffeine")
|
||||||
relocate("net.objecthunter.exp4j", "net.momirealms.customnameplates.libraries.exp4j")
|
relocate("net.objecthunter.exp4j", "net.momirealms.customnameplates.libraries.exp4j")
|
||||||
relocate("redis.clients.jedis", "net.momirealms.customnameplates.libraries.jedis")
|
relocate("redis.clients.jedis", "net.momirealms.customnameplates.libraries.jedis")
|
||||||
relocate("org.apache.fontbox", "net.momirealms.customnameplates.libraries.fontbox")
|
|
||||||
relocate("org.apache.pdfbox", "net.momirealms.customnameplates.libraries.pdfbox")
|
|
||||||
relocate("org.apache.commons.io", "net.momirealms.customnameplates.libraries.commons.io")
|
relocate("org.apache.commons.io", "net.momirealms.customnameplates.libraries.commons.io")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ public class BukkitCustomNameplates extends CustomNameplates implements Listener
|
|||||||
Dependency.H2_DRIVER,
|
Dependency.H2_DRIVER,
|
||||||
Dependency.MONGODB_DRIVER_CORE, Dependency.MONGODB_DRIVER_SYNC, Dependency.MONGODB_DRIVER_BSON,
|
Dependency.MONGODB_DRIVER_CORE, Dependency.MONGODB_DRIVER_SYNC, Dependency.MONGODB_DRIVER_BSON,
|
||||||
Dependency.HIKARI_CP,
|
Dependency.HIKARI_CP,
|
||||||
Dependency.FONT_BOX, Dependency.PDF_BOX,
|
|
||||||
Dependency.BYTE_BUDDY,
|
Dependency.BYTE_BUDDY,
|
||||||
Dependency.COMMONS_IO
|
Dependency.COMMONS_IO
|
||||||
)
|
)
|
||||||
@@ -204,21 +203,21 @@ public class BukkitCustomNameplates extends CustomNameplates implements Listener
|
|||||||
if (!this.loaded) return;
|
if (!this.loaded) return;
|
||||||
if (this.scheduledMainTask != null) this.scheduledMainTask.cancel();
|
if (this.scheduledMainTask != null) this.scheduledMainTask.cancel();
|
||||||
|
|
||||||
this.configManager.disable();
|
if (configManager != null) this.configManager.disable();
|
||||||
this.actionBarManager.disable();
|
if (actionBarManager != null) this.actionBarManager.disable();
|
||||||
this.bossBarManager.disable();
|
if (bossBarManager != null) this.bossBarManager.disable();
|
||||||
this.unlimitedTagManager.disable();
|
if (unlimitedTagManager != null) this.unlimitedTagManager.disable();
|
||||||
this.advanceManager.disable();
|
if (advanceManager != null) this.advanceManager.disable();
|
||||||
this.backgroundManager.disable();
|
if (backgroundManager != null) this.backgroundManager.disable();
|
||||||
this.requirementManager.disable();
|
if (requirementManager != null) this.requirementManager.disable();
|
||||||
this.placeholderManager.disable();
|
if (placeholderManager != null) this.placeholderManager.disable();
|
||||||
this.storageManager.disable();
|
if (storageManager != null) this.storageManager.disable();
|
||||||
this.bubbleManager.disable();
|
if (bubbleManager != null) this.bubbleManager.disable();
|
||||||
this.nameplateManager.disable();
|
if (nameplateManager != null) this.nameplateManager.disable();
|
||||||
this.imageManager.disable();
|
if (imageManager != null) this.imageManager.disable();
|
||||||
this.chatManager.disable();
|
if (chatManager != null) this.chatManager.disable();
|
||||||
|
|
||||||
this.commandManager.unregisterFeatures();
|
if (commandManager != null) this.commandManager.unregisterFeatures();
|
||||||
this.joinQuitListeners.clear();
|
this.joinQuitListeners.clear();
|
||||||
HandlerList.unregisterAll(this);
|
HandlerList.unregisterAll(this);
|
||||||
|
|
||||||
|
|||||||
@@ -269,21 +269,6 @@ public enum Dependency {
|
|||||||
"maven",
|
"maven",
|
||||||
"slf4j"
|
"slf4j"
|
||||||
),
|
),
|
||||||
FONT_BOX(
|
|
||||||
"org{}apache{}pdfbox",
|
|
||||||
"fontbox",
|
|
||||||
"maven",
|
|
||||||
"fontbox",
|
|
||||||
Relocation.of("fontbox", "org{}apache{}fontbox"),
|
|
||||||
Relocation.of("pdfbox", "org{}apache{}pdfbox")
|
|
||||||
),
|
|
||||||
PDF_BOX(
|
|
||||||
"org{}apache{}pdfbox",
|
|
||||||
"pdfbox-io",
|
|
||||||
"maven",
|
|
||||||
"pdfbox-io",
|
|
||||||
Relocation.of("pdfbox", "org{}apache{}pdfbox")
|
|
||||||
),
|
|
||||||
BYTE_BUDDY(
|
BYTE_BUDDY(
|
||||||
"net{}bytebuddy",
|
"net{}bytebuddy",
|
||||||
"byte-buddy",
|
"byte-buddy",
|
||||||
|
|||||||
@@ -25,7 +25,5 @@ commons-pool=${commons_pool_version}
|
|||||||
jedis=${jedis_version}
|
jedis=${jedis_version}
|
||||||
h2-driver=${h2_driver_version}
|
h2-driver=${h2_driver_version}
|
||||||
sqlite-driver=${sqlite_driver_version}
|
sqlite-driver=${sqlite_driver_version}
|
||||||
fontbox=${fontbox_version}
|
|
||||||
pdfbox-io=${pdfbox_io_version}
|
|
||||||
byte-buddy=${byte_buddy_version}
|
byte-buddy=${byte_buddy_version}
|
||||||
commons-io=${commons_io_version}
|
commons-io=${commons_io_version}
|
||||||
@@ -39,8 +39,6 @@ exp4j_version=0.4.8
|
|||||||
placeholder_api_version=2.11.6
|
placeholder_api_version=2.11.6
|
||||||
vault_version=1.7
|
vault_version=1.7
|
||||||
guava_version=33.2.0-jre
|
guava_version=33.2.0-jre
|
||||||
fontbox_version=3.0.3
|
|
||||||
pdfbox_io_version=3.0.3
|
|
||||||
commons_io_version=2.17.0
|
commons_io_version=2.17.0
|
||||||
|
|
||||||
# Proxy settings
|
# Proxy settings
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
jdk:
|
before_install:
|
||||||
- openjdk17
|
- sdk install java 17.0.11-oracle
|
||||||
|
- sdk install java 21.0.3-oracle
|
||||||
|
- sdk use java 17.0.11-oracle
|
||||||
Reference in New Issue
Block a user