Skip to content

Commit f549397

Browse files
committed
Merge branch 'api6' into api7
2 parents 8317a5e + 5e5c52f commit f549397

File tree

6 files changed

+53
-3
lines changed

6 files changed

+53
-3
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply from: project.file("gradle/versions.gradle")
22

33
buildscript {
4-
ext.kotlinVersion = '1.2.30'
4+
ext.kotlinVersion = '1.2.41'
55
repositories {
66
jcenter()
77
mavenCentral()
@@ -39,7 +39,7 @@ apply from: project.file("gradle/publish.gradle")
3939
apply from: project.file("gradle/foxcore.gradle")
4040

4141
dependencies {
42-
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
42+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
4343
compile "org.spongepowered:spongeapi:$spongeVersion"
4444
compile 'com.flowpowered:flow-math:1.0.3'
4545
compile 'org.mapdb:mapdb:3.0.5'

gradle/wrapper/gradle-wrapper.jar

0 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Thu Mar 15 17:03:00 PDT 2018
1+
#Sun May 27 00:37:29 PDT 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package net.foxdenstudio.sponge.foxcore.plugin.scoreboard;
2+
3+
public class FoxHudCard {
4+
5+
6+
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package net.foxdenstudio.sponge.foxcore.plugin.scoreboard;
2+
3+
public class FoxScoreboard {
4+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package net.foxdenstudio.sponge.foxcore.plugin.scoreboard;
2+
3+
import net.foxdenstudio.sponge.foxcore.common.util.WeakCacheMap;
4+
import org.spongepowered.api.entity.living.player.Player;
5+
6+
import java.util.Deque;
7+
import java.util.LinkedList;
8+
import java.util.Map;
9+
import java.util.Optional;
10+
11+
public class FoxScoreboardManager {
12+
13+
private static FoxScoreboardManager instance = new FoxScoreboardManager();
14+
15+
Map<Player, Deque<FoxScoreboard>> playerScoreboards = new WeakCacheMap<>((k, m) -> {
16+
if(k instanceof Player){
17+
Player player = (Player) k;
18+
Deque<FoxScoreboard> deque = new LinkedList<>();
19+
m.put(player, deque);
20+
return deque;
21+
} else return null;
22+
});
23+
24+
public static FoxScoreboardManager getInstance() {
25+
return instance;
26+
}
27+
28+
public void display(Player player, FoxScoreboard scoreboard) {
29+
Deque<FoxScoreboard> scoreboards = playerScoreboards.get(player);
30+
scoreboards.remove(scoreboard);
31+
scoreboards.addFirst(scoreboard);
32+
//player.setScoreboard(scoreboard);
33+
}
34+
35+
public Optional<FoxScoreboard> getActiveScoreboard(Player player) {
36+
return Optional.ofNullable(playerScoreboards.get(player).peekFirst());
37+
}
38+
39+
}

0 commit comments

Comments
 (0)