mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-31 21:07:47 +01:00
Fixed compatibility issue with Jobs.
This commit is contained in:
parent
5f6aaa291c
commit
64dbf4665c
5
pom.xml
5
pom.xml
@ -126,11 +126,6 @@
|
||||
<artifactId>Lootables</artifactId>
|
||||
<version>1.0.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.gamingmesh</groupId>
|
||||
<artifactId>jobs</artifactId>
|
||||
<version>4.10.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bgsoftware</groupId>
|
||||
<artifactId>wildstacker</artifactId>
|
||||
|
@ -192,9 +192,9 @@ public class UltimateStacker extends SongodaPlugin {
|
||||
pluginManager.registerEvents(new ClearLagListeners(this), this);
|
||||
|
||||
// Register Hooks
|
||||
if (pluginManager.isPluginEnabled("Jobs")) {
|
||||
if (pluginManager.isPluginEnabled("Jobs"))
|
||||
stackerHooks.add(new JobsHook());
|
||||
}
|
||||
|
||||
HologramManager.load(this);
|
||||
|
||||
// Database stuff, go!
|
||||
|
@ -1,30 +1,26 @@
|
||||
package com.songoda.ultimatestacker.hook.hooks;
|
||||
|
||||
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.core.hooks.jobs.JobsPlayerHandler;
|
||||
import com.songoda.ultimatestacker.hook.StackerHook;
|
||||
import com.songoda.ultimatestacker.stackable.entity.EntityStack;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class JobsHook implements StackerHook {
|
||||
|
||||
@Override
|
||||
public void applyExperience(Player player, EntityStack entityStack) {
|
||||
if (player.getGameMode().equals(GameMode.CREATIVE))
|
||||
if (player.getGameMode().equals(GameMode.CREATIVE) || entityStack.getHostEntity() == null)
|
||||
return;
|
||||
|
||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||
JobsPlayerHandler jPlayer = com.songoda.core.hooks.JobsHook.getPlayer(player);
|
||||
if (jPlayer == null)
|
||||
return;
|
||||
|
||||
for (int i = 1; i < entityStack.getAmount(); i++) {
|
||||
Entity entity = entityStack.getHostEntity();
|
||||
EntityActionInfo eInfo = new EntityActionInfo(entity, ActionType.KILL);
|
||||
Jobs.action(jPlayer, eInfo, entity);
|
||||
LivingEntity entity = entityStack.getHostEntity();
|
||||
jPlayer.killEntity(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user