-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration for Origins mod climbing power
- Loading branch information
Showing
5 changed files
with
41 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
19 changes: 19 additions & 0 deletions
19
common/src/main/java/org/vivecraft/mod_compat_vr/origins/OriginsHelper.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 org.vivecraft.mod_compat_vr.origins; | ||
|
||
import org.vivecraft.client.Xplat; | ||
import io.github.apace100.apoli.component.PowerHolderComponent; | ||
import io.github.apace100.apoli.power.ClimbingPower; | ||
import io.github.apace100.apoli.power.TogglePower; | ||
import net.minecraft.world.entity.LivingEntity; | ||
|
||
public class OriginsHelper { | ||
public static boolean isLoaded() { | ||
return Xplat.isModLoaded("origins"); | ||
} | ||
|
||
public static boolean hasClimbingPower(LivingEntity entity) { | ||
// assumes toggle is for climbing, which is correct at least for stock origins | ||
return !PowerHolderComponent.KEY.get(entity).getPowers(ClimbingPower.class, true).isEmpty() | ||
&& !PowerHolderComponent.KEY.get(entity).getPowers(TogglePower.class, false).isEmpty(); | ||
} | ||
} |