<commit_before>package com.countrygamer.morphadditions.common.network

import com.countrygamer.cgo.wrapper.common.network.AbstractPacket
import com.countrygamer.morphadditions.api.AbilityAction
import com.countrygamer.morphadditions.common.MAOptions
import com.countrygamer.morphadditions.common.init.Abilities
import io.netty.buffer.ByteBuf
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.player.EntityPlayer

/**
 *
 *
 * @author CountryGamer
 */
class PacketKeyPressed() extends AbstractPacket {

	override def writeTo(buffer: ByteBuf): Unit = {

	}

	override def readFrom(buffer: ByteBuf): Unit = {

	}

	override def handleOnClient(player: EntityPlayer): Unit = {
		this.handle(player, isClient = true)
	}

	override def handleOnServer(player: EntityPlayer): Unit = {
		this.handle(player, isClient = false)
	}

	def handle(player: EntityPlayer, isClient: Boolean): Unit = {
		val entity: EntityLivingBase = morph.api.Api
				.getMorphEntity(player.getCommandSenderName, isClient)

		if (entity != null) {
			val ability: AbilityAction = Abilities.getAbility(entity)
			if (ability != null) {
				// TODO DEBUG
				if (player.isSneaking) {
					MAOptions.getMP(player).clearCooldown()
				}

				MAOptions.getMP(player).trigger(ability)
			}
		}

	}

}<commit_msg>Removes debug :)<commit_after>package com.countrygamer.morphadditions.common.network

import com.countrygamer.cgo.wrapper.common.network.AbstractPacket
import com.countrygamer.morphadditions.api.AbilityAction
import com.countrygamer.morphadditions.common.MAOptions
import com.countrygamer.morphadditions.common.init.Abilities
import io.netty.buffer.ByteBuf
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.player.EntityPlayer

/**
 *
 *
 * @author CountryGamer
 */
class PacketKeyPressed() extends AbstractPacket {

	override def writeTo(buffer: ByteBuf): Unit = {

	}

	override def readFrom(buffer: ByteBuf): Unit = {

	}

	override def handleOnClient(player: EntityPlayer): Unit = {
		this.handle(player, isClient = true)
	}

	override def handleOnServer(player: EntityPlayer): Unit = {
		this.handle(player, isClient = false)
	}

	def handle(player: EntityPlayer, isClient: Boolean): Unit = {
		val entity: EntityLivingBase = morph.api.Api
				.getMorphEntity(player.getCommandSenderName, isClient)

		if (entity != null) {
			val ability: AbilityAction = Abilities.getAbility(entity)
			if (ability != null) {
				MAOptions.getMP(player).trigger(ability)
			}
		}

	}

}
{'fraction_non_alphanumeric': 0.10866078588612671, 'fraction_numerical': 0.0, 'mean_word_length': 4.775462962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '143798', 'n_tokens_mistral': 851, 'n_tokens_neox': 781, 'n_words': 149}