Always case insensitive
This commit is contained in:
parent
d9c6abe12b
commit
9068618e8c
@ -2,7 +2,7 @@ package com.massivecraft.mcore5.cmd.arg;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
public class ARStringMatchFullCI extends ARAbstractStringMatch
|
public class ARStringMatchFull extends ARAbstractStringMatch
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
@ -18,7 +18,7 @@ public class ARStringMatchFullCI extends ARAbstractStringMatch
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public ARStringMatchFullCI(String typename, Collection<Collection<String>> altColls)
|
public ARStringMatchFull(String typename, Collection<Collection<String>> altColls)
|
||||||
{
|
{
|
||||||
super(typename, altColls);
|
super(typename, altColls);
|
||||||
}
|
}
|
@ -1,25 +0,0 @@
|
|||||||
package com.massivecraft.mcore5.cmd.arg;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
public class ARStringMatchFullCS extends ARAbstractStringMatch
|
|
||||||
{
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// IMPLEMENTATION
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer matches(String arg, String alt)
|
|
||||||
{
|
|
||||||
return alt.equals(arg) ? 0 : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// CONSTRUCT
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
public ARStringMatchFullCS(String typename, Collection<Collection<String>> altColls)
|
|
||||||
{
|
|
||||||
super(typename, altColls);
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,7 +2,7 @@ package com.massivecraft.mcore5.cmd.arg;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
public class ARStringMatchStartCI extends ARAbstractStringMatch
|
public class ARStringMatchStart extends ARAbstractStringMatch
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
@ -27,7 +27,7 @@ public class ARStringMatchStartCI extends ARAbstractStringMatch
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public ARStringMatchStartCI(String typename, Collection<Collection<String>> altColls)
|
public ARStringMatchStart(String typename, Collection<Collection<String>> altColls)
|
||||||
{
|
{
|
||||||
super(typename, altColls);
|
super(typename, altColls);
|
||||||
}
|
}
|
@ -1,32 +0,0 @@
|
|||||||
package com.massivecraft.mcore5.cmd.arg;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
public class ARStringMatchStartCS extends ARAbstractStringMatch
|
|
||||||
{
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// IMPLEMENTATION
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer matches(String arg, String alt)
|
|
||||||
{
|
|
||||||
if (alt.startsWith(arg))
|
|
||||||
{
|
|
||||||
return alt.length() - arg.length();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// CONSTRUCT
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
public ARStringMatchStartCS(String typename, Collection<Collection<String>> altColls)
|
|
||||||
{
|
|
||||||
super(typename, altColls);
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,8 +11,8 @@ import com.massivecraft.mcore5.MCore;
|
|||||||
import com.massivecraft.mcore5.MPlugin;
|
import com.massivecraft.mcore5.MPlugin;
|
||||||
import com.massivecraft.mcore5.Predictate;
|
import com.massivecraft.mcore5.Predictate;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
|
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFullCI;
|
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFull;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStartCI;
|
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStart;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ArgReader;
|
import com.massivecraft.mcore5.cmd.arg.ArgReader;
|
||||||
import com.massivecraft.mcore5.util.MUtil;
|
import com.massivecraft.mcore5.util.MUtil;
|
||||||
import com.massivecraft.mcore5.util.PlayerUtil;
|
import com.massivecraft.mcore5.util.PlayerUtil;
|
||||||
@ -134,12 +134,12 @@ public class PlayerColl<E extends PlayerEntity<E>> extends Coll<E, String>
|
|||||||
|
|
||||||
public ArgReader<String> argReaderPlayerNameFull()
|
public ArgReader<String> argReaderPlayerNameFull()
|
||||||
{
|
{
|
||||||
return new ARStringMatchFullCI("player", this.forgeAltColls());
|
return new ARStringMatchFull("player", this.forgeAltColls());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgReader<String> argReaderPlayerNameStart()
|
public ArgReader<String> argReaderPlayerNameStart()
|
||||||
{
|
{
|
||||||
return new ARStringMatchStartCI("player", this.forgeAltColls());
|
return new ARStringMatchStart("player", this.forgeAltColls());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgReader<E> argReaderPlayerFull()
|
public ArgReader<E> argReaderPlayerFull()
|
||||||
|
@ -10,8 +10,8 @@ import org.bukkit.command.CommandSender;
|
|||||||
import com.massivecraft.mcore5.MPlugin;
|
import com.massivecraft.mcore5.MPlugin;
|
||||||
import com.massivecraft.mcore5.Predictate;
|
import com.massivecraft.mcore5.Predictate;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
|
import com.massivecraft.mcore5.cmd.arg.ARStringEntity;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFullCI;
|
import com.massivecraft.mcore5.cmd.arg.ARStringMatchFull;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStartCI;
|
import com.massivecraft.mcore5.cmd.arg.ARStringMatchStart;
|
||||||
import com.massivecraft.mcore5.cmd.arg.ArgReader;
|
import com.massivecraft.mcore5.cmd.arg.ArgReader;
|
||||||
import com.massivecraft.mcore5.mixin.Mixin;
|
import com.massivecraft.mcore5.mixin.Mixin;
|
||||||
import com.massivecraft.mcore5.util.MUtil;
|
import com.massivecraft.mcore5.util.MUtil;
|
||||||
@ -148,12 +148,12 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E, String>
|
|||||||
|
|
||||||
public ArgReader<String> argReaderSenderIdFull()
|
public ArgReader<String> argReaderSenderIdFull()
|
||||||
{
|
{
|
||||||
return new ARStringMatchFullCI("player", this.forgeAltColls());
|
return new ARStringMatchFull("player", this.forgeAltColls());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgReader<String> argReaderSenderIdStart()
|
public ArgReader<String> argReaderSenderIdStart()
|
||||||
{
|
{
|
||||||
return new ARStringMatchStartCI("player", this.forgeAltColls());
|
return new ARStringMatchStart("player", this.forgeAltColls());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgReader<E> argReaderEntityFull()
|
public ArgReader<E> argReaderEntityFull()
|
||||||
|
Loading…
Reference in New Issue
Block a user