TWoNLocator

Abandoned
Find your location using worldguard regions!

What is TWoNLocator

TWoNlocator is a plugin designed to help with player navigation on MMoRPG servers, through the server's use of WorldGuard regions. It can be used by running "/location" in chat, giving you a message telling you your region, correctly capitalised with support for spaces (replace anywhere a space should be using underscores)

 

Open Source!

This plugin is open source, the code is quite simple, but the concept is helpful and easy to understand.

The code can be found below

public boolean onCommand(CommandSender sndr, Command cmd, String label, String[] args) {
		
		String regionorig = "";
		String regionname = "";
		
		if(label.equalsIgnoreCase("location")) {
			if(!(sndr instanceof Player)) {
				sndr.sendMessage("Only players can use this command!");
			}
			else
			{
			Player p = Bukkit.getPlayerExact(sndr.getName());
			for(ProtectedRegion r : WGBukkit.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
				regionorig = r.getId().toString();
			}

			if(regionorig.isEmpty()) {
				p.sendMessage("§3§lTWoNRegionPrefix §b§oYou're in the wilderness of " + p.getWorld().getName() + ".");
			}
			else
			{
				String region = regionorig.replaceAll("_", " ");
				regionname = regionname + WordUtils.capitalizeFully(region);
				p.sendMessage("§3§lTWoNRegionPrefix §b§oYou're in " + regionname + ".");
			}
			}
		}
		
		return false;
	}

 Colors and command prefix can be changed by replacing

§3§lTWoNRegionPrefix §b§o

with your custom prefix and color layout. make sure to use a "§" instead of a "&" for color codes!

The TWoNLocator Team

profile avatar
  • 5
    Projects
  • 2.1K
    Downloads

More from Forge_User_15029963View all

  • TWONHelper project image

    TWONHelper

    • 339
    • Bukkit Plugins

    TWON custom helper plugin

    • 339
    • October 2, 2016
    • Bukkit Plugins
    • +1
  • ForceMinecart project image

    ForceMinecart

    • 380
    • Bukkit Plugins

    Forces players into minecarts

    • 380
    • September 18, 2016
    • Bukkit Plugins
    • +1
  • RankRedeem project image

    RankRedeem

    • 0
    • Bukkit Plugins

    use codes to redeem ranks

    • 0
    • July 21, 2016
    • Bukkit Plugins
    • +3
  • BlazebyWater project image

    BlazebyWater

    • 855
    • Bukkit Plugins

    blaze's killed by water drop their drops.

    • 855
    • July 21, 2016
    • Bukkit Plugins
  • TWONHelper project image

    TWONHelper

    • 339
    • Bukkit Plugins

    TWON custom helper plugin

    • 339
    • October 2, 2016
    • Bukkit Plugins
    • +1
  • ForceMinecart project image

    ForceMinecart

    • 380
    • Bukkit Plugins

    Forces players into minecarts

    • 380
    • September 18, 2016
    • Bukkit Plugins
    • +1
  • RankRedeem project image

    RankRedeem

    • 0
    • Bukkit Plugins

    use codes to redeem ranks

    • 0
    • July 21, 2016
    • Bukkit Plugins
    • +3
  • BlazebyWater project image

    BlazebyWater

    • 855
    • Bukkit Plugins

    blaze's killed by water drop their drops.

    • 855
    • July 21, 2016
    • Bukkit Plugins