Mson replacement parent context.
This commit is contained in:
parent
6c8a07dc2f
commit
270f2bec05
@ -721,7 +721,7 @@ public class Mson implements Serializable
|
|||||||
MsonReplacement replacer = new MsonReplacement()
|
MsonReplacement replacer = new MsonReplacement()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Mson getReplacement(String match)
|
public Mson getReplacement(String match, Mson parent)
|
||||||
{
|
{
|
||||||
return replacement;
|
return replacement;
|
||||||
}
|
}
|
||||||
@ -746,11 +746,11 @@ public class Mson implements Serializable
|
|||||||
|
|
||||||
List<Mson> msons = new ArrayList<Mson>();
|
List<Mson> msons = new ArrayList<Mson>();
|
||||||
StringBuffer currentString = new StringBuffer();
|
StringBuffer currentString = new StringBuffer();
|
||||||
Matcher matcher = pattern.matcher(getText());
|
Matcher matcher = pattern.matcher(this.getText());
|
||||||
while (matcher.find())
|
while (matcher.find())
|
||||||
{
|
{
|
||||||
String match = matcher.group(0);
|
String match = matcher.group(0);
|
||||||
Mson replacement = replacer.getReplacement(match);
|
Mson replacement = replacer.getReplacement(match, this);
|
||||||
|
|
||||||
// Add the match
|
// Add the match
|
||||||
if (replacement == null) matcher.appendReplacement(currentString, match);
|
if (replacement == null) matcher.appendReplacement(currentString, match);
|
||||||
|
@ -2,5 +2,5 @@ package com.massivecraft.massivecore.mson;
|
|||||||
|
|
||||||
public interface MsonReplacement
|
public interface MsonReplacement
|
||||||
{
|
{
|
||||||
public Mson getReplacement(String match);
|
public Mson getReplacement(String match, Mson parent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user