mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-26 17:31:38 +01:00
Coop message, leaderboard tiny code cleanup, coop saving, version
This commit is contained in:
parent
cd5cdba69b
commit
eb4c4c9d6f
@ -2,7 +2,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
group 'com.songoda.fabledskyblock'
|
group 'com.songoda.fabledskyblock'
|
||||||
version 'Build-77'
|
version 'Build-78'
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
@ -102,6 +102,12 @@ public class CoopCommand extends SubCommand {
|
|||||||
|
|
||||||
messageManager.sendMessage(player, configLoad.getString("Command.Island.Coop.Added.Message")
|
messageManager.sendMessage(player, configLoad.getString("Command.Island.Coop.Added.Message")
|
||||||
.replace("%player", targetPlayerName));
|
.replace("%player", targetPlayerName));
|
||||||
|
|
||||||
|
if (targetPlayer != null) {
|
||||||
|
messageManager.sendMessage(targetPlayer, configLoad.getString("Command.Island.Coop.AddedTarget.Message")
|
||||||
|
.replace("%player", player.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
soundManager.playSound(player, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,10 +445,12 @@ public class Island {
|
|||||||
|
|
||||||
public void addCoopPlayer(UUID uuid) {
|
public void addCoopPlayer(UUID uuid) {
|
||||||
coopPlayers.add(uuid);
|
coopPlayers.add(uuid);
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(skyblock, this::save);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCoopPlayer(UUID uuid) {
|
public void removeCoopPlayer(UUID uuid) {
|
||||||
coopPlayers.remove(uuid);
|
coopPlayers.remove(uuid);
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(skyblock, this::save);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCoopPlayer(UUID uuid) {
|
public boolean isCoopPlayer(UUID uuid) {
|
||||||
|
@ -49,9 +49,7 @@ public class LeaderboardManager {
|
|||||||
boolean enableExemptions = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"))
|
boolean enableExemptions = skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml"))
|
||||||
.getFileConfiguration().getBoolean("Island.Leaderboard.Exemptions.Enable");
|
.getFileConfiguration().getBoolean("Island.Leaderboard.Exemptions.Enable");
|
||||||
|
|
||||||
for (int i = 0; i < visitManager.getIslands().size(); i++) {
|
for (UUID ownerUUID : visitManager.getIslands().keySet()) {
|
||||||
UUID ownerUUID = (UUID) visitManager.getIslands().keySet().toArray()[i];
|
|
||||||
|
|
||||||
if (enableExemptions && economyManager.hasPermission(worldManager.getWorld(IslandWorld.Normal).getName(),
|
if (enableExemptions && economyManager.hasPermission(worldManager.getWorld(IslandWorld.Normal).getName(),
|
||||||
Bukkit.getOfflinePlayer(ownerUUID),
|
Bukkit.getOfflinePlayer(ownerUUID),
|
||||||
"fabledskyblock.top.exempt"))
|
"fabledskyblock.top.exempt"))
|
||||||
@ -93,21 +91,18 @@ public class LeaderboardManager {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Level:
|
case Level:
|
||||||
for (int i = 0; i < visitManager.getIslands().size(); i++) {
|
for (UUID ownerUUID : visitManager.getIslands().keySet()) {
|
||||||
UUID ownerUUID = (UUID) visitManager.getIslands().keySet().toArray()[i];
|
|
||||||
Visit visit = visitManager.getIslands().get(ownerUUID);
|
Visit visit = visitManager.getIslands().get(ownerUUID);
|
||||||
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, visit.getLevel().getLevel()));
|
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, visit.getLevel().getLevel()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Bank:
|
case Bank:
|
||||||
for (int i = 0; i < visitManager.getIslands().size(); i++) {
|
for (UUID ownerUUID : visitManager.getIslands().keySet()) {
|
||||||
UUID ownerUUID = (UUID) visitManager.getIslands().keySet().toArray()[i];
|
|
||||||
Visit visit = visitManager.getIslands().get(ownerUUID);
|
Visit visit = visitManager.getIslands().get(ownerUUID);
|
||||||
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, (long)visit.getBankBalance()));
|
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, (long)visit.getBankBalance()));
|
||||||
}
|
}
|
||||||
case Votes:
|
case Votes:
|
||||||
for (int i = 0; i < visitManager.getIslands().size(); i++) {
|
for (UUID ownerUUID : visitManager.getIslands().keySet()) {
|
||||||
UUID ownerUUID = (UUID) visitManager.getIslands().keySet().toArray()[i];
|
|
||||||
Visit visit = visitManager.getIslands().get(ownerUUID);
|
Visit visit = visitManager.getIslands().get(ownerUUID);
|
||||||
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, visit.getVoters().size()));
|
leaderboardPlayers.add(new LeaderboardPlayer(ownerUUID, visit.getVoters().size()));
|
||||||
}
|
}
|
||||||
@ -150,14 +145,9 @@ public class LeaderboardManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Leaderboard getLeaderboardFromPosition(Leaderboard.Type type, int position) {
|
public Leaderboard getLeaderboardFromPosition(Leaderboard.Type type, int position) {
|
||||||
for (Leaderboard leaderboardPlayerList : leaderboardStorage) {
|
for (Leaderboard leaderboardPlayerList : leaderboardStorage)
|
||||||
if (leaderboardPlayerList.getType() == type) {
|
if (leaderboardPlayerList.getType() == type && leaderboardPlayerList.getPosition() == position)
|
||||||
if (leaderboardPlayerList.getPosition() == position) {
|
return leaderboardPlayerList;
|
||||||
return leaderboardPlayerList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +198,7 @@ public class Interact implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
level.setMaterialAmount(materials.name(), materialAmount + 1);
|
level.setMaterialAmount(materials.name(), materialAmount + 1);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block.getType() == Materials.SWEET_BERRY_BUSH.parseMaterial()) {
|
if (block.getType() == Materials.SWEET_BERRY_BUSH.parseMaterial()) {
|
||||||
|
@ -325,6 +325,8 @@ Command:
|
|||||||
Message: '&bSkyBlock &8| &cError&8: &eYou cannot coop yourself because you''re already a Member of the Island.'
|
Message: '&bSkyBlock &8| &cError&8: &eYou cannot coop yourself because you''re already a Member of the Island.'
|
||||||
Added:
|
Added:
|
||||||
Message: '&bSkyBlock &8| &aInfo&8: &eYou have cooped &d%player&e.'
|
Message: '&bSkyBlock &8| &aInfo&8: &eYou have cooped &d%player&e.'
|
||||||
|
AddedTarget:
|
||||||
|
Message: '&bSkyBlock &8| &aInfo&8: &eYou have been cooped on &d%player''s&e island.'
|
||||||
Banned:
|
Banned:
|
||||||
Message: '&bSkyBlock &8| &cError&8: &eYou cannot coop a banned player.'
|
Message: '&bSkyBlock &8| &cError&8: &eYou cannot coop a banned player.'
|
||||||
Permission:
|
Permission:
|
||||||
|
Loading…
Reference in New Issue
Block a user