# Added the alias '/island leaderboard [<Level|Votes>]' to directly open a leaderboard menu.
# Fixed ban message being sent to the player when they're not at the island they've been banned from.
# Fixed a spelling mistake with a message.
# Fixed signs showing debug message.
This commit is contained in:
Unknown 2018-12-01 02:07:29 +00:00
parent c5b789ce6d
commit 8ba12fee1e
6 changed files with 50 additions and 17 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>SkyBlock</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>32</version>
<version>34</version>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>

View File

@ -89,11 +89,11 @@ public class BanCommand extends SubCommand {
ban.save();
if (targetPlayer != null) {
messageManager.sendMessage(targetPlayer, configLoad.getString("Command.Island.Ban.Banned.Target.Message").replace("%player", player.getName()));
soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
for (Location.World worldList : Location.World.values()) {
if (LocationUtil.isLocationAtLocationRadius(targetPlayer.getLocation(), island.getLocation(worldList, Location.Environment.Island), island.getRadius())) {
messageManager.sendMessage(targetPlayer, configLoad.getString("Command.Island.Ban.Banned.Target.Message").replace("%player", player.getName()));
soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F);
LocationUtil.teleportPlayerToSpawn(targetPlayer);
break;

View File

@ -2,14 +2,19 @@ package me.goodandevil.skyblock.command.commands;
import java.io.File;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import me.goodandevil.skyblock.SkyBlock;
import me.goodandevil.skyblock.command.CommandManager;
import me.goodandevil.skyblock.command.SubCommand;
import me.goodandevil.skyblock.config.FileManager;
import me.goodandevil.skyblock.config.FileManager.Config;
import me.goodandevil.skyblock.command.CommandManager.Type;
import me.goodandevil.skyblock.menus.Leaderboard;
import me.goodandevil.skyblock.message.MessageManager;
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
import me.goodandevil.skyblock.sound.SoundManager;
import me.goodandevil.skyblock.utils.version.Sounds;
public class LeaderboardCommand extends SubCommand {
@ -24,16 +29,47 @@ public class LeaderboardCommand extends SubCommand {
@Override
public void onCommand(Player player, String[] args) {
PlayerDataManager playerDataManager = skyblock.getPlayerDataManager();
MessageManager messageManager = skyblock.getMessageManager();
SoundManager soundManager = skyblock.getSoundManager();
FileManager fileManager = skyblock.getFileManager();
Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml"));
FileConfiguration configLoad = config.getFileConfiguration();
if (playerDataManager.hasPlayerData(player)) {
if (skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Browse));
if (args.length == 0) {
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Browse));
} else {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Level));
}
} else if (args.length == 1) {
if (args[0].equalsIgnoreCase("level")) {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Level));
} else if (args[0].equalsIgnoreCase("votes")) {
if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration().getBoolean("Island.Visitor.Vote")) {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Votes));
} else {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Leaderboard.Disabled.Message"));
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
return;
}
} else {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Leaderboard.Invalid.Message"));
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
return;
}
} else {
playerDataManager.getPlayerData(player).setViewer(new Leaderboard.Viewer(Leaderboard.Viewer.Type.Level));
messageManager.sendMessage(player, configLoad.getString("Command.Island.Leaderboard.Invalid.Message"));
soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F);
return;
}
Leaderboard.getInstance().open(player);
skyblock.getSoundManager().playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
soundManager.playSound(player, Sounds.CHEST_OPEN.bukkitSound(), 1.0F, 1.0F);
}
}

View File

@ -6,7 +6,6 @@ import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.configuration.file.FileConfiguration;
@ -23,7 +22,6 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.material.Crops;
import me.goodandevil.skyblock.SkyBlock;
@ -50,11 +48,6 @@ public class Block implements Listener {
this.skyblock = skyblock;
}
@EventHandler
public void onSignChange(SignChangeEvent event) {
event.setLine(0, ChatColor.RED + "test");
}
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Player player = event.getPlayer();

View File

@ -31,6 +31,10 @@ Command:
Leaderboard:
Info:
Message: "&f&oOpens the Leaderboard menu of the top 10 Islands."
Invalid:
Message: "&bSkyBlock &8| &cError&8: &eInvalid: /island leaderboard [<Level|Votes>]"
Disabled:
Message: "&bSkyBlock &8| &cError&8: &eYou cannot view that leaderboard because that leaderboard is disabled."
Create:
Info:
Message: "&f&oOpens the Island Creator menu."
@ -592,7 +596,7 @@ Command:
Message: "&bSkyBlock &8| &cError&8: &eYou cannot peform that command because upgrades have been disabled."
Generator:
Info:
Message: "&f&oManager generators for coddlestone generators."
Message: "&f&oManager generators for cobblestone generators."
Permission:
Message: "&bSkyBlock &8| &cError&8: &eYou don't have permission to perform that command."
Disabled:

View File

@ -1,6 +1,6 @@
name: SkyBlock
main: me.goodandevil.skyblock.SkyBlock
version: 33
version: 34
api-version: 1.13
description: A unique SkyBlock plugin
author: GoodAndEvil