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 | 38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8 (patch) | |
tree | 0f18e985c687d4dd88e33f202ceab81a66a3eeef /EssentialsUpdate/src/com/earth2me/essentials | |
parent | d064c68875008a597cfe550a50846eb71b9c6fd2 (diff) | |
download | Essentials-38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8.tar Essentials-38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8.tar.gz Essentials-38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8.tar.lz Essentials-38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8.tar.xz Essentials-38b6d79f49e5d62cdb304b4e7c1dfac027d5f5e8.zip |
Few more states in EssentialsUpdate
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me/essentials')
6 files changed, 135 insertions, 3 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChat.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChat.java index 516ec35b0..ef560bdc3 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChat.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChat.java @@ -11,7 +11,7 @@ public class EssentialsChat extends AbstractYesNoState { public EssentialsChat(final StateMap states) { - super(states, EssentialsProtect.class); + super(states, EssentialsChatSettings.class, EssentialsSpawn.class); } @Override @@ -30,7 +30,8 @@ public class EssentialsChat extends AbstractYesNoState public void askQuestion(final Player sender) { sender.sendMessage("Do you want to install EssentialsChat? (yes/no)"); - sender.sendMessage("Short descriptive text about what EssentialsChat does."); + sender.sendMessage("EssentialsChat is a simple chat formatting plugin"); + sender.sendMessage("It allows you to make user prefixes and coloured text."); } @Override diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChatSettings.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChatSettings.java new file mode 100644 index 000000000..1401f7191 --- /dev/null +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsChatSettings.java @@ -0,0 +1,34 @@ +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 EssentialsChatSettings extends AbstractYesNoState +{ + public EssentialsChatSettings(final StateMap states) + { + super(states, EssentialsSpawn.class); + } + + @Override + public void askQuestion(final Player sender) + { + sender.sendMessage("Would you like to configure EssentialsChat to prefix ingame messages with their group?"); + } + + @Override + public void doWork(final WorkListener listener) + { + if (getAnswer()) + { + //TODO: Configure plugin + + return; + } + listener.onWorkDone(); + } +} diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsGeoIP.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsGeoIP.java new file mode 100644 index 000000000..b96f17c02 --- /dev/null +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsGeoIP.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 EssentialsGeoIP extends AbstractYesNoState +{ + public EssentialsGeoIP(final StateMap states) + { + super(states, null); + } + + @Override + public boolean guessAnswer() + { + final Plugin plugin = Bukkit.getPluginManager().getPlugin("EssentialsGeoIP"); + if (plugin != null) + { + setAnswer(true); + return true; + } + return false; + } + + @Override + public void askQuestion(final Player sender) + { + sender.sendMessage("Do you want to install EssentialsGeoIP? (yes/no)"); + sender.sendMessage("EssentialsGeoIP performs a IP lookup on joining players"); + sender.sendMessage("It allows you get a rough idea of where a player is from."); + } + + @Override + public void doWork(final WorkListener listener) + { + if (getAnswer()) + { + new InstallModule(listener, "EssentialsGeoIP").start(); + return; + } + listener.onWorkDone(); + } +}
\ No newline at end of file diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsProtect.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsProtect.java index 5300ca543..7ffb61268 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsProtect.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/EssentialsProtect.java @@ -30,7 +30,8 @@ public class EssentialsProtect extends AbstractYesNoState public void askQuestion(final Player sender) { sender.sendMessage("Do you want to install EssentialsProtect? (yes/no)"); - sender.sendMessage("Short descriptive text about what EssentialsProtect does."); + sender.sendMessage("EssentialsProtect is a basic world protection system"); + sender.sendMessage("It allows you to set server wide rules, such as disabling creeper explosions, and preventing fire spread."); } @Override 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 diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java index 9736d9510..77fb9ce20 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java @@ -24,7 +24,9 @@ public class StateMachine extends WorkListener this.player = player; states.clear(); states.add(new EssentialsChat(states)); + states.add(new EssentialsSpawn(states)); states.add(new EssentialsProtect(states)); + states.add(new EssentialsGeoIP(states)); current = states.values().iterator().next(); } |