feat: PAPI支持直接替换数组
This commit is contained in:
parent
8f5bae006a
commit
e6af7b1828
@ -37,11 +37,16 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function replace() {
|
function replace() {
|
||||||
if (arguments.length > 1) {
|
var player = arguments[0];
|
||||||
return PlaceholderAPI.setPlaceholders(arguments[0], arguments[1]);
|
var line = [];
|
||||||
} else {
|
if (arguments.length === 1) {
|
||||||
return PlaceholderAPI.setPlaceholders(null, arguments[0]);
|
player = null;
|
||||||
|
line = player;
|
||||||
}
|
}
|
||||||
|
if (toString.call(line) === "[object Array]") {
|
||||||
|
return PlaceholderAPI.setPlaceholders(player, line.join('\n')).split('\n');
|
||||||
|
}
|
||||||
|
return PlaceholderAPI.setPlaceholders(player, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports = module.exports = {
|
exports = module.exports = {
|
||||||
|
Loading…
Reference in New Issue
Block a user