forked from xjboss/KCauldronX
Initial commit (Forge 1291).
This commit is contained in:
33
patches/net/minecraft/server/management/BanEntry.java.patch
Normal file
33
patches/net/minecraft/server/management/BanEntry.java.patch
Normal file
@ -0,0 +1,33 @@
|
||||
--- ../src-base/minecraft/net/minecraft/server/management/BanEntry.java
|
||||
+++ ../src-work/minecraft/net/minecraft/server/management/BanEntry.java
|
||||
@@ -76,4 +76,30 @@
|
||||
p_152641_1_.addProperty("expires", this.banEndDate == null ? "forever" : dateFormat.format(this.banEndDate));
|
||||
p_152641_1_.addProperty("reason", this.reason);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ public String getSource() {
|
||||
+ return this.bannedBy;
|
||||
+ }
|
||||
+
|
||||
+ public Date getCreated() {
|
||||
+ return this.banStartDate;
|
||||
+ }
|
||||
+
|
||||
+ private static Object checkExpiry(Object object, JsonObject jsonobject) {
|
||||
+ Date expires = null;
|
||||
+
|
||||
+ try {
|
||||
+ expires = jsonobject.has("expires") ? dateFormat.parse(jsonobject.get("expires").getAsString()) : null;
|
||||
+ } catch (ParseException ex) {
|
||||
+ // Guess we don't have a date
|
||||
+ }
|
||||
+
|
||||
+ if (expires == null || expires.after(new Date())) {
|
||||
+ return object;
|
||||
+ } else {
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
Reference in New Issue
Block a user