Change the visuals of the Billboards and of ELO's display in the stats menu to be more user friendly

This commit is contained in:
AlexTheCoder 2016-05-07 21:16:12 -04:00
parent f329051399
commit 34e8d65f4d
3 changed files with 21 additions and 8 deletions

View File

@ -10,6 +10,7 @@ import mineplex.core.common.util.Callback;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -340,24 +341,34 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
} }
/** /**
* Method for fetching the Itemstack that represents a player's division and their progress in it * Method for fetching the ItemStack that represents a player's division and their progress in it
*/ */
public ItemStack getVisual(int elo) public ItemStack getVisual(int elo)
{ {
ItemBuilder build = new ItemBuilder(_visual); ItemBuilder build = new ItemBuilder(_visual);
build.setTitle(C.cGreen + _disp); build.setTitle(C.cGreen + _disp);
int percentage = (elo * 100) / _maxElo; int percentage;
if (_maxElo == -1)
{
percentage = 100;
}
else
{
percentage = ((elo - Math.max(0, _minElo)) * 100) / (_maxElo - Math.max(0, _minElo));
}
String color = C.cYellow; String color = C.cYellow;
if (percentage <= 35) if (percentage <= 35)
{ {
color = C.cRed; color = C.cRed;
} else if (percentage >= 65) }
else if (percentage >= 65)
{ {
color = C.cGreen; color = C.cGreen;
} }
build.addLore(C.cGold + "Your Progress:", color + percentage + "% complete with this Division"); build.addLore(C.cGold + "Progress:", color + percentage + "% complete with this Division");
return build.build(); return build.build();
} }
} }

View File

@ -195,13 +195,15 @@ public class BrandingPost
} }
} }
Material type = Material.STEP;
byte data = (byte)5; byte data = (byte)5;
if (set.getBlockY() == corner4.getBlockY()) if (set.getBlockY() == corner4.getBlockY())
{ {
data = (byte)13; type = Material.SMOOTH_BRICK;
data = (byte)0;
} }
set.getBlock().setType(Material.STEP); set.getBlock().setType(type);
set.getBlock().setData(data); set.getBlock().setData(data);
} }
} }

View File

@ -31,7 +31,7 @@ public class BillboardManager extends MiniPlugin
private void generateBoards() private void generateBoards()
{ {
_branding.createPost(new Location(Bukkit.getWorld("world"), -5, 79, -35), BlockFace.SOUTH, "logitech.jpg"); _branding.createPost(new Location(Bukkit.getWorld("world"), -6, 77, -35), BlockFace.SOUTH, "logitech.jpg");
} }
@EventHandler @EventHandler