mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-03 22:37:41 +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>
|
<artifactId>Lootables</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.gamingmesh</groupId>
|
|
||||||
<artifactId>jobs</artifactId>
|
|
||||||
<version>4.10.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.bgsoftware</groupId>
|
<groupId>com.bgsoftware</groupId>
|
||||||
<artifactId>wildstacker</artifactId>
|
<artifactId>wildstacker</artifactId>
|
||||||
|
@ -192,9 +192,9 @@ public class UltimateStacker extends SongodaPlugin {
|
|||||||
pluginManager.registerEvents(new ClearLagListeners(this), this);
|
pluginManager.registerEvents(new ClearLagListeners(this), this);
|
||||||
|
|
||||||
// Register Hooks
|
// Register Hooks
|
||||||
if (pluginManager.isPluginEnabled("Jobs")) {
|
if (pluginManager.isPluginEnabled("Jobs"))
|
||||||
stackerHooks.add(new JobsHook());
|
stackerHooks.add(new JobsHook());
|
||||||
}
|
|
||||||
HologramManager.load(this);
|
HologramManager.load(this);
|
||||||
|
|
||||||
// Database stuff, go!
|
// Database stuff, go!
|
||||||
|
@ -1,30 +1,26 @@
|
|||||||
package com.songoda.ultimatestacker.hook.hooks;
|
package com.songoda.ultimatestacker.hook.hooks;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.songoda.core.hooks.jobs.JobsPlayerHandler;
|
||||||
import com.gamingmesh.jobs.actions.EntityActionInfo;
|
|
||||||
import com.gamingmesh.jobs.container.ActionType;
|
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
|
||||||
import com.songoda.ultimatestacker.hook.StackerHook;
|
import com.songoda.ultimatestacker.hook.StackerHook;
|
||||||
import com.songoda.ultimatestacker.stackable.entity.EntityStack;
|
import com.songoda.ultimatestacker.stackable.entity.EntityStack;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class JobsHook implements StackerHook {
|
public class JobsHook implements StackerHook {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyExperience(Player player, EntityStack entityStack) {
|
public void applyExperience(Player player, EntityStack entityStack) {
|
||||||
if (player.getGameMode().equals(GameMode.CREATIVE))
|
if (player.getGameMode().equals(GameMode.CREATIVE) || entityStack.getHostEntity() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
JobsPlayerHandler jPlayer = com.songoda.core.hooks.JobsHook.getPlayer(player);
|
||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 1; i < entityStack.getAmount(); i++) {
|
for (int i = 1; i < entityStack.getAmount(); i++) {
|
||||||
Entity entity = entityStack.getHostEntity();
|
LivingEntity entity = entityStack.getHostEntity();
|
||||||
EntityActionInfo eInfo = new EntityActionInfo(entity, ActionType.KILL);
|
jPlayer.killEntity(entity);
|
||||||
Jobs.action(jPlayer, eInfo, entity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user