mirror of
https://github.com/CarmJos/UltraDepository.git
synced 2026-06-04 16:48:21 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 988fe600ce |
@@ -15,7 +15,7 @@
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<artifactId>ultradepository</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2.1</version>
|
||||
<version>1.2.2</version>
|
||||
|
||||
<name>UltraDepository</name>
|
||||
<description>超级仓库插件,支持设定不同物品的存储仓库。</description>
|
||||
|
||||
@@ -117,7 +117,7 @@ public class UserData {
|
||||
|
||||
|
||||
public Date getDate() {
|
||||
return new Date(DateIntUtil.getDateMillis(getDateInt()));
|
||||
return DateIntUtil.getDate(getDateInt());
|
||||
}
|
||||
|
||||
public int getDateInt() {
|
||||
|
||||
@@ -22,10 +22,14 @@ public class DateIntUtil {
|
||||
}
|
||||
|
||||
public static long getDateMillis(int dateInt) {
|
||||
return getDate(dateInt).getTime();
|
||||
}
|
||||
|
||||
public static Date getDate(int dateInt) {
|
||||
try {
|
||||
return getFormat().parse(Integer.toString(dateInt)).getTime();
|
||||
} catch (ParseException e) {
|
||||
return System.currentTimeMillis();
|
||||
return (Date) getFormat().parse(Integer.toString(dateInt));
|
||||
} catch (ParseException | NumberFormatException e) {
|
||||
return new Date(System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user