Add more fun stuff

This commit is contained in:
Sam 2017-03-20 23:43:35 +00:00 committed by cnr
parent 52323f6119
commit 4b22355348
2 changed files with 64 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package mineplex.core.aprilfools;
import com.google.common.collect.ImmutableMap;
import mineplex.core.MiniPlugin;
import mineplex.core.aprilfools.command.PirateSongCommand;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
@ -33,6 +34,7 @@ public class AprilFoolsManager extends MiniPlugin
.put("gold", "dubloon")
.put("dog", "seadog")
.put("die", "walk the plank")
.put("kill", "keelhaul")
.put("boat", "ship")
.put("drink", "grog")
.put("water", "grog")
@ -52,6 +54,9 @@ public class AprilFoolsManager extends MiniPlugin
.put("clumsy", "landlubber")
.put("clean", "swab")
.put("look", "avast ye")
.put("omg", "shiver my timbers")
.put("wood", "timber")
.put("trash", "poop deck")
.put("noob", "shark bait")
.put("hack", "scurvy")
.put("hacks", "scurvy")
@ -95,6 +100,12 @@ public class AprilFoolsManager extends MiniPlugin
}
}
@Override
public void addCommands()
{
addCommand(new PirateSongCommand(this));
}
@EventHandler(priority = EventPriority.LOWEST)
public void chat(AsyncPlayerChatEvent event)
{
@ -183,7 +194,7 @@ public class AprilFoolsManager extends MiniPlugin
if (random > 0.99)
{
message = "Eye Eye Captain!";
message = "Aye Aye Captain!";
}
else if (random > 0.98)
{
@ -193,6 +204,10 @@ public class AprilFoolsManager extends MiniPlugin
{
message = "Mateyy!";
}
else if (random > 0.96)
{
message = "Shiver me timbers!";
}
if (message == null)
{

View File

@ -0,0 +1,48 @@
package mineplex.core.aprilfools.command;
import mineplex.core.aprilfools.AprilFoolsManager;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilTextMiddle;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class PirateSongCommand extends CommandBase<AprilFoolsManager>
{
private static final String[] PIRATE_SONG = {
"Are you ready kids?",
"Aye aye captain!",
"I can't hear you!",
"AYE AYE CAPTAIN!",
"OOOOOOOOOOOOH",
"Who lives in a pineapple under the sea?",
"Spongebob Squarepants!"
};
public PirateSongCommand(AprilFoolsManager plugin)
{
super(plugin, Rank.ADMIN, "piratesong");
}
@Override
public void Execute(Player caller, String[] args)
{
Plugin.runSyncTimer(new BukkitRunnable()
{
int index = 0;
@Override
public void run()
{
if (index == PIRATE_SONG.length)
{
cancel();
return;
}
UtilTextMiddle.display("", PIRATE_SONG[index++], 10, 60, 10);
}
}, 20, 100);
}
}