<commit_before>package com.github.begla.blockmania.blocks

/*
 * Copyright 2011 <NAME> <<EMAIL>>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import com.github.begla.blockmania.rendering.manager.TextureManager

import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import javax.vecmath.Vector2f
import javax.vecmath.Vector4f
import org.newdawn.slick.util.ResourceLoader
import java.awt.RenderingHints
import java.awt.Graphics2D
import java.awt.Image

/**
 * This Groovy class is responsible for keeping the Block Manifest in sync between
 * a set of block definitions and a saved world in Serialized state
 * It is only used on game-startup, leaving on-going activity to BlockManager et al
 *
 * @author Rasmus 'Cervator' Praestholm <<EMAIL>>
 */
class BlockManifestor {

    private static BlockManager _bm;

    private GroovyClassLoader _classLoader = new GroovyClassLoader();

    /** Holds BufferedImages during the loading process (not persisted) */
    private Map<String, BufferedImage> _images = [:]

    /** Holds image index values during the loading process. These values are persisted in the Manifest */
    protected static Map<String, Integer> _imageIndex = [:]

    /** Holds Block ID index values during the loading process - also persisted in the Manifest */
    protected static Map<Byte, Block> _blockIndex = [:]

    /** Smaller version of _blockIndex only used for loading IDs */
    protected static Map<String, Byte> _blockStringIndex = [:]

    /** Holds the Byte value for the next Block ID - starts at 1 since Air is always 0 */
    protected static byte _nextByte = (byte) 1

    /** Temp Manifest references - need to tie these to each saved world instead (or fail to find any, then create) */
    File _blockManifest = new File('SAVED_WORLDS/BlockManifest.groovy')
    File _imageManifest = new File('SAVED_WORLDS/ImageManifest.png')<commit_msg>Fixes field access right.<commit_after>package com.github.begla.blockmania.blocks

/*
 * Copyright 2011 <NAME> <<EMAIL>>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import com.github.begla.blockmania.rendering.manager.TextureManager

import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import javax.vecmath.Vector2f
import javax.vecmath.Vector4f
import org.newdawn.slick.util.ResourceLoader
import java.awt.RenderingHints
import java.awt.Graphics2D
import java.awt.Image

/**
 * This Groovy class is responsible for keeping the Block Manifest in sync between
 * a set of block definitions and a saved world in Serialized state
 * It is only used on game-startup, leaving on-going activity to BlockManager et al
 *
 * @author Rasmus 'Cervator' Praestholm <<EMAIL>>
 */
class BlockManifestor {

    private static BlockManager _bm;

    /** Used for dynamically loading the Groovy classes **/
    protected GroovyClassLoader _classLoader = new GroovyClassLoader();

    /** Holds BufferedImages during the loading process (not persisted) */
    private Map<String, BufferedImage> _images = [:]

    /** Holds image index values during the loading process. These values are persisted in the Manifest */
    protected static Map<String, Integer> _imageIndex = [:]

    /** Holds Block ID index values during the loading process - also persisted in the Manifest */
    protected static Map<Byte, Block> _blockIndex = [:]

    /** Smaller version of _blockIndex only used for loading IDs */
    protected static Map<String, Byte> _blockStringIndex = [:]

    /** Holds the Byte value for the next Block ID - starts at 1 since Air is always 0 */
    protected static byte _nextByte = (byte) 1

    /** Temp Manifest references - need to tie these to each saved world instead (or fail to find any, then create) */
    File _blockManifest = new File('SAVED_WORLDS/BlockManifest.groovy')
    File _imageManifest = new File('SAVED_WORLDS/ImageManifest.png')
{'fraction_non_alphanumeric': 0.0792058943921408, 'fraction_numerical': 0.0057306590257879654, 'mean_word_length': 3.9363636363636365, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4042765', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1295, 'n_words': 551}