diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-10-26 16:26:26 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-10-26 16:26:26 +0100 |
commit | d8a40db32c91b4bb6748bdcddb1b1e62e5299006 (patch) | |
tree | 7c2b8ef94dda6d6e218a196feef934051a520f49 /EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java | |
parent | 7895a2fc5aca61231c0489d174324fb2acb05f65 (diff) | |
download | Essentials-d8a40db32c91b4bb6748bdcddb1b1e62e5299006.tar Essentials-d8a40db32c91b4bb6748bdcddb1b1e62e5299006.tar.gz Essentials-d8a40db32c91b4bb6748bdcddb1b1e62e5299006.tar.lz Essentials-d8a40db32c91b4bb6748bdcddb1b1e62e5299006.tar.xz Essentials-d8a40db32c91b4bb6748bdcddb1b1e62e5299006.zip |
Few more states in EssentialsUpdate
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java')
-rw-r--r-- | EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java new file mode 100644 index 000000000..95cc6599b --- /dev/null +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsSpawn.java @@ -0,0 +1,47 @@ +package com.earth2me.essentials.update.states; + +import com.earth2me.essentials.update.WorkListener; +import com.earth2me.essentials.update.tasks.InstallModule; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + + +public class EssentialsSpawn extends AbstractYesNoState +{ + public EssentialsSpawn(final StateMap states) + { + super(states, null); + } + + @Override + public boolean guessAnswer() + { + final Plugin plugin = Bukkit.getPluginManager().getPlugin("EssentialsSpawn"); + if (plugin != null) + { + setAnswer(true); + return true; + } + return false; + } + + @Override + public void askQuestion(final Player sender) + { + sender.sendMessage("Do you want to install EssentialsSpawn? (yes/no)"); + sender.sendMessage("EssentialsSpawn lets you control player spawning"); + sender.sendMessage("It allows you to set different places where players spawn on death, new players join and allows players to return to spawn."); + } + + @Override + public void doWork(final WorkListener listener) + { + if (getAnswer()) + { + new InstallModule(listener, "EssentialsSpawn").start(); + return; + } + listener.onWorkDone(); + } +}
\ No newline at end of file |