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

Add EssentialsX home export from yaml userdata #2

Closed
Emibergo02 opened this issue Dec 19, 2020 · 1 comment
Closed

Add EssentialsX home export from yaml userdata #2

Emibergo02 opened this issue Dec 19, 2020 · 1 comment
Labels
type: feature request This issue is about a new feature or request

Comments

@Emibergo02
Copy link
Contributor

Emibergo02 commented Dec 19, 2020

Please add this feature. it's very useful for servers with a large playerbase

	                        Essentials ess=(Essentials)getServer().getPluginManager().getPlugin("Essentials");
				Plugin BTM = Bukkit.getPluginManager().getPlugin("BungeeTeleportManager");
				if (ess == null) {
					Bukkit.getLogger().severe("Essentials hook failed");
					return;
				}
				if (BTM == null && !BTM.isEnabled()) {
					Bukkit.getLogger().severe("BungeeTeleportManager hook failed");
					return;
				}
				BungeeTeleportManager bTel = (BungeeTeleportManager) BTM;
				for (UUID uuid : ess.getUserMap().getAllUniqueUsers()) {
					User u = ess.getUser(uuid);
					Bukkit.getLogger().info("Exporting home of "+u.getName()+" to Database");
					try {
						Home home = new Home(uuid, u.getName(), "home", Utility.getLocation(u.getHome("home")));
						bTel.getMysqlHandler().create(MysqlHandler.Type.HOMES, home);
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}			

this is a sample i've made for another plugin but i hope it works with HuskHomes too

@WiIIiam278
Copy link
Owner

WiIIiam278 commented Dec 19, 2020

Hey, thanks for your request. @Emibergo02
HuskHomes supports migration (i.e exporting into HuskHomes) from EssentialsX already through the huskhomes migrate essentialsx (in console) already. It does this by directly reading from the YAML data :)
Let me know if the solution in place works for you already

@WiIIiam278 WiIIiam278 added the type: feature request This issue is about a new feature or request label Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request This issue is about a new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants