-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: * Fix for Spigot servers and join lag caused by Scoreboards
- Loading branch information
Showing
16 changed files
with
137 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/java/mc/alk/arena/controllers/joining/scoreboard/OfflinePlayerTeams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package mc.alk.arena.controllers.joining.scoreboard; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.OfflinePlayer; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* @author alkarin | ||
*/ | ||
class OfflinePlayerTeams { | ||
// static LoadingCache<String, OfflinePlayer> map = CacheBuilder.newBuilder() | ||
// .expireAfterAccess(10, TimeUnit.MINUTES) | ||
// .build( | ||
// new CacheLoader<String, OfflinePlayer>() { | ||
// @Override | ||
// public OfflinePlayer load(String key) { // no checked exception | ||
// return Bukkit.getOfflinePlayer(key); | ||
// } | ||
// }); | ||
// | ||
|
||
static HashMap<String, OfflinePlayer> map = new HashMap<String, OfflinePlayer>(); | ||
|
||
static OfflinePlayer getOfflinePlayer(String name) { | ||
OfflinePlayer op = map.get(name); | ||
if (op == null) { | ||
op = Bukkit.getOfflinePlayer(name); | ||
map.put(name, op); | ||
} | ||
return op; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.