feat: PAPI支持直接替换数组
This commit is contained in:
parent
8f5bae006a
commit
e6af7b1828
@ -37,11 +37,16 @@ try {
|
||||
}
|
||||
|
||||
function replace() {
|
||||
if (arguments.length > 1) {
|
||||
return PlaceholderAPI.setPlaceholders(arguments[0], arguments[1]);
|
||||
} else {
|
||||
return PlaceholderAPI.setPlaceholders(null, arguments[0]);
|
||||
var player = arguments[0];
|
||||
var line = [];
|
||||
if (arguments.length === 1) {
|
||||
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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user