Improved Helpers 2

This commit is contained in:
Timo Ley 2019-05-13 11:24:02 +02:00
parent 4bfe713152
commit f05928e26c
9 changed files with 51 additions and 14 deletions

1
.gitignore vendored
View File

@ -3,4 +3,5 @@ out
run
*.iml
.idea
.gradle
classes

View File

@ -1,6 +1,7 @@
package anvil.infinity.abilities;
import anvil.infinity.compat.CompatHandler;
import anvil.infinity.helpers.GauntelHelper;
import anvil.infinity.registry.Effects;
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAction;
@ -36,7 +37,7 @@ public class AbilitySnap extends AbilityAction {
@Override
public boolean action() {
if (CompatHandler.HeroesExpension.hasFullGauntlet(entity)) {
if (GauntelHelper.hasFullGauntlet(entity)) {
World w = entity.getEntityWorld();
List<Entity> entities = w.loadedEntityList;
boolean kill = false;

View File

@ -14,7 +14,7 @@ public class HELoadedProxy implements HEProxy {
}
@Override
public boolean hasFullGauntlet(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityPortal.class) && Ability.hasAbility(entity, AbilityHasPowerStone.class) && Ability.hasAbility(entity, AbilityHasRealityStone.class) && Ability.hasAbility(entity, AbilityHasSoulStone.class) && Ability.hasAbility(entity, AbilityHasTimeStone.class) && Ability.hasAbility(entity, AbilityHasMindStone.class);
public boolean hasSpaceStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityPortal.class);
}
}

View File

@ -12,7 +12,7 @@ public class HENotLoadedProxy implements HEProxy {
}
@Override
public boolean hasFullGauntlet(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasPowerStone.class) && Ability.hasAbility(entity, AbilityHasRealityStone.class) && Ability.hasAbility(entity, AbilityHasSoulStone.class) && Ability.hasAbility(entity, AbilityHasTimeStone.class) && Ability.hasAbility(entity, AbilityHasMindStone.class);
public boolean hasSpaceStone(EntityLivingBase entity) {
return true;
}
}

View File

@ -7,6 +7,6 @@ public interface HEProxy {
Ability getAbilityGrabEntity(EntityLivingBase entity);
boolean hasFullGauntlet(EntityLivingBase entity);
boolean hasSpaceStone(EntityLivingBase entity);
}

View File

@ -1,12 +1,10 @@
package anvil.infinity.effects;
import anvil.infinity.Infinity;
import anvil.infinity.SoundHelper;
import anvil.infinity.helpers.SnapMessageHelper;
import anvil.infinity.registry.Effects;
import anvil.infinity.registry.Sounds;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraftforge.event.entity.living.LivingEvent;

View File

@ -1,4 +1,40 @@
package anvil.infinity.helpers;
public class GauntelHelper {
}
package anvil.infinity.helpers;
import anvil.infinity.abilities.*;
import anvil.infinity.compat.CompatHandler;
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
import net.minecraft.entity.EntityLivingBase;
public class GauntelHelper {
public static boolean hasPowerStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasPowerStone.class);
}
public static boolean hasSpaceStone(EntityLivingBase entity) {
return CompatHandler.HeroesExpension.hasSpaceStone(entity);
}
public static boolean hasRealityStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasRealityStone.class);
}
public static boolean hasSoulStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasSoulStone.class);
}
public static boolean hasTimeStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasTimeStone.class);
}
public static boolean hasMindStone(EntityLivingBase entity) {
return Ability.hasAbility(entity, AbilityHasMindStone.class);
}
public static boolean hasFullGauntlet(EntityLivingBase entity) {
return hasPowerStone(entity) && hasSpaceStone(entity) && hasRealityStone(entity) && hasSoulStone(entity) && hasTimeStone(entity) && hasMindStone(entity);
}
}

View File

@ -1,4 +1,4 @@
package anvil.infinity;
package anvil.infinity.helpers;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.SoundEvent;

View File

@ -1,6 +1,7 @@
package anvil.infinity.abilities;
package anvil.infinity.registry;
import anvil.infinity.Infinity;
import anvil.infinity.abilities.*;
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityEntry;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;