Fixed issue with the configuration settings for Herobrine's name and UUID not working properly

This commit is contained in:
David Berdik 2017-12-30 13:15:00 -05:00
parent 296585d547
commit 4c3ba12ba3

View File

@ -1,5 +1,6 @@
package net.theprogrammersworld.herobrine.nms.NPC;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@ -17,6 +18,7 @@ import net.theprogrammersworld.herobrine.nms.NPC.utils.NMSWorldAccess;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.YamlConfiguration;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
@ -26,7 +28,17 @@ public class NPCCore {
private static final GameProfile HEROBRINE_GAME_PROFILE = getHerobrineGameProfile();
private static GameProfile getHerobrineGameProfile() {
GameProfile profile = new GameProfile(UUID.fromString(Herobrine.getPluginCore().getConfigDB().HerobrineUUID), Herobrine.getPluginCore().getConfigDB().HerobrineName);
// Get Herobrine's UUID and Name. We cannot rely on the ConfigDB because this constructor is called before the ConfigDB is initialized.
String herobrineUUID = "f84c6a79-0a4e-45e0-879b-cd49ebd4c4e2";
String herobrineName = "Herobrine";
YamlConfiguration configAccess = new YamlConfiguration();
try {
configAccess.load(new File("plugins" + File.separator + "Herobrine" + File.separator + "config.yml"));
herobrineUUID = configAccess.getString("config.HerobrineUUID");
herobrineName = configAccess.getString("config.Name");
} catch (Exception e) {}
GameProfile profile = new GameProfile(UUID.fromString(herobrineUUID), herobrineName);
Property textures = new Property(
"textures",
"eyJ0aW1lc3RhbXAiOjE0MjE0ODczMzk3MTMsInByb2ZpbGVJZCI6ImY4NGM2YTc5MGE0ZTQ1ZTA4NzliY2Q0OWViZDRjNGUyIiwicHJvZmlsZU5hbWUiOiJIZXJvYnJpbmUiLCJpc1B1YmxpYyI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzk4YjdjYTNjN2QzMTRhNjFhYmVkOGZjMThkNzk3ZmMzMGI2ZWZjODQ0NTQyNWM0ZTI1MDk5N2U1MmU2Y2IifX19",