mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2024-06-27 16:30:50 +00:00
version bump
This commit is contained in:
parent
7d68789cf2
commit
42017b6400
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Marriage v2.0.6",
|
"name": "Marriage v2.0.7",
|
||||||
"type": "release",
|
"type": "release",
|
||||||
"gameVersion": "1.8.8",
|
"gameVersion": "1.8.8",
|
||||||
"downloadURL": "http://ci.lenis0012.com/job/Marriage/37/artifact/target/Marriage-Spigot-2.0.6.jar"
|
"downloadURL": "http://ci.lenis0012.com/job/Marriage/56/artifact/target/Marriage-Spigot-2.0.7.jar"
|
||||||
}
|
}
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<groupId>com.lenis0012.bukkit</groupId>
|
<groupId>com.lenis0012.bukkit</groupId>
|
||||||
<artifactId>marriage2</artifactId>
|
<artifactId>marriage2</artifactId>
|
||||||
<version>2.0.7-SNAPSHOT</version>
|
<version>2.0.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Marriage</name>
|
<name>Marriage</name>
|
||||||
<url>http://dev.bukkit.org/server-mods/marriage-reloaded/</url>
|
<url>http://dev.bukkit.org/server-mods/marriage-reloaded/</url>
|
||||||
|
|
|
@ -2,15 +2,19 @@ package com.lenis0012.bukkit.marriage2.internal;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.lenis0012.pluginutils.PluginHolder;
|
import com.lenis0012.pluginutils.PluginHolder;
|
||||||
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
|
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
|
||||||
import com.lenis0012.pluginutils.modules.packets.PacketModule;
|
import com.lenis0012.pluginutils.modules.packets.PacketModule;
|
||||||
|
|
||||||
import com.lenis0012.bukkit.marriage2.Marriage;
|
import com.lenis0012.bukkit.marriage2.Marriage;
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
public class MarriagePlugin extends PluginHolder {
|
public class MarriagePlugin extends PluginHolder {
|
||||||
private static MarriageCore core;
|
private static MarriageCore core;
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class ChatListener implements Listener {
|
||||||
.replace("{name}", player.getDisplayName())
|
.replace("{name}", player.getDisplayName())
|
||||||
.replace("{message}", event.getMessage())
|
.replace("{message}", event.getMessage())
|
||||||
.replace("{heart}", "\u2764");
|
.replace("{heart}", "\u2764");
|
||||||
|
message = formatIcons(message);
|
||||||
message = ChatColor.translateAlternateColorCodes('&', message);
|
message = ChatColor.translateAlternateColorCodes('&', message);
|
||||||
|
|
||||||
Player partner = Bukkit.getPlayer(mp.getPartner().getUniqueId());
|
Player partner = Bukkit.getPlayer(mp.getPartner().getUniqueId());
|
||||||
|
@ -51,6 +52,7 @@ public class ChatListener implements Listener {
|
||||||
if(!Settings.FORCE_FORMAT.value()) return;
|
if(!Settings.FORCE_FORMAT.value()) return;
|
||||||
event.setFormat("{marriage_status}" + event.getFormat()); // Enforce marriage format
|
event.setFormat("{marriage_status}" + event.getFormat()); // Enforce marriage format
|
||||||
|
|
||||||
|
// Marriage status
|
||||||
if(format.contains("{marriage_status}")) {
|
if(format.contains("{marriage_status}")) {
|
||||||
String status = "";
|
String status = "";
|
||||||
if(mplayer.isMarried()) {
|
if(mplayer.isMarried()) {
|
||||||
|
@ -58,26 +60,28 @@ public class ChatListener implements Listener {
|
||||||
status = Settings.CHAT_FORMAT.value()
|
status = Settings.CHAT_FORMAT.value()
|
||||||
.replace("{heart}", "\u2764")
|
.replace("{heart}", "\u2764")
|
||||||
.replace("{partner}", partner);
|
.replace("{partner}", partner);
|
||||||
|
status = formatIcons(status);
|
||||||
|
|
||||||
status = ChatColor.translateAlternateColorCodes('&', status);
|
status = ChatColor.translateAlternateColorCodes('&', status);
|
||||||
}
|
}
|
||||||
event.setFormat(format.replace("{marriage_status}", status));
|
event.setFormat(format.replace("{marriage_status}", status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gender format
|
||||||
|
if(format.contains("{marriage_gender}")) {
|
||||||
|
String gender = mplayer.getGender().getChatPrefix();
|
||||||
|
gender = formatIcons(gender);
|
||||||
|
gender = ChatColor.translateAlternateColorCodes('&', gender);
|
||||||
|
event.setFormat(format.replace("{marriage_gender}", gender));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleChat(AsyncPlayerChatEvent event, MPlayer mp) {
|
private String formatIcons(String text) {
|
||||||
if(!mp.isMarried()) {
|
return text.replace("{heart}", "\u2764")
|
||||||
return;
|
.replace("{icon:heart}", "\u2764")
|
||||||
}
|
.replace("{icon:male}", "\u2642")
|
||||||
|
.replace("{icon:female}", "\u2640")
|
||||||
// Set format
|
.replace("{icon:genderless}", "\u26B2");
|
||||||
String format = Settings.CHAT_FORMAT.value()
|
|
||||||
.replace("{name}", "%1$s")
|
|
||||||
.replace("{message}", "%2$s")
|
|
||||||
.replace("{original_format}", event.getFormat())
|
|
||||||
.replace("{heart}", "\u2764");
|
|
||||||
format = ChatColor.translateAlternateColorCodes('&', format);
|
|
||||||
event.setFormat(format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOnline(MPlayer mp) {
|
private boolean isOnline(MPlayer mp) {
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
[
|
[
|
||||||
"---[ Changelog ]---",
|
"---[ Changelog ]---",
|
||||||
"",
|
"",
|
||||||
"- Added 1.9/8 support",
|
"- Improved config documentation",
|
||||||
"",
|
"",
|
||||||
"- Fixed error on reload",
|
"- Added gender chat options",
|
||||||
"",
|
"",
|
||||||
"- Fixed db error on first use"
|
"- Improved large-scale UUID conversion"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"====[ DONATE ]====",
|
"====[ DONATE ]====",
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
"IGN: lenis",
|
"IGN: lenis",
|
||||||
"Twitter: @lenis0012",
|
"Twitter: @lenis0012",
|
||||||
"",
|
"",
|
||||||
"Report hugs!",
|
"Report bugs!",
|
||||||
"-lenis"
|
"-lenis"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue