Skip to content

Commit

Permalink
Version 3.0.7.2 up
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Oct 16, 2017
1 parent 1722382 commit d2e63d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@
<url>http://maven.sk89q.com/repo/</url>
</repository>
</repositories>
<version>3.0.7.1</version>
<version>3.0.7.2</version>
<description>This pom contains reference to a lot of servers that are not included in the GitHub repository because they are binary objects and maybe subject to copyright. These are used so that the NMS code that is used especially for pasting of islands can operate. Before you can build successfully, you need to put zero or more server binaries into the lib directory on your build machine. This version will match the version of the server you will use, for example 1.12. Then delete all the unneeded packages in com.wasteofplastic.askyblock.nms that you do not need or do not have. This will allow you to build. If you have no server binaries and delete all the packages, the Bukkit API will be used instead of NMS, which is slow and not recommended. Good luck!</description>
</project>
21 changes: 19 additions & 2 deletions src/com/wasteofplastic/askyblock/TopTen.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class TopTen implements Listener{
private static Map<UUID, Long> topTenList = new HashMap<UUID, Long>();
private static final int GUISIZE = 27; // Must be a multiple of 9
private static final int[] SLOTS = new int[] {4, 12, 14, 19, 20, 21, 22, 23, 24, 25};
private static final boolean DEBUG = false;
// Store this as a static because it's the same for everyone and saves memory cleanup
private static Inventory gui;

Expand Down Expand Up @@ -293,12 +294,16 @@ public static boolean topTenShow(final Player player) {
}
}
} else {
if (DEBUG)
plugin.getLogger().info("DEBUG: new GUI display");
// New GUI display (shown by default)
if (topTenList == null) topTenCreate();
topTenList = MapUtil.sortByValue(topTenList);
// Create the top ten GUI if it does not exist
if (gui == null) {
gui = Bukkit.createInventory(null, GUISIZE, plugin.myLocale(player.getUniqueId()).topTenGuiTitle);
if (DEBUG)
plugin.getLogger().info("DEBUG: creating GUI for the first time");
}
// Reset
gui.clear();
Expand All @@ -307,7 +312,8 @@ public static boolean topTenShow(final Player player) {
while (it.hasNext()) {
Map.Entry<UUID, Long> m = it.next();
UUID playerUUID = m.getKey();
//plugin.getLogger().info("DEBUG: " + i + ": " + playerUUID);
if (DEBUG)
plugin.getLogger().info("DEBUG: " + i + ": " + playerUUID);
// Remove from TopTen if the player is online and has the permission
Player entry = plugin.getServer().getPlayer(playerUUID);
boolean show = true;
Expand All @@ -316,6 +322,10 @@ public static boolean topTenShow(final Player player) {
it.remove();
show = false;
}
} else {
if (DEBUG)
plugin.getLogger().info("DEBUG: player not online, so no per check");

}
if (show) {
gui.setItem(SLOTS[i-1], getSkull(i, m.getValue(), playerUUID));
Expand All @@ -329,7 +339,14 @@ public static boolean topTenShow(final Player player) {
}

static ItemStack getSkull(int rank, Long long1, UUID player){
String playerName = plugin.getServer().getOfflinePlayer(player).getName();
if (DEBUG)
plugin.getLogger().info("DEBUG: Getting the skull");
String playerName = plugin.getPlayers().getName(player);
if (DEBUG) {
plugin.getLogger().info("DEBUG: playername = " + playerName);

plugin.getLogger().info("DEBUG: second chance = " + plugin.getPlayers().getName(player));
}
ItemStack playerSkull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
if (playerName == null) return null;
SkullMeta meta = (SkullMeta) playerSkull.getItemMeta();
Expand Down
2 changes: 1 addition & 1 deletion src/com/wasteofplastic/askyblock/panels/WarpPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void addWarp(UUID playerUUID) {
* @return Player skull item
*/
private ItemStack getSkull(UUID playerUUID) {
String playerName = plugin.getServer().getOfflinePlayer(playerUUID).getName();
String playerName = plugin.getPlayers().getName(playerUUID);
if (DEBUG)
plugin.getLogger().info("DEBUG: name of warp = " + playerName);
ItemStack playerSkull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
Expand Down

0 comments on commit d2e63d5

Please sign in to comment.