Support Denizen 1.1.3+, fixes #1187

This commit is contained in:
PikaMug 2020-04-14 17:37:18 -04:00
parent 58d2030368
commit 36a2e865aa
2 changed files with 6 additions and 2 deletions

View File

@ -65,7 +65,7 @@
<dependency>
<groupId>com.denizenscript</groupId>
<artifactId>denizen</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -23,6 +23,8 @@ import com.denizenscript.denizen.objects.PlayerTag;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizencore.scripts.ScriptRegistry;
import com.denizenscript.denizencore.scripts.containers.core.TaskScriptContainer;
import com.denizenscript.denizencore.scripts.queues.ScriptQueue;
import com.denizenscript.denizencore.scripts.queues.core.InstantQueue;
import net.citizensnpcs.api.npc.NPC;
@ -62,6 +64,8 @@ public class DenizenAPI_1_1_1 {
public static void runTaskScript(String scriptName, Player player) {
TaskScriptContainer taskScript = ScriptRegistry.getScriptContainerAs(scriptName, TaskScriptContainer.class);
BukkitScriptEntryData entryData = new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(player), null);
taskScript.runTaskScript(entryData, null);
ScriptQueue queue = new InstantQueue(taskScript.getName())
.addEntries(taskScript.getBaseEntries(entryData.clone()));
queue.start();
}
}