mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 02:25:42 +01:00
Show time remaining for stage delay in /quest, fixes #692. Bump version
This commit is contained in:
parent
0d3448ea14
commit
f27897ae14
2
dist/pom.xml
vendored
2
dist/pom.xml
vendored
@ -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>
|
||||
|
@ -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>
|
||||
|
||||
|
@ -2820,7 +2820,12 @@ 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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
4
pom.xml
4
pom.xml
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user