Added JobsReborn support.

This commit is contained in:
Brianna 2019-06-09 11:20:22 -04:00
parent ddd808d79f
commit bb7bf4ea8c
2 changed files with 30 additions and 1 deletions

10
pom.xml
View File

@ -78,5 +78,15 @@
<artifactId>vault</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>net.milkbowl</groupId>
<artifactId>vault</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>com.gamingmesh</groupId>
<artifactId>jobs</artifactId>
<version>4.10.3</version>
</dependency>
</dependencies>
</project>

View File

@ -1,5 +1,9 @@
package com.songoda.ultimatestacker.utils;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.actions.EntityActionInfo;
import com.gamingmesh.jobs.container.ActionType;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.entity.Check;
import com.songoda.ultimatestacker.entity.EntityStack;
@ -36,9 +40,11 @@ public class Methods {
for (ItemStack item : items) {
killedLocation.getWorld().dropItemNaturally(killedLocation, item);
}
killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp);
}
if (Bukkit.getPluginManager().isPluginEnabled("Jobs"))
runJobs(killed, stack.getAmount());
}
private static void handleSingleStackDeath(LivingEntity killed) {
@ -66,6 +72,19 @@ public class Methods {
}
}
private static void runJobs(LivingEntity killed, int amount) {
if (killed.getKiller() == null) return;
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(killed.getKiller());
if (jPlayer == null)
return;
EntityActionInfo eInfo = new EntityActionInfo(killed, ActionType.KILL);
for (int i = 1; i < amount; i++)
Jobs.action(jPlayer, eInfo, killed);
}
public static void onDeath(LivingEntity killed, List<ItemStack> items, int droppedExp) {
UltimateStacker instance = UltimateStacker.getInstance();