add MapData#sendInfo and /mapinfo (alias /info)

This commit is contained in:
Spencer 2017-12-30 17:06:45 -05:00 committed by Alexander Meech
parent 57e22e9d24
commit 1a1a52c0da
3 changed files with 35 additions and 3 deletions

View File

@ -2,6 +2,9 @@ package mineplex.mapparser;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayerBase;
import mineplex.core.common.util.UtilWorld;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -198,4 +201,11 @@ public class MapData
{
return !_locked || (player.isOp() || AdminList.contains(player.getName()));
}
public void sendInfo(Player player)
{
UtilPlayerBase.message(player, F.value("Map Name", MapName));
UtilPlayerBase.message(player, F.value("Author", MapCreator));
UtilPlayerBase.message(player, F.value("Game Type", MapGameType.GetName()));
}
}

View File

@ -126,9 +126,7 @@ public class MapCommand extends BaseCommand
MapData data = getPlugin().getData(worldName);
UtilPlayerBase.message(player, F.value("Map Name", data.MapName));
UtilPlayerBase.message(player, F.value("Author", data.MapCreator));
UtilPlayerBase.message(player, F.value("Game Type", data.MapGameType.GetName()));
data.sendInfo(player);
return true;
}
}

View File

@ -0,0 +1,24 @@
package mineplex.mapparser.command;
import org.bukkit.entity.Player;
import mineplex.mapparser.MapData;
import mineplex.mapparser.MapParser;
import mineplex.mapparser.command.BaseCommand;
public class MapInfoCommand extends BaseCommand
{
public MapInfoCommand(MapParser plugin)
{
super(plugin, "mapinfo", "info");
}
@Override
public boolean execute(Player player, String alias, String[] args)
{
MapData data = getPlugin().getData(player.getWorld().getName());
data.sendInfo(player);
return false;
}
}