Add player animation system!

- Hooks into ModelRenderer by wrapping it in an extended version that allows modification of angles after the model has set them
- Is compatible with pretty much everything, yay (even modded armour!)
- Adds property overrides to ItemWand so that gets animated too
- Adds a system for generating override models from a template at runtime so I don't have to duplicate all the wand models
- Tweaks particles and ray spells so they line up with the end of the newly-animated wand
- Fixes a long-standing bug where wand usage actions would stop immediately for all non-continuous spells
This commit is contained in:
Electroblob77
2020-05-09 20:17:15 +01:00
parent cf38a16f49
commit be250e218e
146 changed files with 1531 additions and 262 deletions
@@ -2,6 +2,7 @@ package electroblob.wizardry.spell;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.entity.construct.EntityMagicConstruct;
import electroblob.wizardry.item.SpellActions;
import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.RayTracer;
import electroblob.wizardry.util.SpellModifiers;
@@ -9,7 +10,6 @@ import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.tileentity.TileEntityDispenser;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -53,7 +53,7 @@ public class SpellConstructRanged<T extends EntityMagicConstruct> extends SpellC
}
public SpellConstructRanged(String modID, String name, Function<World, T> constructFactory, boolean permanent){
super(modID, name, EnumAction.NONE, constructFactory, permanent);
super(modID, name, SpellActions.POINT, constructFactory, permanent);
this.addProperties(RANGE);
this.npcSelector((e, o) -> true);
}
@@ -118,8 +118,7 @@ public class SpellConstructRanged<T extends EntityMagicConstruct> extends SpellC
}else{
return false;
}
caster.swingArm(hand);
this.playSound(world, caster, ticksInUse, -1, modifiers);
return true;
}