feat: start working on random skin
This commit is contained in:
parent
8a544d1ba5
commit
fdada8f44f
15 changed files with 636 additions and 59 deletions
|
@ -2,10 +2,11 @@ plugins {
|
||||||
id("java")
|
id("java")
|
||||||
id("io.github.goooler.shadow") version "8.1.2"
|
id("io.github.goooler.shadow") version "8.1.2"
|
||||||
id("xyz.jpenilla.run-paper") version "2.2.2"
|
id("xyz.jpenilla.run-paper") version "2.2.2"
|
||||||
|
id("jvm-test-suite")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.ineanto"
|
group = "xyz.ineanto"
|
||||||
version = "1.0.8-RC1"
|
version = "1.1.0-RC1"
|
||||||
|
|
||||||
val shadowImplementation: Configuration by configurations.creating
|
val shadowImplementation: Configuration by configurations.creating
|
||||||
configurations["implementation"].extendsFrom(shadowImplementation)
|
configurations["implementation"].extendsFrom(shadowImplementation)
|
||||||
|
@ -145,3 +146,23 @@ tasks.named("jar").configure {
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For when Gradle 9.0 releases.
|
||||||
|
/**
|
||||||
|
testing {
|
||||||
|
suites {
|
||||||
|
val test by getting(JvmTestSuite::class) {
|
||||||
|
targets {
|
||||||
|
useJUnitJupiter()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(project())
|
||||||
|
implementation("com.github.seeseemelk:MockBukkit-v1.20:3.58.0")
|
||||||
|
implementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
|
||||||
|
implementation("org.junit.jupiter:junit-jupiter-engine:5.10.1")
|
||||||
|
implementation("org.junit.jupiter:junit-jupiter:5.10.1")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} */
|
|
@ -0,0 +1,36 @@
|
||||||
|
package xyz.ineanto.nicko.appearance.random;
|
||||||
|
|
||||||
|
import xyz.ineanto.nicko.NickoBukkit;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class RandomNameFetcher {
|
||||||
|
private final NickoBukkit instance;
|
||||||
|
|
||||||
|
public RandomNameFetcher(NickoBukkit instance) {
|
||||||
|
this.instance = instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRandomUsername() {
|
||||||
|
final InputStream resource = instance.getResource("names.csv");
|
||||||
|
final List<List<String>> records = new ArrayList<>();
|
||||||
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource))) {
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
String[] values = line.split("\n");
|
||||||
|
records.add(Arrays.asList(values));
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return records.get(new Random().nextInt(records.size() -1)).get(0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,12 @@
|
||||||
package xyz.ineanto.nicko.gui;
|
package xyz.ineanto.nicko.gui;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import xyz.ineanto.nicko.gui.items.ItemDefaults;
|
|
||||||
import xyz.ineanto.nicko.gui.items.common.GoBackItem;
|
import xyz.ineanto.nicko.gui.items.common.GoBackItem;
|
||||||
import xyz.ineanto.nicko.gui.items.settings.BungeeCordCyclingItem;
|
|
||||||
import xyz.ineanto.nicko.gui.items.settings.LanguageCyclingItem;
|
import xyz.ineanto.nicko.gui.items.settings.LanguageCyclingItem;
|
||||||
|
import xyz.ineanto.nicko.gui.items.settings.RandomSkinCyclingItem;
|
||||||
import xyz.ineanto.nicko.i18n.I18N;
|
import xyz.ineanto.nicko.i18n.I18N;
|
||||||
import xyz.ineanto.nicko.i18n.I18NDict;
|
import xyz.ineanto.nicko.i18n.I18NDict;
|
||||||
import xyz.xenondevs.invui.gui.Gui;
|
import xyz.xenondevs.invui.gui.Gui;
|
||||||
import xyz.xenondevs.invui.item.impl.SimpleItem;
|
|
||||||
import xyz.xenondevs.invui.window.Window;
|
import xyz.xenondevs.invui.window.Window;
|
||||||
|
|
||||||
public class SettingsGUI {
|
public class SettingsGUI {
|
||||||
|
@ -19,26 +17,23 @@ public class SettingsGUI {
|
||||||
public SettingsGUI(Player player) {
|
public SettingsGUI(Player player) {
|
||||||
final String[] dynamicStructure = new String[]{
|
final String[] dynamicStructure = new String[]{
|
||||||
"# # # # # # # # #",
|
"# # # # # # # # #",
|
||||||
"# # # L T U # # #",
|
"# # # L # R # # #",
|
||||||
"B # # # # # # # #"
|
"B # # # # # # # #"
|
||||||
};
|
};
|
||||||
|
|
||||||
dynamicStructure[1] = dynamicStructure[1].replace("T", "U");
|
|
||||||
|
|
||||||
final I18N i18n = new I18N(player);
|
final I18N i18n = new I18N(player);
|
||||||
this.title = i18n.translatePrefixless(I18NDict.GUI.Titles.SETTINGS);
|
this.title = i18n.translatePrefixless(I18NDict.GUI.Titles.SETTINGS);
|
||||||
|
|
||||||
final HomeGUI parent = new HomeGUI(player);
|
final HomeGUI parent = new HomeGUI(player);
|
||||||
final LanguageCyclingItem languageItem = new LanguageCyclingItem(player);
|
final LanguageCyclingItem languageItem = new LanguageCyclingItem(player);
|
||||||
final BungeeCordCyclingItem bungeeCordItem = new BungeeCordCyclingItem(player);
|
final RandomSkinCyclingItem skinItem = new RandomSkinCyclingItem(player);
|
||||||
final GoBackItem backItem = new GoBackItem(player);
|
final GoBackItem backItem = new GoBackItem(player);
|
||||||
|
|
||||||
this.gui = Gui.normal()
|
this.gui = Gui.normal()
|
||||||
.setStructure(dynamicStructure)
|
.setStructure(dynamicStructure)
|
||||||
.addIngredient('B', backItem.get(parent.getGUI(), parent.getTitle()))
|
.addIngredient('B', backItem.get(parent.getGUI(), parent.getTitle()))
|
||||||
.addIngredient('L', languageItem.get())
|
.addIngredient('L', languageItem.get())
|
||||||
.addIngredient('U', new SimpleItem(ItemDefaults.getUnavailableItem(i18n)))
|
.addIngredient('R', skinItem.get())
|
||||||
.addIngredient('T', bungeeCordItem.get())
|
|
||||||
.build();
|
.build();
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class LanguageCyclingItem {
|
||||||
final NickoProfile nickoProfile = profile.get();
|
final NickoProfile nickoProfile = profile.get();
|
||||||
int localeOrdinal = nickoProfile.getLocale().ordinal();
|
int localeOrdinal = nickoProfile.getLocale().ordinal();
|
||||||
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
||||||
nickoProfile.setLocale(Locale.values()[integer]);
|
|
||||||
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
||||||
|
nickoProfile.setLocale(Locale.values()[integer]);
|
||||||
player.getOpenInventory().close();
|
player.getOpenInventory().close();
|
||||||
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
|
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
|
||||||
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));
|
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package xyz.ineanto.nicko.gui.items.settings;
|
package xyz.ineanto.nicko.gui.items.settings;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import xyz.ineanto.nicko.NickoBukkit;
|
import xyz.ineanto.nicko.NickoBukkit;
|
||||||
|
@ -10,19 +9,19 @@ import xyz.ineanto.nicko.i18n.ItemTranslation;
|
||||||
import xyz.ineanto.nicko.profile.NickoProfile;
|
import xyz.ineanto.nicko.profile.NickoProfile;
|
||||||
import xyz.ineanto.nicko.storage.PlayerDataStore;
|
import xyz.ineanto.nicko.storage.PlayerDataStore;
|
||||||
import xyz.xenondevs.invui.item.ItemProvider;
|
import xyz.xenondevs.invui.item.ItemProvider;
|
||||||
import xyz.xenondevs.invui.item.builder.ItemBuilder;
|
import xyz.xenondevs.invui.item.builder.SkullBuilder;
|
||||||
import xyz.xenondevs.invui.item.impl.AbstractItem;
|
import xyz.xenondevs.invui.item.impl.AbstractItem;
|
||||||
import xyz.xenondevs.invui.item.impl.CycleItem;
|
import xyz.xenondevs.invui.item.impl.CycleItem;
|
||||||
import xyz.xenondevs.invui.item.impl.SimpleItem;
|
import xyz.xenondevs.invui.item.impl.SimpleItem;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class BungeeCordCyclingItem {
|
public class RandomSkinCyclingItem {
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final I18N i18n;
|
|
||||||
private final ItemProvider[] providers;
|
private final ItemProvider[] providers;
|
||||||
|
private final I18N i18n;
|
||||||
|
|
||||||
public BungeeCordCyclingItem(Player player) {
|
public RandomSkinCyclingItem(Player player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.i18n = new I18N(player);
|
this.i18n = new I18N(player);
|
||||||
this.providers = new ItemProvider[]{
|
this.providers = new ItemProvider[]{
|
||||||
|
@ -36,33 +35,30 @@ public class BungeeCordCyclingItem {
|
||||||
final Optional<NickoProfile> profile = dataStore.getData(player.getUniqueId());
|
final Optional<NickoProfile> profile = dataStore.getData(player.getUniqueId());
|
||||||
if (profile.isPresent()) {
|
if (profile.isPresent()) {
|
||||||
final NickoProfile nickoProfile = profile.get();
|
final NickoProfile nickoProfile = profile.get();
|
||||||
int startingState = nickoProfile.isBungeecordTransfer() ? 0 : 1;
|
int localeOrdinal = nickoProfile.isRandomSkin() ? 0 : 1;
|
||||||
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
return CycleItem.withStateChangeHandler((observer, integer) -> {
|
||||||
nickoProfile.setBungeecordTransfer(integer != 1);
|
|
||||||
dataStore.updateCache(player.getUniqueId(), nickoProfile);
|
|
||||||
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
|
||||||
}, startingState, providers);
|
nickoProfile.setRandomSkin(integer != 1);
|
||||||
|
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
|
||||||
|
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));
|
||||||
|
player.getOpenInventory().close();
|
||||||
|
}
|
||||||
|
}, localeOrdinal, providers);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SimpleItem(ItemProvider.EMPTY);
|
return new SimpleItem(ItemProvider.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemProvider getItemProviderForValue(boolean ignored) {
|
private ItemProvider getItemProviderForValue(boolean enabled) {
|
||||||
final ItemBuilder builder = new ItemBuilder(Material.COMPASS);
|
final SkullBuilder.HeadTexture texture = new SkullBuilder.HeadTexture("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzgzMTEzOGMyMDYxMWQzMDJjNDIzZmEzMjM3MWE3NDNkMTc0MzdhMTg5NzNjMzUxOTczNDQ3MGE3YWJiNCJ9fX0=");
|
||||||
final ItemTranslation translation = i18n.fetchTranslation(I18NDict.GUI.Settings.BUNGEECORD);
|
final SkullBuilder builder = new SkullBuilder(texture);
|
||||||
|
final ItemTranslation translation = i18n.fetchTranslation(I18NDict.GUI.Settings.RANDOM_SKIN,
|
||||||
|
(enabled ? "§7> §cDisabled" : "§6§l> §c§lDisabled"),
|
||||||
|
(enabled ? "§6§l> §a§lEnabled" : "§7> §aEnabled")
|
||||||
|
);
|
||||||
|
|
||||||
builder.setDisplayName(translation.name());
|
builder.setDisplayName(translation.name());
|
||||||
translation.lore().forEach(builder::addLoreLines);
|
translation.lore().forEach(builder::addLoreLines);
|
||||||
/*
|
|
||||||
if (enabled) {
|
|
||||||
builder.addLoreLines("§7> §cDisabled");
|
|
||||||
builder.addLoreLines("§6§l> §a§lEnabled");
|
|
||||||
} else {
|
|
||||||
builder.addLoreLines("§6§l> §c§lDisabled");
|
|
||||||
builder.addLoreLines("§7> §aEnabled");
|
|
||||||
}
|
|
||||||
builder.addLoreLines("§7§oCycle through the values by", "§7§oleft and right clicking.");
|
|
||||||
*/
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -112,7 +112,7 @@ public class I18NDict {
|
||||||
private static final String SETTINGS_KEY = GUI_KEY + "settings.";
|
private static final String SETTINGS_KEY = GUI_KEY + "settings.";
|
||||||
|
|
||||||
public static final String LANGUAGE = SETTINGS_KEY + "language";
|
public static final String LANGUAGE = SETTINGS_KEY + "language";
|
||||||
public static final String BUNGEECORD = SETTINGS_KEY + "bungeecord";
|
public static final String RANDOM_SKIN = SETTINGS_KEY + "random_skin";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Admin {
|
public static class Admin {
|
||||||
|
|
|
@ -42,11 +42,11 @@ public class NickoExpansion extends PlaceholderExpansion {
|
||||||
if (player == null) return null;
|
if (player == null) return null;
|
||||||
|
|
||||||
String name, skin, locale;
|
String name, skin, locale;
|
||||||
boolean bungeecord;
|
boolean randomSkin;
|
||||||
|
|
||||||
name = skin = player.getName();
|
name = skin = player.getName();
|
||||||
locale = "N/A";
|
locale = "N/A";
|
||||||
bungeecord = true;
|
randomSkin = false;
|
||||||
|
|
||||||
final Optional<NickoProfile> optionalProfile = instance.getDataStore().getData(player.getUniqueId());
|
final Optional<NickoProfile> optionalProfile = instance.getDataStore().getData(player.getUniqueId());
|
||||||
if (optionalProfile.isPresent()) {
|
if (optionalProfile.isPresent()) {
|
||||||
|
@ -61,14 +61,14 @@ public class NickoExpansion extends PlaceholderExpansion {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
locale = profile.getLocale().getName();
|
locale = profile.getLocale().getName();
|
||||||
bungeecord = profile.isBungeecordTransfer();
|
randomSkin = profile.isRandomSkin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (params) {
|
return switch (params) {
|
||||||
case "name" -> name;
|
case "name" -> name;
|
||||||
case "skin" -> skin;
|
case "skin" -> skin;
|
||||||
case "locale" -> locale;
|
case "locale" -> locale;
|
||||||
case "bungeecord" -> String.valueOf(bungeecord);
|
case "bungeecord" -> String.valueOf(randomSkin);
|
||||||
default -> null;
|
default -> null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,13 @@ public class NickoProfile implements Cloneable {
|
||||||
private String name;
|
private String name;
|
||||||
private String skin;
|
private String skin;
|
||||||
private Locale locale;
|
private Locale locale;
|
||||||
private boolean bungeecordTransfer;
|
private boolean randomSkin;
|
||||||
|
|
||||||
public NickoProfile(String name, String skin, Locale locale, boolean bungeecordTransfer) {
|
public NickoProfile(String name, String skin, Locale locale, boolean randomSkin) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.skin = skin;
|
this.skin = skin;
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
this.bungeecordTransfer = bungeecordTransfer;
|
this.randomSkin = randomSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<NickoProfile> get(Player player) {
|
public static Optional<NickoProfile> get(Player player) {
|
||||||
|
@ -60,12 +60,12 @@ public class NickoProfile implements Cloneable {
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBungeecordTransfer() {
|
public boolean isRandomSkin() {
|
||||||
return bungeecordTransfer;
|
return randomSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBungeecordTransfer(boolean bungeecordTransfer) {
|
public void setRandomSkin(boolean randomSkin) {
|
||||||
this.bungeecordTransfer = bungeecordTransfer;
|
this.randomSkin = randomSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,7 +74,7 @@ public class NickoProfile implements Cloneable {
|
||||||
"name='" + name + '\'' +
|
"name='" + name + '\'' +
|
||||||
", skin='" + skin + '\'' +
|
", skin='" + skin + '\'' +
|
||||||
", locale=" + locale +
|
", locale=" + locale +
|
||||||
", bungeecordTransfer=" + bungeecordTransfer +
|
", randomSkin=" + randomSkin +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class MariaDBStorage extends Storage {
|
||||||
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
statement.setString(4, profile.getLocale().getCode());
|
statement.setString(4, profile.getLocale().getCode());
|
||||||
statement.setBoolean(5, profile.isBungeecordTransfer());
|
statement.setBoolean(5, profile.isRandomSkin());
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class MariaDBStorage extends Storage {
|
||||||
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
statement.setString(3, profile.getLocale().getCode());
|
statement.setString(3, profile.getLocale().getCode());
|
||||||
statement.setBoolean(4, profile.isBungeecordTransfer());
|
statement.setBoolean(4, profile.isRandomSkin());
|
||||||
statement.setString(5, uuid.toString());
|
statement.setString(5, uuid.toString());
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class MySQLStorage extends Storage {
|
||||||
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
statement.setString(4, profile.getLocale().getCode());
|
statement.setString(4, profile.getLocale().getCode());
|
||||||
statement.setBoolean(5, profile.isBungeecordTransfer());
|
statement.setBoolean(5, profile.isRandomSkin());
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class MySQLStorage extends Storage {
|
||||||
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
statement.setString(3, profile.getLocale().getCode());
|
statement.setString(3, profile.getLocale().getCode());
|
||||||
statement.setBoolean(4, profile.isBungeecordTransfer());
|
statement.setBoolean(4, profile.isRandomSkin());
|
||||||
statement.setString(5, uuid.toString());
|
statement.setString(5, uuid.toString());
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,8 +133,10 @@ gui:
|
||||||
lore:
|
lore:
|
||||||
- "§7§oGet through the values"
|
- "§7§oGet through the values"
|
||||||
- "§7§oby left or right clicking."
|
- "§7§oby left or right clicking."
|
||||||
bungeecord:
|
random_skin:
|
||||||
name: "Bungeecord Transfer"
|
name: "Random skin on join"
|
||||||
lore:
|
lore:
|
||||||
|
- "{0}"
|
||||||
|
- "{1}"
|
||||||
- "§7§oGet through the values"
|
- "§7§oGet through the values"
|
||||||
- "§7§oby left or right clicking."
|
- "§7§oby left or right clicking."
|
|
@ -130,8 +130,10 @@ gui:
|
||||||
lore:
|
lore:
|
||||||
- "§7§oParcourez les valeurs"
|
- "§7§oParcourez les valeurs"
|
||||||
- "§7§oavec un clique gauche/droit."
|
- "§7§oavec un clique gauche/droit."
|
||||||
bungeecord:
|
random_skin:
|
||||||
name: "Transfert Bungeecord"
|
name: "Apparence aléatoire à la connexion"
|
||||||
lore:
|
lore:
|
||||||
|
- "{0}"
|
||||||
|
- "{1}"
|
||||||
- "§7§oParcourez les valeurs"
|
- "§7§oParcourez les valeurs"
|
||||||
- "§7§oavec un clique gauche/droit."
|
- "§7§oavec un clique gauche/droit."
|
490
src/main/resources/names.csv
Normal file
490
src/main/resources/names.csv
Normal file
|
@ -0,0 +1,490 @@
|
||||||
|
w4nderlost
|
||||||
|
TooParanoids
|
||||||
|
Der_OG_31er
|
||||||
|
9xxDaRkShAdOwxx9
|
||||||
|
giiiaan_
|
||||||
|
Jqstinnn
|
||||||
|
Tillysboy92
|
||||||
|
AlwaysCello
|
||||||
|
SyndrexG0D
|
||||||
|
Peypeycake
|
||||||
|
ThePerjurer
|
||||||
|
Tioe
|
||||||
|
Elternbaum
|
||||||
|
BarkersRover_16
|
||||||
|
pebsso
|
||||||
|
cyrus6950
|
||||||
|
Bigest_guy
|
||||||
|
RV0REU
|
||||||
|
R379
|
||||||
|
Shetell
|
||||||
|
_HEAPASS_
|
||||||
|
Iamaloner21
|
||||||
|
TheFardoxGamerHD
|
||||||
|
Flyboi43
|
||||||
|
Cha0smusik
|
||||||
|
kat00
|
||||||
|
Infreat
|
||||||
|
Crummymoofin
|
||||||
|
MijnVriend
|
||||||
|
momsrightkidney
|
||||||
|
dmacrado
|
||||||
|
Elephantman321
|
||||||
|
ii_hamoudi_YT
|
||||||
|
FaurePavane
|
||||||
|
ambiezzz
|
||||||
|
XD_Bandit695_XD
|
||||||
|
Nabingo
|
||||||
|
Cyl0re
|
||||||
|
ku5
|
||||||
|
SrAragon
|
||||||
|
StarlightDream9
|
||||||
|
CJ5370
|
||||||
|
rainbees
|
||||||
|
KeroTheWolf
|
||||||
|
Andrews9722
|
||||||
|
cursed_Assyrian
|
||||||
|
yamateni
|
||||||
|
ProgramEXE
|
||||||
|
exprso
|
||||||
|
harrypanda
|
||||||
|
LookerMD
|
||||||
|
migykins
|
||||||
|
Wintrous
|
||||||
|
ZzGaBi
|
||||||
|
Flayber
|
||||||
|
Grenixal
|
||||||
|
maeve_wells
|
||||||
|
Creeper10fr
|
||||||
|
10Chairs
|
||||||
|
2525lock
|
||||||
|
Shqipe
|
||||||
|
XenitsuZen
|
||||||
|
Berno17_
|
||||||
|
wolle1313
|
||||||
|
HalfDogHalfCat1
|
||||||
|
NachoGarcia
|
||||||
|
popsicoal
|
||||||
|
NemesiSevil2006
|
||||||
|
AnywayOj
|
||||||
|
Tanko12345
|
||||||
|
Samdweck
|
||||||
|
LYRECODE123
|
||||||
|
Resulten
|
||||||
|
SirBastii
|
||||||
|
Maku056
|
||||||
|
ItzArnizzz
|
||||||
|
Brsh3620
|
||||||
|
Masonita
|
||||||
|
kapplanium
|
||||||
|
shoezo
|
||||||
|
Mansur203
|
||||||
|
Waterboy15217
|
||||||
|
redragonne
|
||||||
|
ghko325
|
||||||
|
HopePVP_tw7
|
||||||
|
xtka
|
||||||
|
NimwenxZ
|
||||||
|
Hiro0408
|
||||||
|
PanderaWz
|
||||||
|
Shesu
|
||||||
|
_Aniste_NY_
|
||||||
|
Besceste
|
||||||
|
3ee3
|
||||||
|
ArcticGalaxy123
|
||||||
|
snooze_mingo
|
||||||
|
LizzyLomnh
|
||||||
|
FaZeChulupa
|
||||||
|
LineZeeK
|
||||||
|
liabilaty
|
||||||
|
BlackSheep1610
|
||||||
|
Simif69
|
||||||
|
Aficionado
|
||||||
|
riekin
|
||||||
|
XLuggas
|
||||||
|
MathExams
|
||||||
|
6fq
|
||||||
|
Marveel
|
||||||
|
lolme51
|
||||||
|
TaioSayUwU
|
||||||
|
Fonklift
|
||||||
|
blvw
|
||||||
|
Po1204
|
||||||
|
Pierre_Rabbit
|
||||||
|
mifimasters
|
||||||
|
MrRidge1
|
||||||
|
arnqen
|
||||||
|
Nick_cage102
|
||||||
|
Geo_9918
|
||||||
|
SSShudder
|
||||||
|
Nicolas_Mom
|
||||||
|
WolfMatrix101
|
||||||
|
frictionless_
|
||||||
|
Gughik
|
||||||
|
gold_dragon_4
|
||||||
|
nealxero
|
||||||
|
ClonedPickle
|
||||||
|
SourWatermelonxX
|
||||||
|
devilunion
|
||||||
|
Daryifuny
|
||||||
|
joaomarcos11
|
||||||
|
Dekeef
|
||||||
|
PadfootTheDog
|
||||||
|
DarkScopez80
|
||||||
|
flowers220
|
||||||
|
Gaiiya
|
||||||
|
The_Yeet_
|
||||||
|
juuuuwu
|
||||||
|
MrMafioz
|
||||||
|
Surpasses
|
||||||
|
TypicalOwen
|
||||||
|
0lober
|
||||||
|
Zerfixy
|
||||||
|
Sunny3803b
|
||||||
|
neostanley
|
||||||
|
Creeper_Kart
|
||||||
|
minestin
|
||||||
|
Goldenfredster
|
||||||
|
Vju
|
||||||
|
MrArchI_YT
|
||||||
|
Casper1709
|
||||||
|
Backiii_
|
||||||
|
DrCreate
|
||||||
|
Nova_Lux1
|
||||||
|
Jayvin_Blanco
|
||||||
|
ShadowMan1770
|
||||||
|
0KOPO40K
|
||||||
|
Silk_Altermann69
|
||||||
|
Alu____
|
||||||
|
Honey_MilkExe112
|
||||||
|
T0XEI
|
||||||
|
CB_13
|
||||||
|
Paragorn
|
||||||
|
HaGiang
|
||||||
|
Shivendra8i
|
||||||
|
Mayflower47
|
||||||
|
Not_Someguy
|
||||||
|
raxx111bg
|
||||||
|
IceyGlaceon
|
||||||
|
grasseffect
|
||||||
|
PoopTNTpvp
|
||||||
|
codecyber
|
||||||
|
Shrumpkin13
|
||||||
|
Shqdown
|
||||||
|
Cmartin82
|
||||||
|
KTCXD_5p0tty
|
||||||
|
rockesalt
|
||||||
|
goldjeong
|
||||||
|
TheRealAKD
|
||||||
|
NamiSwaaan
|
||||||
|
yaaratol
|
||||||
|
Dikiy_Flexer
|
||||||
|
PoLecker24
|
||||||
|
_SakuraTree
|
||||||
|
PikkOgP0rno
|
||||||
|
HawksFang
|
||||||
|
BlueWinterWolf
|
||||||
|
hskmerk
|
||||||
|
gurmaw
|
||||||
|
Lunggor
|
||||||
|
clashfield
|
||||||
|
Zelaste
|
||||||
|
ACommonMouse
|
||||||
|
TJ_Mystery
|
||||||
|
Dizzy3312
|
||||||
|
Raindropsss
|
||||||
|
minecraftxiaoju
|
||||||
|
sachilovebbh
|
||||||
|
Celina_LaZyCxt
|
||||||
|
firered6
|
||||||
|
55000000
|
||||||
|
Illunarnati
|
||||||
|
Jedidiah2003
|
||||||
|
setomz1
|
||||||
|
basically_e
|
||||||
|
TommyGreif02
|
||||||
|
Bongrip42069
|
||||||
|
Coco_Keopi
|
||||||
|
Lt_Colt
|
||||||
|
Kuurotta
|
||||||
|
GqmeKnight
|
||||||
|
WinCo_Foods
|
||||||
|
FKDLZ
|
||||||
|
IanPumpkin
|
||||||
|
tastywtf
|
||||||
|
natedawg0
|
||||||
|
ZQLFenyx
|
||||||
|
GamerMaster110
|
||||||
|
papajobi9
|
||||||
|
Yucaroon
|
||||||
|
Xion_69
|
||||||
|
AirJaw
|
||||||
|
funfun321234
|
||||||
|
khalleesii
|
||||||
|
Pozisch
|
||||||
|
thorso15
|
||||||
|
kyumisoup
|
||||||
|
Leonqrd
|
||||||
|
BmwDreamer
|
||||||
|
TehRos
|
||||||
|
pitplayer69
|
||||||
|
_ve0
|
||||||
|
Miss_Yuka
|
||||||
|
I_am_a_Bucket
|
||||||
|
nicolas_bean
|
||||||
|
xHorizonGC
|
||||||
|
RTX3060_
|
||||||
|
Borec188
|
||||||
|
c8to
|
||||||
|
megan3groCENG
|
||||||
|
ventriloquize
|
||||||
|
galczin
|
||||||
|
Scorch3dEarth3d
|
||||||
|
nightstarLP
|
||||||
|
VittyGam3r
|
||||||
|
GLaDOS__
|
||||||
|
hydrelo
|
||||||
|
JustACarter
|
||||||
|
MikeDropperPlay
|
||||||
|
NorthernWest
|
||||||
|
_Skelesam_
|
||||||
|
ZX_Style
|
||||||
|
Tamas_Boi
|
||||||
|
taylub
|
||||||
|
VyacheslavO_O
|
||||||
|
trippyaubs
|
||||||
|
udtpic
|
||||||
|
Lunarglow
|
||||||
|
Stoolman
|
||||||
|
legendary_meow
|
||||||
|
Loganii
|
||||||
|
CaptainStain56
|
||||||
|
FoofieGeto
|
||||||
|
Judgeavapl
|
||||||
|
OneBigDigger
|
||||||
|
Sorem13
|
||||||
|
Raisonneur
|
||||||
|
IlkoalI
|
||||||
|
Naxa
|
||||||
|
craigbabyonebay
|
||||||
|
NicholasG04
|
||||||
|
UtopianCrisi
|
||||||
|
CalamarPasGenti
|
||||||
|
ryluh_
|
||||||
|
Aceslimz
|
||||||
|
Howardygh99927
|
||||||
|
brandon257
|
||||||
|
MarcoswildHD
|
||||||
|
x_XSkylerX_x
|
||||||
|
Bronco09
|
||||||
|
That_Kookie_
|
||||||
|
Danigtz
|
||||||
|
Ricky_lol
|
||||||
|
999keyt
|
||||||
|
Thilow15
|
||||||
|
Difesito
|
||||||
|
ostehovl
|
||||||
|
isacano_12
|
||||||
|
big_esra
|
||||||
|
secretbaguette
|
||||||
|
MrCommunism
|
||||||
|
Jekube
|
||||||
|
GrandeMaster
|
||||||
|
DrGrip
|
||||||
|
TheArnek
|
||||||
|
JacsMars
|
||||||
|
Lliam14
|
||||||
|
MrGameandWatch84
|
||||||
|
Rinzap
|
||||||
|
XrazzeD
|
||||||
|
ukknown
|
||||||
|
ZohanPrent
|
||||||
|
Naspo
|
||||||
|
Rajem
|
||||||
|
VepiGHG
|
||||||
|
matoureal
|
||||||
|
BrianChen87
|
||||||
|
Jrocky
|
||||||
|
stivo999
|
||||||
|
Des_cole
|
||||||
|
ReqGames
|
||||||
|
Kingja1912
|
||||||
|
issssyy
|
||||||
|
Apache424
|
||||||
|
Nick_Zockt_
|
||||||
|
Mr_Haider_10
|
||||||
|
ValentineBun
|
||||||
|
fedorPro228
|
||||||
|
xTilz
|
||||||
|
blockbuster02k
|
||||||
|
4ck
|
||||||
|
FrostedTree
|
||||||
|
VegasTortoise
|
||||||
|
ZBellaV12121
|
||||||
|
paypales
|
||||||
|
qDread
|
||||||
|
itsRiven
|
||||||
|
i8oreo
|
||||||
|
_kimcream_
|
||||||
|
Phisuss
|
||||||
|
Oscargray
|
||||||
|
Elsiff
|
||||||
|
callofdutydog00
|
||||||
|
BruhTheMoment
|
||||||
|
Pazmaa
|
||||||
|
MythicalOak
|
||||||
|
komuchi33
|
||||||
|
awf4
|
||||||
|
Jacobsaurus21
|
||||||
|
itsjohannaa
|
||||||
|
Jello12
|
||||||
|
Adrien183
|
||||||
|
jajazzywazzy
|
||||||
|
Jorjie22
|
||||||
|
SuperBrawlr5788
|
||||||
|
KaraageV
|
||||||
|
_Hanime_tv
|
||||||
|
Padilhao
|
||||||
|
Tikkas
|
||||||
|
ordinaryducky
|
||||||
|
Mothytix95
|
||||||
|
renopotouwu
|
||||||
|
1000voices
|
||||||
|
niclas05
|
||||||
|
Felipstein
|
||||||
|
DoutorBauer
|
||||||
|
FireballPlaysMC
|
||||||
|
vapelordsheep
|
||||||
|
Aboain
|
||||||
|
ImGrexy
|
||||||
|
Aivokolo
|
||||||
|
SuperAmazing101
|
||||||
|
va75a77a
|
||||||
|
_DawYans_
|
||||||
|
AceT1223
|
||||||
|
Livvyboo7
|
||||||
|
Saaaaaaaaaaaaans
|
||||||
|
okaychill
|
||||||
|
AwesomeBro1122
|
||||||
|
absolutesnek
|
||||||
|
jogie5000
|
||||||
|
curtainSenpai
|
||||||
|
gabbyisaloser
|
||||||
|
gamergurl6969
|
||||||
|
ZeusDk
|
||||||
|
FranaRibas
|
||||||
|
Discoboss
|
||||||
|
SYZ_1
|
||||||
|
Nakoe
|
||||||
|
FIU_Captive
|
||||||
|
xSiFan_
|
||||||
|
ilyDeathxz
|
||||||
|
da_fipsi
|
||||||
|
Lochy
|
||||||
|
The_Lavie37
|
||||||
|
Tonion
|
||||||
|
vnvrchy
|
||||||
|
xX0meg4Xx
|
||||||
|
haohxtheone
|
||||||
|
VtTronic
|
||||||
|
xDaniGum
|
||||||
|
tikkelill
|
||||||
|
DatYoshi
|
||||||
|
eyehamstewpit
|
||||||
|
nicholas460_
|
||||||
|
Memsly445
|
||||||
|
nugunugu
|
||||||
|
AndreSlayz
|
||||||
|
jashik1
|
||||||
|
Qweenoftheocean
|
||||||
|
Coltable
|
||||||
|
treblaclef
|
||||||
|
Kisaxx
|
||||||
|
69Dxddy69
|
||||||
|
RaulCuh
|
||||||
|
3Wheat
|
||||||
|
_OscarTheGrouch
|
||||||
|
oIsqk
|
||||||
|
Blockbusterweng
|
||||||
|
AntoineDegauss
|
||||||
|
ValeIsTheBest
|
||||||
|
SwaggyCrabby
|
||||||
|
DieOfSanity
|
||||||
|
SirenMC
|
||||||
|
Jade_Jewel
|
||||||
|
Tropic44
|
||||||
|
666splendor
|
||||||
|
TallnessTallness
|
||||||
|
breadgang9827
|
||||||
|
Muffin_Worlds
|
||||||
|
DedicatedVeggie
|
||||||
|
Gonzalox_7
|
||||||
|
datrandomasian
|
||||||
|
Chasemon01
|
||||||
|
Nyavix
|
||||||
|
Lonely_Summers
|
||||||
|
_RoveN
|
||||||
|
ok_kyro
|
||||||
|
LN_hunter
|
||||||
|
saharsabz
|
||||||
|
Roselilianna
|
||||||
|
Gadx
|
||||||
|
xtytan
|
||||||
|
RoRo_levosgien88
|
||||||
|
Bowsesqe_21
|
||||||
|
Bennett528
|
||||||
|
TheShipSailsWest
|
||||||
|
KaiserGaming
|
||||||
|
Layna_Shinozaki
|
||||||
|
OP_greatly
|
||||||
|
D3rpTaco
|
||||||
|
Loufink
|
||||||
|
Jorlmungus
|
||||||
|
Snichol1801
|
||||||
|
Ludixeo
|
||||||
|
Imoeto
|
||||||
|
MarshallNebunu
|
||||||
|
crazycrystals
|
||||||
|
Parapatus
|
||||||
|
HahaDani
|
||||||
|
MrQuaring
|
||||||
|
DonTurnt
|
||||||
|
SailorRoberts101
|
||||||
|
FluffieBear
|
||||||
|
TripleThick
|
||||||
|
KingSparta
|
||||||
|
MummysHome
|
||||||
|
Cooga3
|
||||||
|
Technosista
|
||||||
|
Youmerstudios
|
||||||
|
SkyyRaine
|
||||||
|
criss102
|
||||||
|
mrfailt
|
||||||
|
CraftingBasic
|
||||||
|
qnxkdifh
|
||||||
|
Igorex2k20
|
||||||
|
LaLisette
|
||||||
|
ReBoredGamer
|
||||||
|
warlordwest
|
||||||
|
ExoTemporal
|
||||||
|
KingLonmc
|
||||||
|
666Horus
|
||||||
|
IslandCity2
|
||||||
|
TheBigSavage1
|
||||||
|
Trishke2003
|
||||||
|
skyrowin
|
||||||
|
Krissy3D
|
||||||
|
AntonWTobias
|
||||||
|
SaddyWasTaken
|
||||||
|
Ahoy_Peko_Hao_Yo
|
||||||
|
T4nTr1Ss
|
||||||
|
aleciolike
|
||||||
|
ninja_shenley
|
||||||
|
Lordmord1337
|
||||||
|
eatmypoopfather
|
||||||
|
Ktanner
|
||||||
|
The42OWeedGOD
|
||||||
|
CooperBee
|
||||||
|
_MikuMiku_
|
||||||
|
althume
|
||||||
|
Tr3bba93
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package xyz.ineanto.nicko.test.appearance;
|
||||||
|
|
||||||
|
import be.seeseemelk.mockbukkit.MockBukkit;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import xyz.ineanto.nicko.NickoBukkit;
|
||||||
|
import xyz.ineanto.nicko.appearance.random.RandomNameFetcher;
|
||||||
|
import xyz.ineanto.nicko.config.Configuration;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
|
public class RandomNameTest {
|
||||||
|
private static NickoBukkit plugin;
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
public static void setup() {
|
||||||
|
final Configuration config = Configuration.DEFAULT;
|
||||||
|
MockBukkit.mock();
|
||||||
|
plugin = MockBukkit.load(NickoBukkit.class, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Get random name")
|
||||||
|
public void getRandomName() {
|
||||||
|
final RandomNameFetcher randomNameFetcher = new RandomNameFetcher(plugin);
|
||||||
|
assertNotNull(randomNameFetcher.getRandomUsername());
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
public static void shutdown() {
|
||||||
|
MockBukkit.unmock();
|
||||||
|
}
|
||||||
|
}
|
|
@ -63,12 +63,12 @@ public class SQLStorageTest {
|
||||||
assertNull(profile.getName());
|
assertNull(profile.getName());
|
||||||
assertNull(profile.getSkin());
|
assertNull(profile.getSkin());
|
||||||
assertEquals(profile.getLocale(), Locale.ENGLISH);
|
assertEquals(profile.getLocale(), Locale.ENGLISH);
|
||||||
assertTrue(profile.isBungeecordTransfer());
|
assertTrue(profile.isRandomSkin());
|
||||||
|
|
||||||
profile.setName("Notch");
|
profile.setName("Notch");
|
||||||
profile.setSkin("Notch");
|
profile.setSkin("Notch");
|
||||||
profile.setLocale(Locale.FRENCH);
|
profile.setLocale(Locale.FRENCH);
|
||||||
profile.setBungeecordTransfer(false);
|
profile.setRandomSkin(false);
|
||||||
|
|
||||||
final ActionResult result = dataStore.getStorage().store(uuid, profile);
|
final ActionResult result = dataStore.getStorage().store(uuid, profile);
|
||||||
assertFalse(result.isError());
|
assertFalse(result.isError());
|
||||||
|
@ -85,7 +85,7 @@ public class SQLStorageTest {
|
||||||
assertEquals(updatedProfile.getName(), "Notch");
|
assertEquals(updatedProfile.getName(), "Notch");
|
||||||
assertEquals(updatedProfile.getSkin(), "Notch");
|
assertEquals(updatedProfile.getSkin(), "Notch");
|
||||||
assertEquals(updatedProfile.getLocale(), Locale.FRENCH);
|
assertEquals(updatedProfile.getLocale(), Locale.FRENCH);
|
||||||
assertFalse(updatedProfile.isBungeecordTransfer());
|
assertFalse(updatedProfile.isRandomSkin());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in a new issue