Allowing tp with /home and /tpa inside the minigame
This commit is contained in:
parent
63a04d98da
commit
b67d2a9ef6
6 changed files with 12 additions and 2 deletions
Binary file not shown.
|
@ -80,7 +80,9 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (mp.FlairState.equals(FlairStates.NoComment)) {
|
if (mp.FlairState.equals(FlairStates.NoComment)) {
|
||||||
String json = String.format("[\"\",{\"text\":\"If you'd like your /r/TheButton flair displayed ingame, write your Minecraft name to \",\"color\":\"aqua\"},{\"text\":\"[this thread].\",\"color\":\"aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread\",\"color\":\"aqua\"}]}}}]", PluginMain.FlairThreadURL);
|
String json = String
|
||||||
|
.format("[\"\",{\"text\":\"If you'd like your /r/TheButton flair displayed ingame, write your Minecraft name to \",\"color\":\"aqua\"},{\"text\":\"[this thread].\",\"color\":\"aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread\",\"color\":\"aqua\"}]}}}]",
|
||||||
|
PluginMain.FlairThreadURL);
|
||||||
PluginMain.Instance.getServer().dispatchCommand(
|
PluginMain.Instance.getServer().dispatchCommand(
|
||||||
PluginMain.Console,
|
PluginMain.Console,
|
||||||
"tellraw " + mp.PlayerName + " " + json);
|
"tellraw " + mp.PlayerName + " " + json);
|
||||||
|
@ -708,6 +710,14 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
} catch (NotRegisteredException e) {
|
} catch (NotRegisteredException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (cmd.equalsIgnoreCase("home") || cmd.equalsIgnoreCase("tpa") || cmd.equalsIgnoreCase("tp")) {
|
||||||
|
MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(event
|
||||||
|
.getPlayer());
|
||||||
|
if (mgp.isInMinigame()
|
||||||
|
&& mgp.getMinigame().getMechanic().getMechanic()
|
||||||
|
.equals("creativeglobal")) {
|
||||||
|
mgp.setAllowTeleport(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue