Improved Helpers 2
This commit is contained in:
parent
4bfe713152
commit
f05928e26c
|
@ -3,4 +3,5 @@ out
|
||||||
run
|
run
|
||||||
*.iml
|
*.iml
|
||||||
.idea
|
.idea
|
||||||
|
.gradle
|
||||||
classes
|
classes
|
|
@ -1,6 +1,7 @@
|
||||||
package anvil.infinity.abilities;
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
import anvil.infinity.compat.CompatHandler;
|
import anvil.infinity.compat.CompatHandler;
|
||||||
|
import anvil.infinity.helpers.GauntelHelper;
|
||||||
import anvil.infinity.registry.Effects;
|
import anvil.infinity.registry.Effects;
|
||||||
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAction;
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAction;
|
||||||
|
@ -36,7 +37,7 @@ public class AbilitySnap extends AbilityAction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean action() {
|
public boolean action() {
|
||||||
if (CompatHandler.HeroesExpension.hasFullGauntlet(entity)) {
|
if (GauntelHelper.hasFullGauntlet(entity)) {
|
||||||
World w = entity.getEntityWorld();
|
World w = entity.getEntityWorld();
|
||||||
List<Entity> entities = w.loadedEntityList;
|
List<Entity> entities = w.loadedEntityList;
|
||||||
boolean kill = false;
|
boolean kill = false;
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class HELoadedProxy implements HEProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasFullGauntlet(EntityLivingBase entity) {
|
public boolean hasSpaceStone(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);
|
return Ability.hasAbility(entity, AbilityPortal.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class HENotLoadedProxy implements HEProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasFullGauntlet(EntityLivingBase entity) {
|
public boolean hasSpaceStone(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);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,6 @@ public interface HEProxy {
|
||||||
|
|
||||||
Ability getAbilityGrabEntity(EntityLivingBase entity);
|
Ability getAbilityGrabEntity(EntityLivingBase entity);
|
||||||
|
|
||||||
boolean hasFullGauntlet(EntityLivingBase entity);
|
boolean hasSpaceStone(EntityLivingBase entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package anvil.infinity.effects;
|
package anvil.infinity.effects;
|
||||||
|
|
||||||
import anvil.infinity.Infinity;
|
import anvil.infinity.Infinity;
|
||||||
import anvil.infinity.SoundHelper;
|
|
||||||
import anvil.infinity.helpers.SnapMessageHelper;
|
import anvil.infinity.helpers.SnapMessageHelper;
|
||||||
import anvil.infinity.registry.Effects;
|
import anvil.infinity.registry.Effects;
|
||||||
import anvil.infinity.registry.Sounds;
|
import anvil.infinity.registry.Sounds;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
|
|
|
@ -1,4 +1,40 @@
|
||||||
package anvil.infinity.helpers;
|
package anvil.infinity.helpers;
|
||||||
|
|
||||||
public class GauntelHelper {
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package anvil.infinity;
|
package anvil.infinity.helpers;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.SoundEvent;
|
import net.minecraft.util.SoundEvent;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package anvil.infinity.abilities;
|
package anvil.infinity.registry;
|
||||||
|
|
||||||
import anvil.infinity.Infinity;
|
import anvil.infinity.Infinity;
|
||||||
|
import anvil.infinity.abilities.*;
|
||||||
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityEntry;
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityEntry;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.event.RegistryEvent;
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
|
Loading…
Reference in New Issue