-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add soft compatibility with Spell Engine, disable idle animation whil…
…e casting spells
- Loading branch information
1 parent
21386d9
commit 72a7853
Showing
8 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
fabric/src/main/java/net/bettercombat/fabric/client/SpellEngineCompatibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.bettercombat.fabric.client; | ||
|
||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.spell_engine.internals.casting.SpellCasterEntity; | ||
|
||
public class SpellEngineCompatibility { | ||
private static Boolean isLoaded = null; | ||
public static boolean isCastingSpell(PlayerEntity player) { | ||
if (isLoaded == null) { | ||
isLoaded = FabricLoader.getInstance().isModLoaded("spell_engine"); | ||
} | ||
if (isLoaded) { | ||
// return (SpellCasterEntity) .isCastingSpell(player); | ||
return ((SpellCasterEntity)player).getCurrentSpell() != null; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters