Add sounds to zombie apocalypse spell, plus misc tweaks
This commit is contained in:
@@ -2,9 +2,11 @@ package electroblob.wizardry.spell;
|
||||
|
||||
import electroblob.wizardry.entity.construct.EntityZombieSpawner;
|
||||
import electroblob.wizardry.item.SpellActions;
|
||||
import electroblob.wizardry.registry.WizardryItems;
|
||||
import electroblob.wizardry.util.SpellModifiers;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -13,15 +15,27 @@ public class ZombieApocalypse extends SpellConstruct<EntityZombieSpawner> {
|
||||
|
||||
public static final String MINION_SPAWN_INTERVAL = "minion_spawn_interval";
|
||||
|
||||
private static final int SPAWNER_HEIGHT = 8;
|
||||
|
||||
public ZombieApocalypse(){
|
||||
super("zombie_apocalypse", SpellActions.POINT_UP, EntityZombieSpawner::new, false);
|
||||
addProperties(SpellMinion.MINION_LIFETIME, MINION_SPAWN_INTERVAL);
|
||||
this.soundValues(1.3f, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent[] createSounds(){
|
||||
return createContinuousSpellSounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean spawnConstruct(World world, double x, double y, double z, EnumFacing side, @Nullable EntityLivingBase caster, SpellModifiers modifiers){
|
||||
y += 8;
|
||||
y += SPAWNER_HEIGHT;
|
||||
return super.spawnConstruct(world, x, y, z, side, caster, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void playSound(World world, double x, double y, double z, int ticksInUse, int duration, SpellModifiers modifiers, String... sounds){
|
||||
this.playSoundLoop(world, x, y + SPAWNER_HEIGHT, z, 0, (int)(getProperty(DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user