Fix Flight Duration In Fabric

This commit is contained in:
gattsuru 2022-07-22 14:58:17 -04:00
parent b6035a19d8
commit 8824415611
2 changed files with 10 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import at.petrak.hexcasting.api.player.FlightAbility
import at.petrak.hexcasting.api.spell.*
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.xplat.IXplatAbstractions
import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.phys.Vec3
@ -97,4 +98,11 @@ object OpFlight : SpellOperator {
}
}
fun fabricTickDownAllFlight(world: ServerLevel)
{
for (player in world.players()) {
tickDownFlight(player)
}
}
}

View file

@ -6,6 +6,7 @@ import at.petrak.hexcasting.api.mod.HexStatistics
import at.petrak.hexcasting.common.blocks.behavior.HexComposting
import at.petrak.hexcasting.common.blocks.behavior.HexStrippables
import at.petrak.hexcasting.common.casting.RegisterPatterns
import at.petrak.hexcasting.common.casting.operators.spells.great.OpFlight
import at.petrak.hexcasting.common.command.PatternResLocArgument
import at.petrak.hexcasting.common.entities.HexEntities
import at.petrak.hexcasting.common.items.ItemJewelerHammer
@ -73,6 +74,7 @@ object FabricHexInitializer : ModInitializer {
}
ServerTickEvents.END_WORLD_TICK.register(PlayerPositionRecorder::updateAllPlayers)
ServerTickEvents.END_WORLD_TICK.register(OpFlight::fabricTickDownAllFlight)
CommandRegistrationCallback.EVENT.register { dp, _ -> HexCommands.register(dp) }