package ru.dbotthepony.mc.otm.android

import com.mojang.blaze3d.vertex.PoseStack
import net.minecraft.client.Camera
import net.minecraftforge.client.event.RenderLevelStageEvent
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability

abstract class AndroidActiveFeature(type: AndroidFeatureType<*>, android: MatteryPlayerCapability) : AndroidSwitchableFeature(type, android) {
	/**
	 * return true to send packet to server if [isClient] is true
	 *
	 * return result is ignored on server
	 */
	abstract fun activate(isClient: Boolean): Boolean

	open val previewRenderStage: RenderLevelStageEvent.Stage get() = RenderLevelStageEvent.Stage.AFTER_TRANSLUCENT_BLOCKS

	/**
	 * Called on client inside world render context to render previews of ability activation
	 *
	 * (called when player holds ability key)
	 *
	 * pose stack has pose pushed already
	 */
	abstract fun renderPreview(poseStack: PoseStack, camera: Camera)
}
