Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID capes #3676

Merged
merged 2 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions capes-uuid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
4e0dd4b7c04f4b728bbcd8f1510d9cc7:capeOrange micdoodle8
bba235f5785848a198bc7ccba53a309e:capeLightGray radfast
35282c16cf0a4d8eb5d6e2c2b2af8d25:capeLime JTE
f782663c84ee476188b528c672400477:capeLime Mitchski
1a32606e2e554a68b1bcdef5527a06c9:capeLime TheGookuPJ
a7108076b5e446689e8f38ce170b7c3d:capeLime bob10234
7b87531ac6834a71a531d4216b999077:capeLime Flies_On_Eyes
6b2697befb724476b1366560dad61de5:capeLime CrimsonKMR
7ba60d3f8d3f435a92c59867614ce97f:capeLime _lime
09912f8b02dc43728d0d60ae66d85d7a:capeLime Hachipatas
15a5921d36cf4c139bcee254e2ff2885:capeLime Happypancakes56
0dd8daa9bec74255ba4834911fe70526:capeLime Slke
532a13ec3126453f87a0df16f0eccbad:capeLime Tyroul
3d7c4b45715d4623a9104193996e1900:capeLime kungfu_dragon
9da24e27976441d8accca25da2f1457f:capeLime Lewis_McReu
bc14cd20a79b42fcb6f6eab39ed59036:capeLightGray TheDaveStream
322a906773a343f892998ff9d9ceb336:capeLime RampantDolphin
2228ec9a323a40ddb0e998e65d05608a:capeLime PureTryOut
401af2b734d14a5ea78a9ae81757b9ee:capeLime ramenators
751f7a3bf3ab43e4b5d2352c7a0d7d9a:capeLime randhope21
c3ea848638e146c18f42b2479ac16ea8:capeLime Night_Fury_CZ
c18b17fcae494d93a1db83121dc01bff:capeLime SoaringChris137
58cdd8b69e004a339914666457cf6421:capeLime TerraGenome
2eaac1b2af094a72bf833c462a8f97a4:capeLime Yangjo
80228a058c1345daa5d0ea0fdcb4eb12:capeLime Made_This_Name
7776112e3ade489a9ac183ff5e1cae7a:capeLime spamenigma
a865907c6b8347b2a08835688169dc6a:capeBlue EzerArch
e1d0ee1c42024b8985d9540bac457463:capeOrange GiantWaffle
e7c3e2a33e1a477f9feda46fe674bea8:capeLightBlue Lastnecron
592e9044ec26496e90296a6dcc43d407:capeBlue SpoonTrauma
b31a143466cf4b1eb27640252e0ca974:capeOrange Devsio
a163bd86b3b847788045f11cc1b171bf:capeOrange Tyrantelf
f3a1ea327dd04d0b9759203a4adff99c:capeBlue Cellenseres
47257425c09d44d9846edb042571dbec:capeOrange SgtAce
743392cc83bc49f2bd3eac04ccf69aa9:capeRainbow Roosterteeth546
db9eea4b99e0413297aa5be75010b0ad:capeOrange SundayxFunday
42232dec4ffd458dbee45791c822bd83:capeLime THEproWINN
766cebb7c5684099870976aa5f069538:capeLime Puggy04
cdec6b441de145f8a7d450ff27b48a62:capeRainbow scriptoffate14
cd6eb3ef44c14030812fab39ce53febe:capeRainbow Ohrm
ade5c7958eea4880b5c305eb898dcc99:capeRainbow SirFuzzhead
291f9006916948588960f5f6d06b6e47:capeRed alexljn5
e7a8ff43db5a48f190c2bdd039bea7ef:capeRainbow Tatertot2222
5725dfbd769d4df8981633346b788f36:capeRainbow atomicpichu
c9ba14cd7a8f41cf9e6b13cca78563b7:capeMagenta chattanooga
aca4ca40b5e74d998d24385acaee46f8:capeOrange so2ro
2054059c45d34375b51e60d59303d6e1:capeBlue Sir_Killz
60fbe691d5fd4007b0e85bfe54fbac7b:capeRainbow ForbiddeFan12
d5d826c123904ceb8b55a160345b91e3:capeRainbow takos
c02818a726634132a0eeabc88616d415:capeLime GradeAWizard
8f1c823c9a3b401da0a2f77829cdba33:capeBlue kelvinxj
82419cb6c25b403f8b1fc503340fff15:capeCyan BCQX
055d629e96104dddbad01944ab5f7d29:capeRainbow Shamrocker101
08ca7900afa8474db3bc1147ed61942e:capeLightGray Truman04
ea62f0017661447399c6c5224b5180c9:capeRainbow Krystal_Disc
4f6de754f9ef4462bc756b55094b4f6e:capeLime eggsandbaon
2f6980ebfac448c79021e452fda174f6:capeRainbow Germaniac
bdfd2c1c28964bf4b22e684ac1ed9118:capeCyan ALterRy
ff42d35e94b44933bcb2d482d277f83f:capeCyan nanatorium
cccbf098d8204d119fa9c85a0f92fee0:capeOrange Phlonk
c7b62bb08a7a41f8a9d9812c89ee9c99:capeRainbow AquaBarnes
459f310e70224bffba46cfb8f28c9b01:capeLime CmdrPineapple
9a4668a923d34fa28054820c305bd308:capeDarkGray lancewalker
8ef62b5cd49a4dd3a59a1bfbb3d3d380:capeYellow 1_c
3101ea80b1904de4b556e4b46dde541c:capeDarkGray MoonRaven
21f531d2d0dd4359a0b4ba5d036a0ce7:capeLime Survarium
ba7e73d2cbf54d63858f2d60ae9eaa6b:capeRainbow Daeon
0e585f22f60647e2a2b56ca7196cfa74:capeLightGray dragonguide
9ca6ab76cdf34b13a3f92d36d337567a:capeRainbow MrRobin1512
a0c708a9b5fb4b8299036fc4437c34b9:capeOrange IndianGooN
6bcc4b6a354344cebe6e4de701ba45d1:capeLightBlue Mysticslay
f5f0b2ce0c094ced9c147156a6a205b5:capeYellow BeeCannon
fc9b324e8d0d4c5d8fd6d11d5d042e61:capeRainbow KrazyMonkey
76ae9784cec6448cb3521eed1abf16f9:capeLightBlue Knightblock
1630c57a471e43a6805240d4a3cbbb55:capeRainbow Shadow_Beats
98313813c3f4494fbb4d68f342633a83:capeYellow Strachey
57d64951c09c4f498875d404841efac9:capeLime JacobiCarter
c0e6fa8862d24556902ef49823b96dfe:capeBrown afoolishmoon
ed4bf20f800b4f32b79718ddb1b24d7b:capeRainbow LokeYourLord
c4c022edb98a4337832a5ea8417aea4e:capeRainbow GetVape
fe481dee2e6d4c289fb742fd3db796e2:capeLime ma10as234
0a429b969fb04d9fb34d032ebeb07c9c:capeRainbow ARedHel66
c53ed454efba4dcfa307ba9eb26c58d3:capeLightBlue PrezGman
0de2e5f8917049b6999c5f1fca7d0ad4:capePurple creeperchick15
e4be20006bfb4003b4e5f6dc4f153471:capeBlue sonic5223
34314a92dc5c43a7afa848f101699203:capeRainbow Master_Apple
6a419733b55046d3a21c46656b801849:capePurple urix123
f71b1f8b46574347a74b0d1b0b25659f:capeLime monkeypants_271
c178592112bb4a71b082b422153f267b:capeLightGray Nomad043
1dafe96cb8a34cf6be51367468409943:capePurple Malstrim
504e79e97f4640688611f18075df5c4e:capeCyan WhiskeyOutlaw
09d4c32761504341b145e3048fb13d04:capeRainbow Akahito666
d41727d58ec947f7a8deeabcb2577f9f:capeOrange Timsuper2
6f71c0114d914942904dc9b63326df4c:capeLightGray Sonic_Blender
fab0af0f6890484594745b0c0205d1a6:capeRainbow xX_CreeperMr_Xx
7430428645f54fe8b5aca82bff3f1400:capePurple Santiv
36ab85cc86da42a99172956dfc80edec:capeRainbow SebaSphere
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.logging.log4j.core.config.plugins.convert.TypeConverters;

import java.util.List;
import java.util.function.BiConsumer;

public class GCEntityClientPlayerMP extends EntityPlayerSP
{
Expand Down Expand Up @@ -526,7 +528,7 @@ public ResourceLocation getLocationCape()
if (!this.checkedCape)
{
NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
this.galacticraftCape = ClientProxyCore.capeMap.get(networkplayerinfo.getGameProfile().getName());
this.galacticraftCape = ClientProxyCore.capeMap.get(networkplayerinfo.getGameProfile().getId().toString().replace("-", ""));
this.checkedCape = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ResourceLocation getLocationCape()
if (!this.checkedCape)
{
NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo();
this.galacticraftCape = ClientProxyCore.capeMap.get(networkplayerinfo.getGameProfile().getName());
this.galacticraftCape = ClientProxyCore.capeMap.get(networkplayerinfo.getGameProfile().getId().toString().replace("-", ""));
this.checkedCape = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,11 @@ private static void updateCapeList()

try
{
capeListUrl = new URL("https://raw.github.com/micdoodle8/Galacticraft/master/capes.txt");
capeListUrl = new URL("https://raw.github.com/micdoodle8/Galacticraft/master/capes-uuid.txt");
}
catch (IOException e)
{
FMLLog.severe("Error getting capes list URL");
GCLog.severe("Error getting capes list URL");
if (ConfigManagerCore.enableDebug) e.printStackTrace();
return;
}
Expand Down Expand Up @@ -877,49 +877,37 @@ private static void updateCapeList()
BufferedReader reader = new BufferedReader(streamReader);

String line;
try
{
while ((line = reader.readLine()) != null)
{
if (line.contains(":"))
{
try {
while ((line = reader.readLine()) != null) {
if (line.contains(":")) {
int splitLocation = line.indexOf(":");
String username = line.substring(0, splitLocation);
ClientProxyCore.capeMap.put(username, new ResourceLocation(Constants.ASSET_PREFIX, "textures/misc/capes/" + convertCapeString(line.substring(splitLocation + 1)) + ".png"));
String uuid = line.substring(0, splitLocation);
System.out.println(uuid);
System.out.println(convertCapeString(line.substring(splitLocation + 1)));
capeMap.put(uuid, new ResourceLocation(Constants.MOD_ID_CORE, "textures/misc/capes/cape_" + convertCapeString(line.substring(splitLocation + 1)) + ".png"));
}
}
}
catch (IOException e)
{
if (ConfigManagerCore.enableDebug) e.printStackTrace();
}
finally
{
try
{
} catch (IOException e) {
if (ConfigManagerCore.enableDebug)e.printStackTrace();
} finally {
try {
reader.close();
}
catch (IOException e)
{
} catch (IOException e) {
if (ConfigManagerCore.enableDebug) e.printStackTrace();
}
}
}

private static String convertCapeString(String capeName)
{
StringBuilder underscoreCase = new StringBuilder();
for (int i = 0; i < capeName.length(); ++i)
{
private static String convertCapeString(String capeName) {
String s = "";
for (int i = 0; i < capeName.length(); ++i) {
char c = capeName.charAt(i);
if (!Character.isLowerCase(c))
{
underscoreCase.append("_");
c = Character.toLowerCase(c);
if (c == " ".charAt(0)) {
break;
}
underscoreCase.append(c);
s = String.join("", s, Character.toString(c));
}
return underscoreCase.toString();
return s.substring(4).toLowerCase();
}

public static void registerInventoryTabs()
Expand Down