From e6af7b1828e71d64b2a0768610516705d6c0ec21 Mon Sep 17 00:00:00 2001 From: coding Date: Sat, 19 May 2018 17:09:14 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20PAPI=E6=94=AF=E6=8C=81=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=9B=BF=E6=8D=A2=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/modules/papi.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/resources/modules/papi.js b/src/main/resources/modules/papi.js index b6b932e..aaef111 100644 --- a/src/main/resources/modules/papi.js +++ b/src/main/resources/modules/papi.js @@ -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 = {