Fixed crash

This commit is contained in:
Timo Ley 2020-04-30 13:25:01 +02:00
parent 7e22d8beea
commit 0629748adf
4 changed files with 15 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public class GeneratedCommand extends CommandBase {
if (sender instanceof EntityLivingBase) { if (sender instanceof EntityLivingBase) {
locate = Ability.hasAbility((EntityLivingBase) sender, AbilityLocate.class); locate = Ability.hasAbility((EntityLivingBase) sender, AbilityLocate.class);
if (CompatHandler.isHeroesExpansion) { if (CompatHandler.isHeroesExpansion) {
locate = locate || SuperpowerHandler.hasSuperpower((EntityLivingBase) sender, HESuperpowers.GOD_OF_THUNDER); locate = locate || CompatHandler.HeroesExpension.canLocate((EntityLivingBase) sender);
} }
} }
WorldData data = WorldData.get(server.getWorld(0)); WorldData data = WorldData.get(server.getWorld(0));

View File

@ -4,6 +4,8 @@ import lucraft.mods.heroesexpansion.abilities.AbilityBlackHole;
import lucraft.mods.heroesexpansion.abilities.AbilityForceField; import lucraft.mods.heroesexpansion.abilities.AbilityForceField;
import lucraft.mods.heroesexpansion.abilities.AbilityGrabEntity; import lucraft.mods.heroesexpansion.abilities.AbilityGrabEntity;
import lucraft.mods.heroesexpansion.abilities.AbilityPortal; import lucraft.mods.heroesexpansion.abilities.AbilityPortal;
import lucraft.mods.heroesexpansion.superpowers.HESuperpowers;
import lucraft.mods.lucraftcore.superpowers.SuperpowerHandler;
import lucraft.mods.lucraftcore.superpowers.abilities.Ability; import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -28,4 +30,9 @@ public class HELoadedProxy implements HEProxy {
public Ability getAbilityBlackhole(EntityLivingBase entity) { public Ability getAbilityBlackhole(EntityLivingBase entity) {
return new AbilityBlackHole(entity); return new AbilityBlackHole(entity);
} }
@Override
public boolean canLocate(EntityLivingBase entity) {
return SuperpowerHandler.hasSuperpower(entity, HESuperpowers.GOD_OF_THUNDER);
}
} }

View File

@ -25,4 +25,9 @@ public class HENotLoadedProxy implements HEProxy {
public Ability getAbilityBlackhole(EntityLivingBase entity) { public Ability getAbilityBlackhole(EntityLivingBase entity) {
return null; return null;
} }
@Override
public boolean canLocate(EntityLivingBase entity) {
return false;
}
} }

View File

@ -13,4 +13,6 @@ public interface HEProxy {
Ability getAbilityBlackhole(EntityLivingBase entity); Ability getAbilityBlackhole(EntityLivingBase entity);
boolean canLocate(EntityLivingBase entity);
} }