Make world sets case insensitive so people can WrItE HoWeVeR tHeY WaNt.

This commit is contained in:
Olof Larsson
2013-08-09 10:06:28 +02:00
parent 642f5c00d0
commit df9b10e074
3 changed files with 24 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.entity;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.TreeSet;
import org.bukkit.ChatColor;
import org.bukkit.event.EventPriority;
@ -131,8 +132,28 @@ public class MConf extends Entity<MConf>
public Set<String> playersWhoBypassAllProtection = new LinkedHashSet<String>();
public Set<String> worldsNoClaiming = new LinkedHashSet<String>();
public Set<String> getWorldsNoClaiming()
{
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
ret.addAll(this.worldsNoClaiming);
return ret;
}
public Set<String> worldsNoPowerLoss = new LinkedHashSet<String>();
public Set<String> getWorldsNoPowerLoss()
{
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
ret.addAll(this.worldsNoPowerLoss);
return ret;
}
public Set<String> worldsIgnorePvP = new LinkedHashSet<String>();
public Set<String> getWorldsIgnlorePvP()
{
Set<String> ret = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
ret.addAll(this.worldsIgnorePvP);
return ret;
}
// -------------------------------------------- //
// EXPLOITS

View File

@ -679,7 +679,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
{
if (newFaction.isNormal())
{
if (mconf.worldsNoClaiming.contains(ps.getWorld()))
if (mconf.getWorldsNoClaiming().contains(ps.getWorld()))
{
msg("<b>Sorry, this world has land claiming disabled.");
return false;