delete gravity API interop since gravity API is quilt-only now

This commit is contained in:
Talia-12 2023-06-23 16:25:02 +10:00
parent 28f74a8287
commit 228f68bad9
6 changed files with 8 additions and 80 deletions

View file

@ -102,7 +102,7 @@ dependencies {
modImplementation "dev.emi:trinkets:$trinketsVersion" modImplementation "dev.emi:trinkets:$trinketsVersion"
modImplementation "dev.emi:emi-fabric:${emiVersion}" modImplementation "dev.emi:emi-fabric:${emiVersion}"
modImplementation "maven.modrinth:gravity-api:$gravityApiVersion" // modImplementation "maven.modrinth:gravity-api:$gravityApiVersion"
modApi("com.github.Virtuoel:Pehkui:${pehkuiVersion}", { modApi("com.github.Virtuoel:Pehkui:${pehkuiVersion}", {
exclude group: "net.fabricmc.fabric-api" exclude group: "net.fabricmc.fabric-api"
}) })

View file

@ -8,7 +8,7 @@ cardinalComponentsVersion=5.2.1
#entityReachVersion=2.3.0 #entityReachVersion=2.3.0
emiVersion=1.0.4+1.20.1 emiVersion=1.0.4+1.20.1
gravityApiVersion=1.0.6 #gravityApiVersion=1.0.6
trinketsVersion=3.7.0 trinketsVersion=3.7.0
clothConfigVersion=11.0.99 clothConfigVersion=11.0.99

View file

@ -26,9 +26,6 @@ import at.petrak.hexcasting.common.misc.PlayerPositionRecorder
import at.petrak.hexcasting.common.misc.RegisterMisc import at.petrak.hexcasting.common.misc.RegisterMisc
import at.petrak.hexcasting.common.recipe.HexRecipeStuffRegistry import at.petrak.hexcasting.common.recipe.HexRecipeStuffRegistry
import at.petrak.hexcasting.fabric.event.VillagerConversionCallback import at.petrak.hexcasting.fabric.event.VillagerConversionCallback
import at.petrak.hexcasting.fabric.interop.gravity.GravityApiInterop
import at.petrak.hexcasting.fabric.interop.gravity.OpChangeGravity
import at.petrak.hexcasting.fabric.interop.gravity.OpGetGravity
import at.petrak.hexcasting.fabric.loot.FabricHexLootModJankery import at.petrak.hexcasting.fabric.loot.FabricHexLootModJankery
import at.petrak.hexcasting.fabric.network.FabricPacketHandler import at.petrak.hexcasting.fabric.network.FabricPacketHandler
import at.petrak.hexcasting.fabric.recipe.FabricModConditionalIngredient import at.petrak.hexcasting.fabric.recipe.FabricModConditionalIngredient
@ -166,12 +163,12 @@ object FabricHexInitializer : ModInitializer {
// sorry lex (not sorry) // sorry lex (not sorry)
private fun fabricOnlyRegistration() { private fun fabricOnlyRegistration() {
if (GravityApiInterop.isActive()) { // if (GravityApiInterop.isActive()) {
HexActions.make("interop/gravity/get", // HexActions.make("interop/gravity/get",
ActionRegistryEntry(HexPattern.fromAngles("wawawddew", HexDir.NORTH_EAST), OpGetGravity)) // ActionRegistryEntry(HexPattern.fromAngles("wawawddew", HexDir.NORTH_EAST), OpGetGravity))
HexActions.make("interop/gravity/set", // HexActions.make("interop/gravity/set",
ActionRegistryEntry(HexPattern.fromAngles("wdwdwaaqw", HexDir.NORTH_WEST), OpChangeGravity)) // ActionRegistryEntry(HexPattern.fromAngles("wdwdwaaqw", HexDir.NORTH_WEST), OpChangeGravity))
} // }
} }
private fun butYouCouldBeFire() { private fun butYouCouldBeFire() {

View file

@ -1,14 +0,0 @@
package at.petrak.hexcasting.fabric.interop.gravity;
import at.petrak.hexcasting.interop.HexInterop;
import at.petrak.hexcasting.xplat.IXplatAbstractions;
public class GravityApiInterop {
public static void init() {
}
public static boolean isActive() {
return IXplatAbstractions.INSTANCE.isModPresent(HexInterop.Fabric.GRAVITY_CHANGER_API_ID)
|| IXplatAbstractions.INSTANCE.isModPresent(HexInterop.Fabric.GRAVITY_CHANGER_API_ID_POST_119_OR_SOMETHING);
}
}

View file

@ -1,36 +0,0 @@
package at.petrak.hexcasting.fabric.interop.gravity
import at.petrak.hexcasting.api.casting.ParticleSpray
import at.petrak.hexcasting.api.casting.RenderedSpell
import at.petrak.hexcasting.api.casting.castables.SpellAction
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getEntity
import at.petrak.hexcasting.api.casting.getVec3
import at.petrak.hexcasting.api.casting.iota.Iota
import com.fusionflux.gravity_api.api.GravityChangerAPI
import net.minecraft.core.Direction
import net.minecraft.world.entity.Entity
import net.minecraft.world.phys.Vec3
object OpChangeGravity : SpellAction {
override val argc = 2
override fun execute(args: List<Iota>, ctx: CastingEnvironment): SpellAction.Result {
val target = args.getEntity(0, argc)
// TODO is it worth making a special "axial vector" getter
val vec = args.getVec3(1, argc)
val snapped = Direction.getNearest(vec.x, vec.y, vec.z)
return SpellAction.Result(
Spell(target, snapped),
100_000,
listOf(ParticleSpray(target.position(), Vec3.atLowerCornerOf(snapped.normal), 0.1, 0.1))
)
}
private data class Spell(val target: Entity, val dir: Direction) : RenderedSpell {
override fun cast(ctx: CastingEnvironment) {
GravityChangerAPI.setDefaultGravityDirection(target, dir)
}
}
}

View file

@ -1,19 +0,0 @@
package at.petrak.hexcasting.fabric.interop.gravity
import at.petrak.hexcasting.api.casting.asActionResult
import at.petrak.hexcasting.api.casting.castables.ConstMediaAction
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getEntity
import at.petrak.hexcasting.api.casting.iota.Iota
import com.fusionflux.gravity_api.api.GravityChangerAPI
import net.minecraft.world.phys.Vec3
object OpGetGravity : ConstMediaAction {
override val argc = 1
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
val target = args.getEntity(0)
val grav = GravityChangerAPI.getGravityDirection(target)
return Vec3.atLowerCornerOf(grav.normal).asActionResult
}
}