Show time remaining for stage delay in /quest, fixes #692. Bump version

This commit is contained in:
PikaMug 2019-07-09 01:56:41 -04:00
parent 0d3448ea14
commit f27897ae14
10 changed files with 23 additions and 10 deletions

2
dist/pom.xml vendored
View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
</parent>
<artifactId>quests-dist</artifactId>
<packaging>pom</packaging>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
</parent>
<artifactId>quests-main</artifactId>

View File

@ -2821,6 +2821,11 @@ public class Quester {
getQuestData(quest).delayOver = false;
}
/**
* Get remaining stage delay time
* @param quest The quest of which the timer is for
* @return Remaining time in milliseconds
*/
public long getStageTime(Quest quest) {
if (getQuestData(quest).delayTimeLeft > -1) {
return getQuestData(quest).delayTimeLeft - (System.currentTimeMillis() - getQuestData(quest).delayStartTime);

View File

@ -3029,7 +3029,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
}
}
message = message.substring(1, message.length() - 1);
if (message.length() > 0) {
message = message.substring(1, message.length() - 1);
}
return message;
}

View File

@ -187,6 +187,12 @@ public class CmdExecutor implements CommandExecutor {
msg = msg.replace("<quest>", q.getName());
player.sendMessage(ChatColor.GOLD + msg);
plugin.showObjectives(q, quester, false);
} else {
long time = plugin.getQuester(player.getUniqueId()).getStageTime(q);
String msg = ChatColor.YELLOW + "(" + Lang.get(player, "delay") + ") " + ChatColor.RED + Lang.get(player, "plnTooEarly");
msg = msg.replace("<quest>", q.getName());
msg = msg.replace("<time>", Quests.getTime(time));
player.sendMessage(msg);
}
}
} else {

View File

@ -132,7 +132,7 @@ public class ItemUtil {
+ "in accordance with https://bit.ly/2BkBNNN");
return new ItemStack(Material.matchMaterial(material, true), amount, durability);
} catch (Exception e2) {
Bukkit.getLogger().severe("Unable to use LEGACY_" + material + " for as item name");
Bukkit.getLogger().severe("Unable to use LEGACY_" + material + " as item name");
e2.printStackTrace();
return null;
}

View File

@ -6,12 +6,12 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
<name>quests</name>
<url>https://github.com/PikaMug/Quests/</url>
<properties>
<revision>3.7.4</revision>
<revision>3.7.5</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
</parent>
<properties>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>3.7.4</version>
<version>3.7.5</version>
</parent>
<properties>