Add mosted valued player to the map
This commit is contained in:
parent
fb50acc4cc
commit
9acfa361ad
@ -19,7 +19,8 @@ public class BetaModule extends MiniPlugin
|
||||
"Thank you for playing Gem Hunters!",
|
||||
"Safezones are marked as green areas on your map!",
|
||||
"Players that have super valuable items show up on your map!",
|
||||
"Tell us what you want added next by voting on our features Trello! https://trello.com/b/ia1kjwcx"
|
||||
"Tell us what you want added next by voting on our features Trello! https://trello.com/b/ia1kjwcx",
|
||||
"The highest value player is shown on the map as a red pointer."
|
||||
};
|
||||
|
||||
private int _lastIndex;
|
||||
@ -30,7 +31,7 @@ public class BetaModule extends MiniPlugin
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void annouce(UpdateEvent event)
|
||||
public void announce(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.MIN_01)
|
||||
{
|
||||
|
@ -2,6 +2,7 @@ package mineplex.gemhunters.economy;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -29,6 +30,9 @@ public class EconomyModule extends MiniClientPlugin<Integer>
|
||||
|
||||
private final DonationManager _donation;
|
||||
|
||||
private Player _mostValuable;
|
||||
private int _mostGems;
|
||||
|
||||
public EconomyModule()
|
||||
{
|
||||
super("Economy");
|
||||
@ -117,6 +121,23 @@ public class EconomyModule extends MiniClientPlugin<Integer>
|
||||
return Get(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void Set(Player player, Integer data)
|
||||
{
|
||||
super.Set(player, data);
|
||||
|
||||
if (_mostValuable == null || _mostGems < data)
|
||||
{
|
||||
_mostValuable = player;
|
||||
_mostGems = data;
|
||||
}
|
||||
}
|
||||
|
||||
public Player getMostValuablePlayer()
|
||||
{
|
||||
return _mostValuable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer addPlayer(UUID uuid)
|
||||
{
|
||||
|
@ -1,29 +1,24 @@
|
||||
package mineplex.gemhunters.map;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.map.MapCanvas;
|
||||
import org.bukkit.map.MapCursor;
|
||||
import org.bukkit.map.MapCursorCollection;
|
||||
import org.bukkit.map.MapPalette;
|
||||
import org.bukkit.map.MapRenderer;
|
||||
import org.bukkit.map.MapView;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.party.Party;
|
||||
import mineplex.core.party.PartyManager;
|
||||
import mineplex.gemhunters.economy.EconomyModule;
|
||||
import mineplex.gemhunters.loot.LootModule;
|
||||
import mineplex.gemhunters.safezone.SafezoneModule;
|
||||
import mineplex.gemhunters.supplydrop.SupplyDrop;
|
||||
import mineplex.gemhunters.supplydrop.SupplyDropModule;
|
||||
import mineplex.gemhunters.worldevent.WorldEvent;
|
||||
import mineplex.gemhunters.worldevent.WorldEventModule;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.map.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <b>All item map code was adapted from Clans.</b><br>
|
||||
@ -35,6 +30,7 @@ public class ItemMapRenderer extends MapRenderer
|
||||
private static final int STANDARD_Y = 70;
|
||||
|
||||
private final ItemMapModule _itemMap;
|
||||
private final EconomyModule _economy;
|
||||
private final LootModule _loot;
|
||||
private final SafezoneModule _safezone;
|
||||
private final SupplyDropModule _supply;
|
||||
@ -47,6 +43,7 @@ public class ItemMapRenderer extends MapRenderer
|
||||
super(true);
|
||||
|
||||
_itemMap = Managers.require(ItemMapModule.class);
|
||||
_economy = Managers.require(EconomyModule.class);
|
||||
_loot = Managers.require(LootModule.class);
|
||||
_safezone = Managers.require(SafezoneModule.class);
|
||||
_supply = Managers.require(SupplyDropModule.class);
|
||||
@ -273,6 +270,10 @@ public class ItemMapRenderer extends MapRenderer
|
||||
{
|
||||
cursorDisplay = MapCursor.Type.GREEN_POINTER;
|
||||
}
|
||||
else if (other.equals(_economy.getMostValuablePlayer()))
|
||||
{
|
||||
cursorDisplay = MapCursor.Type.RED_POINTER;
|
||||
}
|
||||
|
||||
if (cursorDisplay == null)
|
||||
{
|
||||
|
@ -0,0 +1,17 @@
|
||||
package mineplex.gemhunters.progression;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.ReflectivelyCreateMiniPlugin;
|
||||
|
||||
@ReflectivelyCreateMiniPlugin
|
||||
public class ProgressionModule extends MiniPlugin
|
||||
{
|
||||
|
||||
private final Map<Integer, String> TITLES = ImmutableMap<Integer, String>().builder().build();
|
||||
|
||||
public ProgressionModule()
|
||||
{
|
||||
super("Progression");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user