1.0.7
All checks were successful
SorceryCraft/pipeline/head This commit looks good

Play Failure Sound when Inward Spell Fails
This commit is contained in:
TheBrokenRail 2020-03-03 21:38:15 -05:00
parent 8448acca6a
commit eabca94f00
3 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,8 @@
### Changelog
**1.0.7**
* Play Failure Sound when Inward Spell Fails
**1.0.6**
* Namespace PlayerEntity Mixin

View File

@ -8,7 +8,7 @@ org.gradle.jvmargs = -Xmx1G
loader_version = 0.7.8+build.184
# Mod Properties
mod_version = 1.0.6
mod_version = 1.0.7
maven_group = com.thebrokenrail
archives_base_name = sorcerycraft

View File

@ -95,8 +95,13 @@ public class SpellEntity extends ThrownItemEntity {
boolean success = didSpellSucceed(spells);
for (Map.Entry<Identifier, Integer> entry : spells.entrySet()) {
Spell spell = SpellRegistry.getSpell(entry.getKey(), entry.getValue());
if (spell != null && success) {
if (spell != null) {
if (success) {
spell.execute(getOwner(), this, getOwner());
} else if (getOwner() instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) getOwner();
player.playSound(SoundEvents.ENCHANT_THORNS_HIT, SoundCategory.PLAYERS, 1.0f, 1.0f);
}
}
}
}