Skip to content

Commit

Permalink
Improve the precision of in_ms and in_s
Browse files Browse the repository at this point in the history
Durations are based on ticks, not seconds. In theory, at least.
  • Loading branch information
mcmonkey4eva committed Oct 14, 2014
1 parent fc8e0b0 commit 0b03f0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/aufdemrand/denizen/objects/Duration.java
Expand Up @@ -396,7 +396,7 @@ public String getAttribute(Attribute attribute) {
// returns the number of seconds in the Duration.
// -->
if (attribute.startsWith("in_seconds") || attribute.startsWith("seconds"))
return new Element(seconds)
return new Element(getTicks() / 20)
.getAttribute(attribute.fulfill(1));

// <--[tag]
Expand All @@ -406,7 +406,7 @@ public String getAttribute(Attribute attribute) {
// returns the number of milliseconds in the Duration.
// -->
if (attribute.startsWith("in_milliseconds") || attribute.startsWith("milliseconds"))
return new Element(seconds * 1000)
return new Element(getTicks() * (1000 / 20))
.getAttribute(attribute.fulfill(1));

// <--[tag]
Expand Down

0 comments on commit 0b03f0c

Please sign in to comment.