Added ability to replace [name] by the island owner's name when pasting an entity from a blueprint

This commit is contained in:
Florian CUNY 2020-06-17 21:28:00 +02:00
parent 7ee706c982
commit aa9a4d16f1

View File

@ -348,6 +348,9 @@ public class BlueprintPaster {
// Parse any placeholders in the entity's name, if the owner's connected (he should)
Player owner = User.getInstance(island.getOwner()).getPlayer();
if (owner != null) {
// Parse for the player's name first (in case placeholders might need it)
customName = customName.replace(TextVariables.NAME, owner.getName());
// Now parse the placeholders
customName = plugin.getPlaceholdersManager().replacePlaceholders(owner, customName);
}
}