feat: removed Metrics, updated loc files, enabled skulls again in GUI
This commit is contained in:
parent
3440f1fad1
commit
a1919caa2a
7 changed files with 79 additions and 28 deletions
|
@ -1,3 +1,7 @@
|
|||
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
|
||||
import io.papermc.paperweight.util.path
|
||||
import xyz.jpenilla.runtask.RunExtension
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.gradleup.shadow") version "8.3.2"
|
||||
|
@ -45,16 +49,17 @@ dependencies {
|
|||
compileOnly("me.clip:placeholderapi:2.11.5")
|
||||
compileOnly("net.kyori:adventure-api:4.17.0")
|
||||
|
||||
implementation("xyz.xenondevs.invui:invui:1.39")
|
||||
implementation("net.wesjd:anvilgui:1.10.2-SNAPSHOT")
|
||||
implementation("xyz.xenondevs.invui:invui-core:1.41")
|
||||
implementation("xyz.xenondevs.invui:inventory-access-r21:1.41")
|
||||
|
||||
implementation("net.wesjd:anvilgui:1.10.3-SNAPSHOT")
|
||||
implementation("com.github.jsixface:yamlconfig:1.2")
|
||||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.1")
|
||||
implementation("com.fasterxml.jackson.core:jackson-core:2.18.1")
|
||||
implementation("com.mysql:mysql-connector-j:8.2.0")
|
||||
implementation("org.mariadb.jdbc:mariadb-java-client:3.3.1")
|
||||
implementation("redis.clients:jedis:5.1.2")
|
||||
implementation("com.mysql:mysql-connector-j:9.1.0")
|
||||
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.0")
|
||||
implementation("redis.clients:jedis:5.2.0")
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
implementation("org.bstats:bstats-bukkit:3.0.2")
|
||||
|
||||
testImplementation("com.github.MockBukkit:MockBukkit:v3.133.2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
|
||||
|
@ -62,7 +67,12 @@ dependencies {
|
|||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
||||
}
|
||||
|
||||
paperweight {
|
||||
reobfArtifactConfiguration = ReobfArtifactConfiguration.REOBF_PRODUCTION
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
processResources {
|
||||
from("src/main/resources")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
@ -72,12 +82,6 @@ tasks {
|
|||
}
|
||||
|
||||
shadowJar {
|
||||
// NAMING
|
||||
archiveBaseName.set("nicko")
|
||||
archiveVersion.set(version.toString())
|
||||
archiveAppendix.set("")
|
||||
archiveClassifier.set("")
|
||||
|
||||
// RELOCATIONS
|
||||
relocate("xyz.xenondevs", "xyz.ineanto.nicko.libs.invui")
|
||||
relocate("me.clip", "xyz.ineanto.nicko.libs.placeholderapi")
|
||||
|
@ -113,10 +117,30 @@ tasks {
|
|||
exclude(dependency("net.wesjd:.*"))
|
||||
exclude(dependency("org.bstats:.*"))
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes["paperweight-mappings-namespace"] = "spigot"
|
||||
}
|
||||
}
|
||||
|
||||
runServer {
|
||||
dependsOn(shadowJar)
|
||||
dependsOn(reobfJar)
|
||||
|
||||
|
||||
/**
|
||||
* https://github.com/jpenilla/run-task/issues/56
|
||||
*
|
||||
* jpenilla:
|
||||
* "On 1.20.5+ it makes no sense to waste time obfuscating the jar in development
|
||||
* just for it to be immediately deobfuscated.
|
||||
* If you have an edge case setup where this makes sense somehow,
|
||||
* you can disable plugin jar detection and configure the plugin jars collection yourself."
|
||||
*
|
||||
* Well, Nicko is an edge case.
|
||||
* AnvilGUI and InvUI are still using Spigot Mappings,
|
||||
* and I'm stuck using them until they push a major, breaking update.
|
||||
*/
|
||||
args("-add-plugin=${reobfJar.get().outputJar.path.toAbsolutePath()}")
|
||||
|
||||
downloadPlugins {
|
||||
url("https://download.luckperms.net/1554/bukkit/loader/LuckPerms-Bukkit-5.4.139.jar")
|
||||
|
@ -130,4 +154,8 @@ tasks {
|
|||
|
||||
minecraftVersion("1.21.3")
|
||||
}
|
||||
}
|
||||
|
||||
extensions.configure<RunExtension> {
|
||||
disablePluginJarDetection()
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package xyz.ineanto.nicko;
|
||||
|
||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
|
@ -40,7 +39,6 @@ public class Nicko extends JavaPlugin {
|
|||
private CustomLanguage customLanguage;
|
||||
private PlayerNameStore nameStore;
|
||||
private RandomNameFetcher nameFetcher;
|
||||
private Metrics metrics;
|
||||
|
||||
public Nicko() {
|
||||
this.unitTesting = false;
|
||||
|
@ -66,7 +64,7 @@ public class Nicko extends JavaPlugin {
|
|||
|
||||
if (!MinecraftVersion.TRAILS_AND_TAILS.atOrAbove()) {
|
||||
getLogger().severe("This version (" + MinecraftVersion.getCurrentVersion().getVersion() + ") is not supported by Nicko!");
|
||||
getLogger().severe("As of version 1.2.0, Nicko only supports the latest Minecraft versions. (Currently 1.21.3)");
|
||||
getLogger().severe("As of version 1.2.0, Nicko only supports the latest Minecraft version. (Currently 1.21.3)");
|
||||
dataStore.getStorage().setError(true);
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
@ -131,7 +129,6 @@ public class Nicko extends JavaPlugin {
|
|||
|
||||
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new PlayerQuitListener(), this);
|
||||
metrics = new Metrics(this, 20483);
|
||||
}
|
||||
|
||||
getLogger().info("Nicko has been enabled.");
|
||||
|
@ -150,7 +147,6 @@ public class Nicko extends JavaPlugin {
|
|||
|
||||
if (!unitTesting) {
|
||||
nameStore.clearStoredNames();
|
||||
metrics.shutdown();
|
||||
}
|
||||
getLogger().info("Nicko (Bukkit) has been disabled.");
|
||||
}
|
||||
|
|
|
@ -27,16 +27,17 @@ public class AppearanceManager {
|
|||
public ActionResult reset() {
|
||||
final NickoProfile profile = getNickoProfile();
|
||||
final String defaultName = nameStore.getStoredName(player);
|
||||
|
||||
profile.setName(defaultName);
|
||||
profile.setSkin(defaultName);
|
||||
dataStore.getCache().cache(player.getUniqueId(), profile);
|
||||
|
||||
final ActionResult result = update(true, true);
|
||||
if (!result.isError()) {
|
||||
profile.setName(null);
|
||||
profile.setSkin(null);
|
||||
dataStore.getCache().cache(player.getUniqueId(), profile);
|
||||
}
|
||||
|
||||
profile.setName(null);
|
||||
profile.setSkin(null);
|
||||
dataStore.getCache().cache(player.getUniqueId(), profile);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,14 @@ import org.jetbrains.annotations.NotNull;
|
|||
import xyz.ineanto.nicko.gui.CacheManagementGUI;
|
||||
import xyz.ineanto.nicko.language.LanguageKey;
|
||||
import xyz.ineanto.nicko.language.PlayerLanguage;
|
||||
import xyz.xenondevs.invui.item.builder.AbstractItemBuilder;
|
||||
import xyz.xenondevs.invui.item.builder.ItemBuilder;
|
||||
import xyz.xenondevs.invui.item.builder.SkullBuilder;
|
||||
import xyz.xenondevs.invui.item.impl.AsyncItem;
|
||||
import xyz.xenondevs.invui.item.impl.SuppliedItem;
|
||||
import xyz.xenondevs.invui.util.MojangApiUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ManageCacheItem extends AsyncItem {
|
||||
public ManageCacheItem(PlayerLanguage playerLanguage) {
|
||||
|
@ -19,7 +24,14 @@ public class ManageCacheItem extends AsyncItem {
|
|||
return playerLanguage.translateItem(builder, LanguageKey.GUI.LOADING);
|
||||
}, (click -> true)).getItemProvider(),
|
||||
() -> {
|
||||
final ItemBuilder builder = new ItemBuilder(Material.PLAYER_HEAD);
|
||||
AbstractItemBuilder<?> builder;
|
||||
|
||||
try {
|
||||
builder = new SkullBuilder("Notch");
|
||||
} catch (MojangApiUtils.MojangApiException | IOException e) {
|
||||
builder = new ItemBuilder(Material.PLAYER_HEAD);
|
||||
}
|
||||
|
||||
return playerLanguage.translateItem(builder, LanguageKey.GUI.Admin.MANAGE_CACHE);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,19 +6,33 @@ import org.bukkit.event.inventory.ClickType;
|
|||
import xyz.ineanto.nicko.anvil.AnvilManager;
|
||||
import xyz.ineanto.nicko.language.LanguageKey;
|
||||
import xyz.ineanto.nicko.language.PlayerLanguage;
|
||||
import xyz.xenondevs.invui.item.builder.AbstractItemBuilder;
|
||||
import xyz.xenondevs.invui.item.builder.ItemBuilder;
|
||||
import xyz.xenondevs.invui.item.builder.SkullBuilder;
|
||||
import xyz.xenondevs.invui.item.impl.SuppliedItem;
|
||||
import xyz.xenondevs.invui.util.MojangApiUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ChangeSkinItem {
|
||||
private final PlayerLanguage playerLanguage;
|
||||
private final Player player;
|
||||
|
||||
public ChangeSkinItem(Player player) {
|
||||
this.playerLanguage = new PlayerLanguage(player);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public SuppliedItem get() {
|
||||
return new SuppliedItem(() -> {
|
||||
final ItemBuilder builder = new ItemBuilder(Material.PLAYER_HEAD);
|
||||
AbstractItemBuilder<?> builder;
|
||||
|
||||
try {
|
||||
builder = new SkullBuilder(player.getName());
|
||||
} catch (MojangApiUtils.MojangApiException | IOException e) {
|
||||
builder = new ItemBuilder(Material.PLAYER_HEAD);
|
||||
}
|
||||
|
||||
return playerLanguage.translateItem(builder, LanguageKey.GUI.Home.CHANGE_SKIN);
|
||||
}, click -> {
|
||||
final ClickType clickType = click.getClickType();
|
||||
|
|
|
@ -20,10 +20,10 @@ event:
|
|||
appearance:
|
||||
set:
|
||||
error: "<gray>Wasn''t able to apply your disguise! ({0})</gray>"
|
||||
ok: "<gray>You're now disguised.</gray>"
|
||||
ok: "<gray>You''re now disguised.</gray>"
|
||||
restore:
|
||||
error: "<gray>Wasn''t able to apply the previous disguise! ({0})</gray>"
|
||||
ok: "<gray>Disguise restored from last time.</gray>"
|
||||
ok: "<gray>Previous disguise restored.</gray>"
|
||||
remove:
|
||||
error: "<gray>Wasn''t able to remove your disguise!.</gray>"
|
||||
missing: "<gray>You''re not currently disguised.</gray>"
|
||||
|
|
|
@ -3,7 +3,7 @@ main: xyz.ineanto.nicko.Nicko
|
|||
version: ${version}
|
||||
author: Ineanto
|
||||
description: "The feature packed, next generation disguise plugin for Minecraft."
|
||||
api-version: 1.20
|
||||
api-version: 1.21
|
||||
softdepend: [ PlaceholderAPI ]
|
||||
depend:
|
||||
- ProtocolLib
|
||||
|
|
Loading…
Reference in a new issue