This commit is contained in:
parent
29b3c8830a
commit
d7be9fbe30
6 changed files with 26 additions and 11 deletions
Binary file not shown.
|
@ -180,7 +180,7 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
"(?i)" + Pattern.quote(p.getName()),
|
"(?i)" + Pattern.quote(p.getName()),
|
||||||
color
|
color
|
||||||
+ p.getName()
|
+ p.getName()
|
||||||
+ (greentext ? "§2"
|
+ (greentext ? "§a"
|
||||||
: player.CurrentChannel.DisplayName
|
: player.CurrentChannel.DisplayName
|
||||||
.substring(0, 2)));
|
.substring(0, 2)));
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
message = message.replaceAll(
|
message = message.replaceAll(
|
||||||
"(?i)" + Pattern.quote(nwithoutformatting),
|
"(?i)" + Pattern.quote(nwithoutformatting),
|
||||||
n
|
n
|
||||||
+ (greentext ? "§2"
|
+ (greentext ? "§a"
|
||||||
: player.CurrentChannel.DisplayName
|
: player.CurrentChannel.DisplayName
|
||||||
.substring(0, 2)));
|
.substring(0, 2)));
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
"#" + original,
|
"#" + original,
|
||||||
String.format(
|
String.format(
|
||||||
"\",\"color\":\"%s\"},{\"text\":\"#%s\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://twitter.com/hashtag/%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open on Twitter\",\"color\":\"blue\"}]}}},{\"text\":\"",
|
"\",\"color\":\"%s\"},{\"text\":\"#%s\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://twitter.com/hashtag/%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open on Twitter\",\"color\":\"blue\"}]}}},{\"text\":\"",
|
||||||
(greentext ? "dark_green"
|
(greentext ? "green"
|
||||||
: player.CurrentChannel.Color),
|
: player.CurrentChannel.Color),
|
||||||
original, original));
|
original, original));
|
||||||
|
|
||||||
|
@ -289,16 +289,16 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
item,
|
item,
|
||||||
String.format(
|
String.format(
|
||||||
"\",\"color\":\"%s\"},{\"text\":\"%s\",\"color\":\"%s\",\"underlined\":\"true\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open URL\",\"color\":\"blue\"}]}}},{\"text\":\"",
|
"\",\"color\":\"%s\"},{\"text\":\"%s\",\"color\":\"%s\",\"underlined\":\"true\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open URL\",\"color\":\"blue\"}]}}},{\"text\":\"",
|
||||||
(greentext ? "dark_green"
|
(greentext ? "green"
|
||||||
: player.CurrentChannel.Color),
|
: player.CurrentChannel.Color),
|
||||||
url, (greentext ? "dark_green"
|
url, (greentext ? "green"
|
||||||
: player.CurrentChannel.Color),
|
: player.CurrentChannel.Color),
|
||||||
url));
|
url));
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
json.append(String.format("{\"text\":\"%s\",\"color\":\"%s\"}]",
|
json.append(String.format("{\"text\":\"%s\",\"color\":\"%s\"}]",
|
||||||
finalstring, (greentext ? "dark_green"
|
finalstring, (greentext ? "green"
|
||||||
: player.CurrentChannel.Color)));
|
: player.CurrentChannel.Color)));
|
||||||
if (player.CurrentChannel.equals(Channel.TownChat)
|
if (player.CurrentChannel.equals(Channel.TownChat)
|
||||||
|| player.CurrentChannel.equals(Channel.NationChat))
|
|| player.CurrentChannel.equals(Channel.NationChat))
|
||||||
|
@ -661,11 +661,13 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
private boolean ActiveF = false;
|
private boolean ActiveF = false;
|
||||||
private int FCount = 0;
|
private int FCount = 0;
|
||||||
private MaybeOfflinePlayer FPlayer = null;
|
private MaybeOfflinePlayer FPlayer = null;
|
||||||
|
|
||||||
private Timer Ftimer;
|
private Timer Ftimer;
|
||||||
|
public static int AlphaDeaths;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerDeath(PlayerDeathEvent e) {
|
public void onPlayerDeath(PlayerDeathEvent e) {
|
||||||
|
if (e.getEntity().getName().equals("Alpha_Bacca44"))
|
||||||
|
AlphaDeaths++;
|
||||||
if (!Minigames.plugin.pdata.getMinigamePlayer(e.getEntity())
|
if (!Minigames.plugin.pdata.getMinigamePlayer(e.getEntity())
|
||||||
.isInMinigame() && new Random().nextBoolean()) {
|
.isInMinigame() && new Random().nextBoolean()) {
|
||||||
if (Ftimer != null)
|
if (Ftimer != null)
|
||||||
|
|
|
@ -242,7 +242,8 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
break;
|
break;
|
||||||
case "unknown":
|
case "unknown":
|
||||||
if (text.equals("-1")) // If true, only non-presser/can't press; if
|
if (text.equals("-1")) // If true, only non-presser/can't press; if
|
||||||
// false, any flair
|
// false, any flair (but we can still detect
|
||||||
|
// can't press)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (CheckForJoinDate(p)) {
|
if (CheckForJoinDate(p)) {
|
||||||
|
@ -256,8 +257,18 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
|
if (CheckForJoinDate(p)) {
|
||||||
p.FlairState = FlairStates.Commented; // Flair unknown
|
p.FlairState = FlairStates.Commented; // Flair unknown
|
||||||
p.SetFlairColor(0);
|
p.SetFlairColor(0);
|
||||||
|
} else {
|
||||||
|
p.SetFlair(0xf, "--");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
p.FlairState = FlairStates.Commented; // Flair unknown
|
||||||
|
p.SetFlairColor(0);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
|
@ -324,6 +335,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
.getDouble("notificationpitch");
|
.getDouble("notificationpitch");
|
||||||
AnnounceTime = yc.getInt("announcetime");
|
AnnounceTime = yc.getInt("announcetime");
|
||||||
AnnounceMessages.addAll(yc.getStringList("announcements"));
|
AnnounceMessages.addAll(yc.getStringList("announcements"));
|
||||||
|
PlayerListener.AlphaDeaths = yc.getInt("alphadeaths");
|
||||||
}
|
}
|
||||||
System.out.println("The Button Minecraft plugin loaded files!");
|
System.out.println("The Button Minecraft plugin loaded files!");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -345,6 +357,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
|
||||||
yc.set("notificationpitch", PlayerListener.NotificationPitch);
|
yc.set("notificationpitch", PlayerListener.NotificationPitch);
|
||||||
yc.set("announcetime", AnnounceTime);
|
yc.set("announcetime", AnnounceTime);
|
||||||
yc.set("announcements", AnnounceMessages);
|
yc.set("announcements", AnnounceMessages);
|
||||||
|
yc.set("alphadeaths", PlayerListener.AlphaDeaths);
|
||||||
yc.save(file);
|
yc.save(file);
|
||||||
System.out.println("The Button Minecraft plugin saved files!");
|
System.out.println("The Button Minecraft plugin saved files!");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue