<commit_before>package k2b6s9j.boatcraft.api.registry

import java.util.{HashMap, List, Map}

import scala.collection.JavaConversions.asScalaBuffer

import k2b6s9j.boatcraft.api.traits.Material
import net.minecraft.item.ItemStack

/** Contains the methods needed to register Materials with BoatCraft:Core. */
object MaterialRegistry
{
	var materials: Map[String, Material] = new HashMap[String, Material]
	
  /** Adds a single Material to the Map used by BoatCraft:Core for boat creation.
    *
    * @param newMaterial the Material being registered
    */
	def addMaterial(newMaterial: Material)
	{
		materials put(newMaterial toString, newMaterial)
	}

  /** Adds a list of Materials to the Map used by BoatCraft:Core for boat creation.
    *
    * @param newMaterials list of Materials being registered
    */
	def addMaterials(newMaterials: List[Material])
	{
		for (material <- newMaterials)
			materials put(material toString, material)
	}

	def getMaterial(name: String) =
		materials get name

	def getMaterial(stack: ItemStack) =
		materials get (stack.stackTagCompound getString "material")
}<commit_msg>Add documentation comments for getMaterial()<commit_after>package k2b6s9j.boatcraft.api.registry

import java.util.{HashMap, List, Map}

import scala.collection.JavaConversions.asScalaBuffer

import k2b6s9j.boatcraft.api.traits.Material
import net.minecraft.item.ItemStack

/** Contains the methods needed to register Materials with BoatCraft:Core. */
object MaterialRegistry
{
	var materials: Map[String, Material] = new HashMap[String, Material]
	
  /** Adds a single Material to the Map used by BoatCraft:Core for boat creation.
    *
    * @param newMaterial the Material being registered
    */
	def addMaterial(newMaterial: Material)
	{
		materials put(newMaterial toString, newMaterial)
	}

  /** Adds a list of Materials to the Map used by BoatCraft:Core for boat creation.
    *
    * @param newMaterials list of Materials being registered
    */
	def addMaterials(newMaterials: List[Material])
	{
		for (material <- newMaterials)
			materials put(material toString, material)
	}

  /** Returns a registered Material associated with a certain name.
    *
    * @param name name of registered Material
    * @return registered Material
    */
	def getMaterial(name: String) =
		materials get name

  /** Returns a registered Material associated with a certain ItemStack.
    *
    * @param stack ItemStack of registered Material
    * @return registered Material
    */
	def getMaterial(stack: ItemStack) =
		materials get (stack.stackTagCompound getString "material")
}
{'fraction_non_alphanumeric': 0.08179012345679013, 'fraction_numerical': 0.004629629629629629, 'mean_word_length': 4.196392785571143, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5107753', 'n_tokens_mistral': 773, 'n_tokens_neox': 725, 'n_words': 242}