π₯οΈFor Developers
Lobby & Game
Obtain LeaderBoard RBucket
String leaderboardName = "bedwars_wins_daily";
RBucket<LeaderBoard> redisBoard = Basement.rclient().getBucket(leaderboardName);
if (redisBoard.isExists()) {
LeaderBoard board = redisBoard.get();|
...
}
Obtain Statistic Class
UUID uniqueId = null;
Statistics stats = Basement.rclient().getLiveObjectService().get(Statistics.class, uniqueId.toString());
if (stats == null) {
System.out.println("Statistics not found");
return;
}
int wins = statistics.get(StatsScope.SOLO, StatsType.WIN);
...
Obtain UserData Class
UUID uniqueId = null;
UserData userData = Basement.rclient().getLiveObjectService().get(UserData.class, uniqueId.toString());
if (userData == null) {
System.out.println("UserData not found");
return;
}
int level = userData.getLevel();
...
Obtain SharedBedwarsMatch Class
SharedBedwarsMatch match = Basement.redis().redissonClient().getLiveObjectService().get(SharedBedwarsMatch.class, statistics.getMatch());
if (match == null) {
System.out.println("Match not found");
return;
}
boolean isPrivateGame = match.getHost() != null;
match.spectate("Username");
...
Game Only
Obtain MatchPlayer Class
Player player = null;
MatchPlayer matchPlayer = MatchPlayer.get(player.getUniqueId());
Statistics statistics = matchPlayer.getStatistics();
Arena arena = matchPlayer.getArena();
matchPlayer.resetStats(); // Reset stats for the current game
...
Last updated