mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 12:15:59 +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>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>quests-dist</artifactId>
|
<artifactId>quests-dist</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>quests-main</artifactId>
|
<artifactId>quests-main</artifactId>
|
||||||
|
|
||||||
|
@ -2821,6 +2821,11 @@ public class Quester {
|
|||||||
getQuestData(quest).delayOver = false;
|
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) {
|
public long getStageTime(Quest quest) {
|
||||||
if (getQuestData(quest).delayTimeLeft > -1) {
|
if (getQuestData(quest).delayTimeLeft > -1) {
|
||||||
return getQuestData(quest).delayTimeLeft - (System.currentTimeMillis() - getQuestData(quest).delayStartTime);
|
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;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +187,12 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
msg = msg.replace("<quest>", q.getName());
|
msg = msg.replace("<quest>", q.getName());
|
||||||
player.sendMessage(ChatColor.GOLD + msg);
|
player.sendMessage(ChatColor.GOLD + msg);
|
||||||
plugin.showObjectives(q, quester, false);
|
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 {
|
} else {
|
||||||
|
@ -132,7 +132,7 @@ public class ItemUtil {
|
|||||||
+ "in accordance with https://bit.ly/2BkBNNN");
|
+ "in accordance with https://bit.ly/2BkBNNN");
|
||||||
return new ItemStack(Material.matchMaterial(material, true), amount, durability);
|
return new ItemStack(Material.matchMaterial(material, true), amount, durability);
|
||||||
} catch (Exception e2) {
|
} 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();
|
e2.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
4
pom.xml
4
pom.xml
@ -6,12 +6,12 @@
|
|||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
|
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
<name>quests</name>
|
<name>quests</name>
|
||||||
<url>https://github.com/PikaMug/Quests/</url>
|
<url>https://github.com/PikaMug/Quests/</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>3.7.4</revision>
|
<revision>3.7.5</revision>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>me.blackvein.quests</groupId>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests-parent</artifactId>
|
<artifactId>quests-parent</artifactId>
|
||||||
<version>3.7.4</version>
|
<version>3.7.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
Loading…
Reference in New Issue
Block a user