mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-27 02:47:50 +01:00
Added JobsReborn support.
This commit is contained in:
parent
ddd808d79f
commit
bb7bf4ea8c
10
pom.xml
10
pom.xml
@ -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>
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user