feat: start working on random skin

This commit is contained in:
ineanto 2023-12-21 17:40:57 +01:00
parent 8a544d1ba5
commit fdada8f44f
15 changed files with 636 additions and 59 deletions

View file

@ -2,10 +2,11 @@ plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.2"
id("xyz.jpenilla.run-paper") version "2.2.2"
id("jvm-test-suite")
}
group = "xyz.ineanto"
version = "1.0.8-RC1"
version = "1.1.0-RC1"
val shadowImplementation: Configuration by configurations.creating
configurations["implementation"].extendsFrom(shadowImplementation)
@ -144,4 +145,24 @@ tasks.named("jar").configure {
tasks.test {
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")
}
}
}
} */

View file

@ -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);
}
}

View file

@ -1,14 +1,12 @@
package xyz.ineanto.nicko.gui;
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.settings.BungeeCordCyclingItem;
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.I18NDict;
import xyz.xenondevs.invui.gui.Gui;
import xyz.xenondevs.invui.item.impl.SimpleItem;
import xyz.xenondevs.invui.window.Window;
public class SettingsGUI {
@ -19,26 +17,23 @@ public class SettingsGUI {
public SettingsGUI(Player player) {
final String[] dynamicStructure = new String[]{
"# # # # # # # # #",
"# # # L T U # # #",
"# # # L # R # # #",
"B # # # # # # # #"
};
dynamicStructure[1] = dynamicStructure[1].replace("T", "U");
final I18N i18n = new I18N(player);
this.title = i18n.translatePrefixless(I18NDict.GUI.Titles.SETTINGS);
final HomeGUI parent = new HomeGUI(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);
this.gui = Gui.normal()
.setStructure(dynamicStructure)
.addIngredient('B', backItem.get(parent.getGUI(), parent.getTitle()))
.addIngredient('L', languageItem.get())
.addIngredient('U', new SimpleItem(ItemDefaults.getUnavailableItem(i18n)))
.addIngredient('T', bungeeCordItem.get())
.addIngredient('R', skinItem.get())
.build();
this.player = player;
}

View file

@ -40,8 +40,8 @@ public class LanguageCyclingItem {
final NickoProfile nickoProfile = profile.get();
int localeOrdinal = nickoProfile.getLocale().ordinal();
return CycleItem.withStateChangeHandler((observer, integer) -> {
nickoProfile.setLocale(Locale.values()[integer]);
observer.playSound(player, Sound.UI_BUTTON_CLICK, 1f, 0.707107f); // 0.707107 ~= C
nickoProfile.setLocale(Locale.values()[integer]);
player.getOpenInventory().close();
if (dataStore.updateCache(player.getUniqueId(), nickoProfile).isError()) {
player.sendMessage(i18n.translate(I18NDict.Event.Settings.ERROR));

View file

@ -1,6 +1,5 @@
package xyz.ineanto.nicko.gui.items.settings;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
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.storage.PlayerDataStore;
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.CycleItem;
import xyz.xenondevs.invui.item.impl.SimpleItem;
import java.util.Optional;
public class BungeeCordCyclingItem {
public class RandomSkinCyclingItem {
private final Player player;
private final I18N i18n;
private final ItemProvider[] providers;
private final I18N i18n;
public BungeeCordCyclingItem(Player player) {
public RandomSkinCyclingItem(Player player) {
this.player = player;
this.i18n = new I18N(player);
this.providers = new ItemProvider[]{
@ -36,33 +35,30 @@ public class BungeeCordCyclingItem {
final Optional<NickoProfile> profile = dataStore.getData(player.getUniqueId());
if (profile.isPresent()) {
final NickoProfile nickoProfile = profile.get();
int startingState = nickoProfile.isBungeecordTransfer() ? 0 : 1;
int localeOrdinal = nickoProfile.isRandomSkin() ? 0 : 1;
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
}, 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);
}
private ItemProvider getItemProviderForValue(boolean ignored) {
final ItemBuilder builder = new ItemBuilder(Material.COMPASS);
final ItemTranslation translation = i18n.fetchTranslation(I18NDict.GUI.Settings.BUNGEECORD);
private ItemProvider getItemProviderForValue(boolean enabled) {
final SkullBuilder.HeadTexture texture = new SkullBuilder.HeadTexture("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzgzMTEzOGMyMDYxMWQzMDJjNDIzZmEzMjM3MWE3NDNkMTc0MzdhMTg5NzNjMzUxOTczNDQ3MGE3YWJiNCJ9fX0=");
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());
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;
}
}
}

View file

@ -112,7 +112,7 @@ public class I18NDict {
private static final String SETTINGS_KEY = GUI_KEY + "settings.";
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 {

View file

@ -42,11 +42,11 @@ public class NickoExpansion extends PlaceholderExpansion {
if (player == null) return null;
String name, skin, locale;
boolean bungeecord;
boolean randomSkin;
name = skin = player.getName();
locale = "N/A";
bungeecord = true;
randomSkin = false;
final Optional<NickoProfile> optionalProfile = instance.getDataStore().getData(player.getUniqueId());
if (optionalProfile.isPresent()) {
@ -61,14 +61,14 @@ public class NickoExpansion extends PlaceholderExpansion {
}
}
locale = profile.getLocale().getName();
bungeecord = profile.isBungeecordTransfer();
randomSkin = profile.isRandomSkin();
}
return switch (params) {
case "name" -> name;
case "skin" -> skin;
case "locale" -> locale;
case "bungeecord" -> String.valueOf(bungeecord);
case "bungeecord" -> String.valueOf(randomSkin);
default -> null;
};
}

View file

@ -15,13 +15,13 @@ public class NickoProfile implements Cloneable {
private String name;
private String skin;
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.skin = skin;
this.locale = locale;
this.bungeecordTransfer = bungeecordTransfer;
this.randomSkin = randomSkin;
}
public static Optional<NickoProfile> get(Player player) {
@ -60,12 +60,12 @@ public class NickoProfile implements Cloneable {
this.locale = locale;
}
public boolean isBungeecordTransfer() {
return bungeecordTransfer;
public boolean isRandomSkin() {
return randomSkin;
}
public void setBungeecordTransfer(boolean bungeecordTransfer) {
this.bungeecordTransfer = bungeecordTransfer;
public void setRandomSkin(boolean randomSkin) {
this.randomSkin = randomSkin;
}
@Override
@ -74,7 +74,7 @@ public class NickoProfile implements Cloneable {
"name='" + name + '\'' +
", skin='" + skin + '\'' +
", locale=" + locale +
", bungeecordTransfer=" + bungeecordTransfer +
", randomSkin=" + randomSkin +
'}';
}

View file

@ -124,7 +124,7 @@ public class MariaDBStorage extends Storage {
statement.setString(2, profile.getName() == null ? null : profile.getName());
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
statement.setString(4, profile.getLocale().getCode());
statement.setBoolean(5, profile.isBungeecordTransfer());
statement.setBoolean(5, profile.isRandomSkin());
return statement;
}
@ -134,7 +134,7 @@ public class MariaDBStorage extends Storage {
statement.setString(1, profile.getName() == null ? null : profile.getName());
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
statement.setString(3, profile.getLocale().getCode());
statement.setBoolean(4, profile.isBungeecordTransfer());
statement.setBoolean(4, profile.isRandomSkin());
statement.setString(5, uuid.toString());
return statement;
}

View file

@ -124,7 +124,7 @@ public class MySQLStorage extends Storage {
statement.setString(2, profile.getName() == null ? null : profile.getName());
statement.setString(3, profile.getSkin() == null ? null : profile.getSkin());
statement.setString(4, profile.getLocale().getCode());
statement.setBoolean(5, profile.isBungeecordTransfer());
statement.setBoolean(5, profile.isRandomSkin());
return statement;
}
@ -134,7 +134,7 @@ public class MySQLStorage extends Storage {
statement.setString(1, profile.getName() == null ? null : profile.getName());
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
statement.setString(3, profile.getLocale().getCode());
statement.setBoolean(4, profile.isBungeecordTransfer());
statement.setBoolean(4, profile.isRandomSkin());
statement.setString(5, uuid.toString());
return statement;
}

View file

@ -133,8 +133,10 @@ gui:
lore:
- "§7§oGet through the values"
- "§7§oby left or right clicking."
bungeecord:
name: "Bungeecord Transfer"
random_skin:
name: "Random skin on join"
lore:
- "{0}"
- "{1}"
- "§7§oGet through the values"
- "§7§oby left or right clicking."

View file

@ -130,8 +130,10 @@ gui:
lore:
- "§7§oParcourez les valeurs"
- "§7§oavec un clique gauche/droit."
bungeecord:
name: "Transfert Bungeecord"
random_skin:
name: "Apparence aléatoire à la connexion"
lore:
- "{0}"
- "{1}"
- "§7§oParcourez les valeurs"
- "§7§oavec un clique gauche/droit."

View 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
1 w4nderlost
2 TooParanoids
3 Der_OG_31er
4 9xxDaRkShAdOwxx9
5 giiiaan_
6 Jqstinnn
7 Tillysboy92
8 AlwaysCello
9 SyndrexG0D
10 Peypeycake
11 ThePerjurer
12 Tioe
13 Elternbaum
14 BarkersRover_16
15 pebsso
16 cyrus6950
17 Bigest_guy
18 RV0REU
19 R379
20 Shetell
21 _HEAPASS_
22 Iamaloner21
23 TheFardoxGamerHD
24 Flyboi43
25 Cha0smusik
26 kat00
27 Infreat
28 Crummymoofin
29 MijnVriend
30 momsrightkidney
31 dmacrado
32 Elephantman321
33 ii_hamoudi_YT
34 FaurePavane
35 ambiezzz
36 XD_Bandit695_XD
37 Nabingo
38 Cyl0re
39 ku5
40 SrAragon
41 StarlightDream9
42 CJ5370
43 rainbees
44 KeroTheWolf
45 Andrews9722
46 cursed_Assyrian
47 yamateni
48 ProgramEXE
49 exprso
50 harrypanda
51 LookerMD
52 migykins
53 Wintrous
54 ZzGaBi
55 Flayber
56 Grenixal
57 maeve_wells
58 Creeper10fr
59 10Chairs
60 2525lock
61 Shqipe
62 XenitsuZen
63 Berno17_
64 wolle1313
65 HalfDogHalfCat1
66 NachoGarcia
67 popsicoal
68 NemesiSevil2006
69 AnywayOj
70 Tanko12345
71 Samdweck
72 LYRECODE123
73 Resulten
74 SirBastii
75 Maku056
76 ItzArnizzz
77 Brsh3620
78 Masonita
79 kapplanium
80 shoezo
81 Mansur203
82 Waterboy15217
83 redragonne
84 ghko325
85 HopePVP_tw7
86 xtka
87 NimwenxZ
88 Hiro0408
89 PanderaWz
90 Shesu
91 _Aniste_NY_
92 Besceste
93 3ee3
94 ArcticGalaxy123
95 snooze_mingo
96 LizzyLomnh
97 FaZeChulupa
98 LineZeeK
99 liabilaty
100 BlackSheep1610
101 Simif69
102 Aficionado
103 riekin
104 XLuggas
105 MathExams
106 6fq
107 Marveel
108 lolme51
109 TaioSayUwU
110 Fonklift
111 blvw
112 Po1204
113 Pierre_Rabbit
114 mifimasters
115 MrRidge1
116 arnqen
117 Nick_cage102
118 Geo_9918
119 SSShudder
120 Nicolas_Mom
121 WolfMatrix101
122 frictionless_
123 Gughik
124 gold_dragon_4
125 nealxero
126 ClonedPickle
127 SourWatermelonxX
128 devilunion
129 Daryifuny
130 joaomarcos11
131 Dekeef
132 PadfootTheDog
133 DarkScopez80
134 flowers220
135 Gaiiya
136 The_Yeet_
137 juuuuwu
138 MrMafioz
139 Surpasses
140 TypicalOwen
141 0lober
142 Zerfixy
143 Sunny3803b
144 neostanley
145 Creeper_Kart
146 minestin
147 Goldenfredster
148 Vju
149 MrArchI_YT
150 Casper1709
151 Backiii_
152 DrCreate
153 Nova_Lux1
154 Jayvin_Blanco
155 ShadowMan1770
156 0KOPO40K
157 Silk_Altermann69
158 Alu____
159 Honey_MilkExe112
160 T0XEI
161 CB_13
162 Paragorn
163 HaGiang
164 Shivendra8i
165 Mayflower47
166 Not_Someguy
167 raxx111bg
168 IceyGlaceon
169 grasseffect
170 PoopTNTpvp
171 codecyber
172 Shrumpkin13
173 Shqdown
174 Cmartin82
175 KTCXD_5p0tty
176 rockesalt
177 goldjeong
178 TheRealAKD
179 NamiSwaaan
180 yaaratol
181 Dikiy_Flexer
182 PoLecker24
183 _SakuraTree
184 PikkOgP0rno
185 HawksFang
186 BlueWinterWolf
187 hskmerk
188 gurmaw
189 Lunggor
190 clashfield
191 Zelaste
192 ACommonMouse
193 TJ_Mystery
194 Dizzy3312
195 Raindropsss
196 minecraftxiaoju
197 sachilovebbh
198 Celina_LaZyCxt
199 firered6
200 55000000
201 Illunarnati
202 Jedidiah2003
203 setomz1
204 basically_e
205 TommyGreif02
206 Bongrip42069
207 Coco_Keopi
208 Lt_Colt
209 Kuurotta
210 GqmeKnight
211 WinCo_Foods
212 FKDLZ
213 IanPumpkin
214 tastywtf
215 natedawg0
216 ZQLFenyx
217 GamerMaster110
218 papajobi9
219 Yucaroon
220 Xion_69
221 AirJaw
222 funfun321234
223 khalleesii
224 Pozisch
225 thorso15
226 kyumisoup
227 Leonqrd
228 BmwDreamer
229 TehRos
230 pitplayer69
231 _ve0
232 Miss_Yuka
233 I_am_a_Bucket
234 nicolas_bean
235 xHorizonGC
236 RTX3060_
237 Borec188
238 c8to
239 megan3groCENG
240 ventriloquize
241 galczin
242 Scorch3dEarth3d
243 nightstarLP
244 VittyGam3r
245 GLaDOS__
246 hydrelo
247 JustACarter
248 MikeDropperPlay
249 NorthernWest
250 _Skelesam_
251 ZX_Style
252 Tamas_Boi
253 taylub
254 VyacheslavO_O
255 trippyaubs
256 udtpic
257 Lunarglow
258 Stoolman
259 legendary_meow
260 Loganii
261 CaptainStain56
262 FoofieGeto
263 Judgeavapl
264 OneBigDigger
265 Sorem13
266 Raisonneur
267 IlkoalI
268 Naxa
269 craigbabyonebay
270 NicholasG04
271 UtopianCrisi
272 CalamarPasGenti
273 ryluh_
274 Aceslimz
275 Howardygh99927
276 brandon257
277 MarcoswildHD
278 x_XSkylerX_x
279 Bronco09
280 That_Kookie_
281 Danigtz
282 Ricky_lol
283 999keyt
284 Thilow15
285 Difesito
286 ostehovl
287 isacano_12
288 big_esra
289 secretbaguette
290 MrCommunism
291 Jekube
292 GrandeMaster
293 DrGrip
294 TheArnek
295 JacsMars
296 Lliam14
297 MrGameandWatch84
298 Rinzap
299 XrazzeD
300 ukknown
301 ZohanPrent
302 Naspo
303 Rajem
304 VepiGHG
305 matoureal
306 BrianChen87
307 Jrocky
308 stivo999
309 Des_cole
310 ReqGames
311 Kingja1912
312 issssyy
313 Apache424
314 Nick_Zockt_
315 Mr_Haider_10
316 ValentineBun
317 fedorPro228
318 xTilz
319 blockbuster02k
320 4ck
321 FrostedTree
322 VegasTortoise
323 ZBellaV12121
324 paypales
325 qDread
326 itsRiven
327 i8oreo
328 _kimcream_
329 Phisuss
330 Oscargray
331 Elsiff
332 callofdutydog00
333 BruhTheMoment
334 Pazmaa
335 MythicalOak
336 komuchi33
337 awf4
338 Jacobsaurus21
339 itsjohannaa
340 Jello12
341 Adrien183
342 jajazzywazzy
343 Jorjie22
344 SuperBrawlr5788
345 KaraageV
346 _Hanime_tv
347 Padilhao
348 Tikkas
349 ordinaryducky
350 Mothytix95
351 renopotouwu
352 1000voices
353 niclas05
354 Felipstein
355 DoutorBauer
356 FireballPlaysMC
357 vapelordsheep
358 Aboain
359 ImGrexy
360 Aivokolo
361 SuperAmazing101
362 va75a77a
363 _DawYans_
364 AceT1223
365 Livvyboo7
366 Saaaaaaaaaaaaans
367 okaychill
368 AwesomeBro1122
369 absolutesnek
370 jogie5000
371 curtainSenpai
372 gabbyisaloser
373 gamergurl6969
374 ZeusDk
375 FranaRibas
376 Discoboss
377 SYZ_1
378 Nakoe
379 FIU_Captive
380 xSiFan_
381 ilyDeathxz
382 da_fipsi
383 Lochy
384 The_Lavie37
385 Tonion
386 vnvrchy
387 xX0meg4Xx
388 haohxtheone
389 VtTronic
390 xDaniGum
391 tikkelill
392 DatYoshi
393 eyehamstewpit
394 nicholas460_
395 Memsly445
396 nugunugu
397 AndreSlayz
398 jashik1
399 Qweenoftheocean
400 Coltable
401 treblaclef
402 Kisaxx
403 69Dxddy69
404 RaulCuh
405 3Wheat
406 _OscarTheGrouch
407 oIsqk
408 Blockbusterweng
409 AntoineDegauss
410 ValeIsTheBest
411 SwaggyCrabby
412 DieOfSanity
413 SirenMC
414 Jade_Jewel
415 Tropic44
416 666splendor
417 TallnessTallness
418 breadgang9827
419 Muffin_Worlds
420 DedicatedVeggie
421 Gonzalox_7
422 datrandomasian
423 Chasemon01
424 Nyavix
425 Lonely_Summers
426 _RoveN
427 ok_kyro
428 LN_hunter
429 saharsabz
430 Roselilianna
431 Gadx
432 xtytan
433 RoRo_levosgien88
434 Bowsesqe_21
435 Bennett528
436 TheShipSailsWest
437 KaiserGaming
438 Layna_Shinozaki
439 OP_greatly
440 D3rpTaco
441 Loufink
442 Jorlmungus
443 Snichol1801
444 Ludixeo
445 Imoeto
446 MarshallNebunu
447 crazycrystals
448 Parapatus
449 HahaDani
450 MrQuaring
451 DonTurnt
452 SailorRoberts101
453 FluffieBear
454 TripleThick
455 KingSparta
456 MummysHome
457 Cooga3
458 Technosista
459 Youmerstudios
460 SkyyRaine
461 criss102
462 mrfailt
463 CraftingBasic
464 qnxkdifh
465 Igorex2k20
466 LaLisette
467 ReBoredGamer
468 warlordwest
469 ExoTemporal
470 KingLonmc
471 666Horus
472 IslandCity2
473 TheBigSavage1
474 Trishke2003
475 skyrowin
476 Krissy3D
477 AntonWTobias
478 SaddyWasTaken
479 Ahoy_Peko_Hao_Yo
480 T4nTr1Ss
481 aleciolike
482 ninja_shenley
483 Lordmord1337
484 eatmypoopfather
485 Ktanner
486 The42OWeedGOD
487 CooperBee
488 _MikuMiku_
489 althume
490 Tr3bba93

View file

@ -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();
}
}

View file

@ -63,12 +63,12 @@ public class SQLStorageTest {
assertNull(profile.getName());
assertNull(profile.getSkin());
assertEquals(profile.getLocale(), Locale.ENGLISH);
assertTrue(profile.isBungeecordTransfer());
assertTrue(profile.isRandomSkin());
profile.setName("Notch");
profile.setSkin("Notch");
profile.setLocale(Locale.FRENCH);
profile.setBungeecordTransfer(false);
profile.setRandomSkin(false);
final ActionResult result = dataStore.getStorage().store(uuid, profile);
assertFalse(result.isError());
@ -85,7 +85,7 @@ public class SQLStorageTest {
assertEquals(updatedProfile.getName(), "Notch");
assertEquals(updatedProfile.getSkin(), "Notch");
assertEquals(updatedProfile.getLocale(), Locale.FRENCH);
assertFalse(updatedProfile.isBungeecordTransfer());
assertFalse(updatedProfile.isRandomSkin());
}
@Test