Add zombie apocalypse spell

This commit is contained in:
Electroblob77
2020-05-31 17:16:55 +01:00
parent 05aac02966
commit a33715ad51
13 changed files with 250 additions and 2 deletions
@@ -52,7 +52,7 @@ public class SpellMinion<T extends EntityLiving & ISummonedCreature> extends Spe
* entity attribute modifier. */
public static final String HEALTH_MODIFIER = "minion_health";
/** The string identifier for the potency attribute modifier. */
private static final String POTENCY_ATTRIBUTE_MODIFIER = "potency";
public static final String POTENCY_ATTRIBUTE_MODIFIER = "potency";
/** A factory that creates summoned creature entities. */
protected final Function<World, T> minionFactory;
@@ -0,0 +1,27 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.entity.construct.EntityZombieSpawner;
import electroblob.wizardry.item.SpellActions;
import electroblob.wizardry.util.SpellModifiers;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import javax.annotation.Nullable;
public class ZombieApocalypse extends SpellConstruct<EntityZombieSpawner> {
public static final String MINION_SPAWN_INTERVAL = "minion_spawn_interval";
public ZombieApocalypse(){
super("zombie_apocalypse", SpellActions.POINT_UP, EntityZombieSpawner::new, false);
addProperties(SpellMinion.MINION_LIFETIME, MINION_SPAWN_INTERVAL);
}
@Override
protected boolean spawnConstruct(World world, double x, double y, double z, EnumFacing side, @Nullable EntityLivingBase caster, SpellModifiers modifiers){
y += 8;
return super.spawnConstruct(world, x, y, z, side, caster, modifiers);
}
}