<commit_before>package codechicken.multipart.handler

import net.minecraft.tileentity.TileEntity
import net.minecraft.nbt.NBTTagCompound
import java.util.Map
import net.minecraft.world.chunk.Chunk
import net.minecraft.world.ChunkPosition
import codechicken.multipart.TileMultipart
import codechicken.core.asm.ObfuscationMappings


/**
 * Hack due to lack of TileEntityLoadEvent in forge
 */
object MultipartSaveLoad
{
    class TileNBTContainer extends TileEntity
    {
        var tag:NBTTagCompound = _
        
        override def readFromNBT(t:NBTTagCompound)
        {
            super.readFromNBT(t)
            tag = t
        }
    }
    
    hookLoader()
    def hookLoader()
    {
        //hacky stuff for mcpc until I get a proper obfuscator on the build
        val fieldName = if(ObfuscationMappings.obfuscated) "a" else "nameToClassMap"
        
        val field = classOf[TileEntity].getDeclaredField(fieldName)
        field.setAccessible(true)
        val map = field.get(null).asInstanceOf[Map[String, Class[_ <: TileEntity]]]
        map.put("savedMultipart", classOf[TileNBTContainer])
    }
    
    private val classToNameMap = getClassToNameMap
    def registerTileClass(t:Class[_ <: TileEntity])
    {
        classToNameMap.put(t, "savedMultipart")
    }
    
    def getClassToNameMap() =
    {
        val field = classOf[TileEntity].getDeclaredFields()(1)
        field.setAccessible(true)
        field.get(null).asInstanceOf[Map[Class[_ <: TileEntity], String]]
    }
    
    def loadTiles(chunk:Chunk)
    {
        val iterator = chunk.chunkTileEntityMap.asInstanceOf[Map[ChunkPosition, TileEntity]].entrySet.iterator
        while(iterator.hasNext)
        {<commit_msg>Forgot about runtime deobf there.<commit_after>package codechicken.multipart.handler

import net.minecraft.tileentity.TileEntity
import net.minecraft.nbt.NBTTagCompound
import java.util.Map
import net.minecraft.world.chunk.Chunk
import net.minecraft.world.ChunkPosition
import codechicken.multipart.TileMultipart
import codechicken.core.asm.ObfuscationMappings


/**
 * Hack due to lack of TileEntityLoadEvent in forge
 */
object MultipartSaveLoad
{
    class TileNBTContainer extends TileEntity
    {
        var tag:NBTTagCompound = _
        
        override def readFromNBT(t:NBTTagCompound)
        {
            super.readFromNBT(t)
            tag = t
        }
    }
    
    hookLoader()
    def hookLoader()
    {
        //hacky stuff for mcpc until I get a proper obfuscator on the build
        val fieldName = if(ObfuscationMappings.obfuscated) "field_70326_a" else "nameToClassMap"
        
        val field = classOf[TileEntity].getDeclaredField(fieldName)
        field.setAccessible(true)
        val map = field.get(null).asInstanceOf[Map[String, Class[_ <: TileEntity]]]
        map.put("savedMultipart", classOf[TileNBTContainer])
    }
    
    private val classToNameMap = getClassToNameMap
    def registerTileClass(t:Class[_ <: TileEntity])
    {
        classToNameMap.put(t, "savedMultipart")
    }
    
    def getClassToNameMap() =
    {
        val field = classOf[TileEntity].getDeclaredFields()(1)
        field.setAccessible(true)
        field.get(null).asInstanceOf[Map[Class[_ <: TileEntity], String]]
    }
    
    def loadTiles(chunk:Chunk)
    {
        val iterator = chunk.chunkTileEntityMap.asInstanceOf[Map[ChunkPosition, TileEntity]].entrySet.iterator
        while(iterator.hasNext)
        {
{'fraction_non_alphanumeric': 0.09019721577726218, 'fraction_numerical': 0.0020301624129930394, 'mean_word_length': 2.946224256292906, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6099282', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1082, 'n_words': 196}