mirror of
https://github.com/barkeser2002/Tenet.git
synced 2026-09-25 10:46:08 +03:00
71 lines
2.6 KiB
Diff
71 lines
2.6 KiB
Diff
--- ../src-base/minecraft/net/minecraft/server/management/UserList.java
|
|
+++ ../src-work/minecraft/net/minecraft/server/management/UserList.java
|
|
@@ -119,6 +119,9 @@
|
|
|
|
protected String func_152681_a(Object p_152681_1_)
|
|
{
|
|
+ if(p_152681_1_ instanceof com.mojang.authlib.GameProfile){
|
|
+ return ((com.mojang.authlib.GameProfile)p_152681_1_).getName().toLowerCase();
|
|
+ }
|
|
return p_152681_1_.toString();
|
|
}
|
|
|
|
@@ -184,34 +187,36 @@
|
|
return this.field_152696_d.size() < 1;
|
|
}
|
|
|
|
+ // CraftBukkit start
|
|
+ public Collection<UserListEntry> getValues() {
|
|
+ return this.field_152696_d.values();
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
@SideOnly(Side.SERVER)
|
|
public void func_152679_g() throws IOException
|
|
{
|
|
- Collection collection = null;
|
|
- BufferedReader bufferedreader = null;
|
|
+ if (this.field_152695_c.exists()) {
|
|
+ Collection collection = null;
|
|
+ BufferedReader bufferedreader = null;
|
|
|
|
- try
|
|
- {
|
|
- bufferedreader = Files.newReader(this.field_152695_c, Charsets.UTF_8);
|
|
- collection = (Collection)this.field_152694_b.fromJson(bufferedreader, field_152698_f);
|
|
- }
|
|
- finally
|
|
- {
|
|
- IOUtils.closeQuietly(bufferedreader);
|
|
- }
|
|
+ try {
|
|
+ bufferedreader = Files.newReader(this.field_152695_c, Charsets.UTF_8);
|
|
+ collection = (Collection) this.field_152694_b.fromJson(bufferedreader, field_152698_f);
|
|
+ } finally {
|
|
+ IOUtils.closeQuietly(bufferedreader);
|
|
+ }
|
|
|
|
- if (collection != null)
|
|
- {
|
|
- this.field_152696_d.clear();
|
|
- Iterator iterator = collection.iterator();
|
|
+ if (collection != null) {
|
|
+ this.field_152696_d.clear();
|
|
+ Iterator iterator = collection.iterator();
|
|
|
|
- while (iterator.hasNext())
|
|
- {
|
|
- UserListEntry userlistentry = (UserListEntry)iterator.next();
|
|
+ while (iterator.hasNext()) {
|
|
+ UserListEntry userlistentry = (UserListEntry) iterator.next();
|
|
|
|
- if (userlistentry.func_152640_f() != null)
|
|
- {
|
|
- this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
|
|
+ if (userlistentry.func_152640_f() != null) {
|
|
+ this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry);
|
|
+ }
|
|
}
|
|
}
|
|
}
|