Mson replacement parent context.

This commit is contained in:
Olof Larsson 2015-09-02 14:50:13 +02:00
parent 6c8a07dc2f
commit 270f2bec05
2 changed files with 4 additions and 4 deletions

View File

@ -721,7 +721,7 @@ public class Mson implements Serializable
MsonReplacement replacer = new MsonReplacement()
{
@Override
public Mson getReplacement(String match)
public Mson getReplacement(String match, Mson parent)
{
return replacement;
}
@ -746,11 +746,11 @@ public class Mson implements Serializable
List<Mson> msons = new ArrayList<Mson>();
StringBuffer currentString = new StringBuffer();
Matcher matcher = pattern.matcher(getText());
Matcher matcher = pattern.matcher(this.getText());
while (matcher.find())
{
String match = matcher.group(0);
Mson replacement = replacer.getReplacement(match);
Mson replacement = replacer.getReplacement(match, this);
// Add the match
if (replacement == null) matcher.appendReplacement(currentString, match);

View File

@ -2,5 +2,5 @@ package com.massivecraft.massivecore.mson;
public interface MsonReplacement
{
public Mson getReplacement(String match);
public Mson getReplacement(String match, Mson parent);
}