forked from Upstream/mmocore
Merge branch 'master' of ssh://git.lumine.io:2222/mythiccraft/mmocore into abilitiesselfharmingfix
This commit is contained in:
commit
d3ae688da4
2
pom.xml
2
pom.xml
@ -122,7 +122,7 @@
|
||||
<dependency>
|
||||
<groupId>io.lumine</groupId>
|
||||
<artifactId>MythicLib</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.8-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -1,11 +1,6 @@
|
||||
package net.Indyuce.mmocore.comp.mythicmobs.skill;
|
||||
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.EntityDeathSkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerAttackSkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDamageByEntitySkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDamageSkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDeathSkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.ShootBowSkillHandler;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.*;
|
||||
|
||||
public enum PassiveSkillType {
|
||||
PLAYER_ATTACK,
|
||||
@ -13,6 +8,7 @@ public enum PassiveSkillType {
|
||||
PLAYER_DAMAGE_BY_ENTITY,
|
||||
PLAYER_DEATH,
|
||||
PLAYER_KILL_ENTITY,
|
||||
PLAYER_LOGIN,
|
||||
SHOOT_BOW;
|
||||
|
||||
public PassiveMythicMobSkillHandler getHandler(MythicMobSkill skill) {
|
||||
@ -28,6 +24,8 @@ public enum PassiveSkillType {
|
||||
return new PlayerDeathSkillHandler(skill);
|
||||
if (this == SHOOT_BOW)
|
||||
return new ShootBowSkillHandler(skill);
|
||||
if (this == PLAYER_LOGIN)
|
||||
return new PlayerLoginSkillHandler(skill);
|
||||
throw new NullPointerException();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers;
|
||||
|
||||
import io.lumine.mythic.utils.Schedulers;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicMobSkill;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicMobSkillHandler;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
|
||||
public class PlayerLoginSkillHandler extends PassiveMythicMobSkillHandler {
|
||||
/**
|
||||
* Used when a player logins
|
||||
*
|
||||
* @param skill
|
||||
*/
|
||||
public PlayerLoginSkillHandler(MythicMobSkill skill) {
|
||||
super(skill);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void event(PlayerLoginEvent e){
|
||||
Schedulers.sync().runLater(() -> {
|
||||
castSkill(PlayerData.get( e.getPlayer()));
|
||||
}, 50);
|
||||
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.block.BlockInfo;
|
||||
import net.Indyuce.mmocore.api.block.BlockInfo.BlockInfoOption;
|
||||
import net.Indyuce.mmocore.api.block.VanillaBlockType;
|
||||
import net.Indyuce.mmocore.api.droptable.condition.ConditionInstance;
|
||||
import net.Indyuce.mmocore.api.event.CustomBlockMineEvent;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||
@ -108,8 +109,10 @@ public class BlockListener implements Listener {
|
||||
* can give exp to other TOOLS and display HOLOGRAMS
|
||||
*/
|
||||
if (info.hasTriggers() && !block.hasMetadata("player_placed")) {
|
||||
PlayerData playerData = PlayerData.get(player);
|
||||
info.getTriggers().forEach(trigger -> trigger.apply(playerData));
|
||||
if (!info.hasDropTable() || info.hasDropTable() && info.getDropTable().areConditionsMet(new ConditionInstance(player))) {
|
||||
PlayerData playerData = PlayerData.get(player);
|
||||
info.getTriggers().forEach(trigger -> trigger.apply(playerData));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user