mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2025-02-05 14:22:45 +00:00
Stable update | fix status
This commit is contained in:
parent
6fce5e1dec
commit
44c46f3fdc
7 changed files with 31 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Marriage v2.0.3",
|
||||
"name": "Marriage v2.0.4",
|
||||
"type": "release",
|
||||
"gameVersion": "1.8.8",
|
||||
"downloadURL": "http://ci.lenis0012.com/job/Marriage/28/artifact/target/Marriage-Spigot-2.0.3.jar"
|
||||
"downloadURL": "http://ci.lenis0012.com/job/Marriage/30/artifact/target/Marriage-Spigot-2.0.4.jar"
|
||||
}
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
|
||||
<groupId>com.lenis0012.bukkit</groupId>
|
||||
<artifactId>marriage2</artifactId>
|
||||
<version>2.0.4-SNAPSHOT</version>
|
||||
<version>2.0.4</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Marriage</name>
|
||||
<url>http://dev.bukkit.org/server-mods/marriage-reloaded/</url>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.lenis0012.bukkit.marriage2.commands;
|
||||
|
||||
import com.lenis0012.bukkit.marriage2.MPlayer;
|
||||
import com.lenis0012.bukkit.marriage2.Marriage;
|
||||
import com.lenis0012.bukkit.marriage2.config.Message;
|
||||
import com.lenis0012.bukkit.marriage2.config.Settings;
|
||||
import com.lenis0012.bukkit.marriage2.internal.MarriageBase;
|
||||
import com.lenis0012.bukkit.marriage2.internal.MarriageCommandExecutor;
|
||||
|
@ -14,12 +16,13 @@ public class CommandHelp extends Command {
|
|||
setMinArgs(-1);
|
||||
setHidden(true);
|
||||
setPermission(null);
|
||||
setAllowConsole(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
MarriageCommandExecutor commandExecutor = ((MarriageBase) marriage).getCommandExecutor();
|
||||
reply("Author: &alenis0012");
|
||||
// reply("Author: &alenis0012");
|
||||
reply("Version: &a" + marriage.getPlugin().getDescription().getVersion());
|
||||
reply("&2&m---------&2< &a&lMarriage Command Help &2>&2&m---------"); // Play around with the amount of dashes later
|
||||
for(Command command : commandExecutor.getSubCommands()) {
|
||||
|
@ -34,6 +37,13 @@ public class CommandHelp extends Command {
|
|||
message.tooltip("Cost: " + marriage.dependencies().getEconomyService().format(command.getExecutionFee()));
|
||||
}
|
||||
message.send(sender);
|
||||
|
||||
String status = Message.SINGLE.toString();
|
||||
if(player != null && player.hasMetadata("marriedTo")) {
|
||||
String partner = player.getMetadata("marriedTo").get(0).asString();
|
||||
status = String.format(Message.MARRIED_TO.toString(), partner);
|
||||
}
|
||||
reply(Message.STATUS, status);
|
||||
}
|
||||
|
||||
reply("&2&m--------------------------------------------"); // Play around with the amount of dashes later
|
||||
|
|
|
@ -38,7 +38,12 @@ public enum Message {
|
|||
UPDATE_AVAILABLE("&f&l[Marriage] &eThere is a new update available! %s for %s\nType &6/marry update &eto update now."),
|
||||
PAID_FEE("&a%s has been removed from your balance."),
|
||||
INSUFFICIENT_MONEY("&cYou have insufficient funds, costs %s"),
|
||||
PARTNER_FEE("&cYour partner couldn't pay the marriage fee!");
|
||||
PARTNER_FEE("&cYour partner couldn't pay the marriage fee!"),
|
||||
MARRIED_TO("&fmarried to %s"),
|
||||
|
||||
// WORDS
|
||||
STATUS("&aStatus: "),
|
||||
SINGLE("&fsingle");
|
||||
|
||||
private final String defaultMessage;
|
||||
private String message;
|
||||
|
|
|
@ -50,9 +50,12 @@ public class ChatListener implements Listener {
|
|||
final String format = event.getFormat();
|
||||
final Player player = event.getPlayer();
|
||||
final MPlayer mplayer = core.getMPlayer(player.getUniqueId());
|
||||
if(format.contains("{marriage_status}") && mplayer.isMarried()) {
|
||||
String status = Settings.CHAT_FORMAT.value().replace("{heart}", "\u2764");
|
||||
status = ChatColor.translateAlternateColorCodes('&', status);
|
||||
if(format.contains("{marriage_status}")) {
|
||||
String status = "";
|
||||
if(mplayer.isMarried()) {
|
||||
status = Settings.CHAT_FORMAT.value().replace("{heart}", "\u2764");
|
||||
status = ChatColor.translateAlternateColorCodes('&', status);
|
||||
}
|
||||
event.setFormat(format.replace("{marriage_status}", status));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ListQuery {
|
|||
return marriages;
|
||||
}
|
||||
|
||||
private String getName(DataManager db, UUID userId) {
|
||||
private static String getName(DataManager db, UUID userId) {
|
||||
// local uuid cache
|
||||
OfflinePlayer op = Bukkit.getOfflinePlayer(userId);
|
||||
if(op != null && op.getName() != null) {
|
||||
|
@ -83,7 +83,7 @@ public class ListQuery {
|
|||
return nameFromMojang(userId);
|
||||
}
|
||||
|
||||
private String nameFromMojang(UUID uuid) {
|
||||
private static String nameFromMojang(UUID uuid) {
|
||||
try {
|
||||
URL url = new URL(" https://api.mojang.com/user/profiles/" + uuid.toString().replace("-", "") + "/names");
|
||||
URLConnection connection = url.openConnection();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"version": "Marriage v2.0.3",
|
||||
"version": "Marriage v2.0.4",
|
||||
"data":
|
||||
[
|
||||
[
|
||||
"---[ Changelog ]---",
|
||||
"",
|
||||
"- Fixed null names in marry list",
|
||||
"- Fixed status showing as raw text",
|
||||
"",
|
||||
"- Fixed chat status showing for unmarried players",
|
||||
"- Added partner name to help command",
|
||||
"",
|
||||
"Next update: Gift shop"
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue