<commit_before>package k2b6s9j.boatcraft.api

import k2b6s9j.boatcraft.core.BoatCraft
import k2b6s9j.boatcraft.api.traits._
import java.util.{HashMap, Map}

object Registry {

  var materials: Map[String, Material] = new HashMap[String, Material]
  var modifiers: Map[String, Modifier] = new HashMap[String, Modifier]

  def register(registrar: AnyRef)= registrar match {
    case _: Material =>
      materials put (registrar.toString, registrar.asInstanceOf[Material])
    case _: List[Material] =>
      registrar.asInstanceOf[List[Material]].foreach(m => materials put (m.toString, m))
    case _: Modifier =>
      modifiers put (registrar.toString, registrar.asInstanceOf[Modifier])
    case _: List[Material] =>
      registrar.asInstanceOf[List[Modifier]].foreach(m => modifiers put (m.toString, m))
    case _ =>
      BoatCraft log error("Was unable to register: " + registrar.toString)
  }

}
<commit_msg>Added the ability to unregister things.<commit_after>package k2b6s9j.boatcraft.api

import k2b6s9j.boatcraft.core.BoatCraft
import k2b6s9j.boatcraft.api.traits._
import java.util.{HashMap, Map}

object Registry {

  var materials: Map[String, Material] = new HashMap[String, Material]
  var modifiers: Map[String, Modifier] = new HashMap[String, Modifier]

  def register(registrar: AnyRef)= registrar match {
    case _: Material =>
      materials put (registrar.toString, registrar.asInstanceOf[Material])
    case _: List[Material] =>
      registrar.asInstanceOf[List[Material]].foreach(m => materials put (m.toString, m))
    case _: Modifier =>
      modifiers put (registrar.toString, registrar.asInstanceOf[Modifier])
    case _: List[Material] =>
      registrar.asInstanceOf[List[Modifier]].foreach(m => modifiers put (m.toString, m))
    case _ =>
      BoatCraft.log.fatal("Was unable to register: " + registrar.toString)
  }

  def unregister(unregistrant: AnyRef) = unregistrant match {
    case _: Material =>
      materials remove unregistrant.toString
    case _: List[Material] =>
      unregistrant.asInstanceOf[List[Material]].foreach(m => materials remove m.toString)
    case _: Modifier =>
      modifiers remove unregistrant.toString
    case _: List[Material] =>
      unregistrant.asInstanceOf[List[Modifier]].foreach(m => modifiers remove m.toString)
    case _ =>
      BoatCraft.log.error("There was nothing to unregister: " + unregistrant.toString)
  }

}

{'fraction_non_alphanumeric': 0.11480865224625623, 'fraction_numerical': 0.0074875207986688855, 'mean_word_length': 4.205627705627705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '2489992', 'n_tokens_mistral': 774, 'n_tokens_neox': 774, 'n_words': 165}