<commit_before>package refinedstorage.item;

import cofh.api.energy.ItemEnergyContainer;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.tile.TileController;
import refinedstorage.tile.grid.TileGrid;

import java.util.List;

public class ItemWirelessGrid extends ItemEnergyContainer {
    public static final int TYPE_NORMAL = 0;
    public static final int TYPE_CREATIVE = 1;

    public static final String NBT_CONTROLLER_X = "ControllerX";
    public static final String NBT_CONTROLLER_Y = "ControllerY";
    public static final String NBT_CONTROLLER_Z = "ControllerZ";
    public static final String NBT_DIMENSION_ID = "DimensionID";
    public static final String NBT_SORTING_TYPE = "SortingType";
    public static final String NBT_SORTING_DIRECTION = "SortingDirection";
    public static final String NBT_SEARCH_BOX_MODE = "SearchBoxMode";

    public static final int RANGE = 64;

    public static final int USAGE_OPEN = 30;
    public static final int USAGE_PULL = 3;
    public static final int USAGE_PUSH = 3;

    public ItemWirelessGrid() {
        super(3200);

        addPropertyOverride(new ResourceLocation("connected"), new IItemPropertyGetter() {
            @Override
            public float apply(ItemStack stack, World world, EntityLivingBase entity) {
                return canOpenWirelessGrid(world, entity, stack) ? 1.0f : 0.0f;
            }
        });

        setRegistryName(RefinedStorage.ID, "wireless_grid");
        setMaxDamage(3200);
        setMaxStackSize(1);
        setHasSubtypes(true);
        setCreativeTab(RefinedStorage.TAB);
    }

    @Override
    public boolean isDamageable() {
        return true;
    }

    @Override
    public boolean isRepairable() {
        return false;
    }

    @Override
    public double getDurabilityForDisplay(ItemStack stack) {
        return 1d - ((double) getEnergyStored(stack) / (double) getMaxEnergyStored(stack));
    }

    @Override
    public boolean isDamaged(ItemStack stack) {
        return stack.getItemDamage() == 0;
    }

    @Override
    public void setDamage(ItemStack stack, int damage) {
        // NO OP
    }

    @Override
    public void getSubItems(Item item, CreativeTabs tab, List list) {
        list.add(new ItemStack(item, 1, TYPE_NORMAL));<commit_msg>Use constant instead<commit_after>package refinedstorage.item;

import cofh.api.energy.ItemEnergyContainer;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.tile.TileController;
import refinedstorage.tile.grid.TileGrid;

import java.util.List;

public class ItemWirelessGrid extends ItemEnergyContainer {
    public static final int TYPE_NORMAL = 0;
    public static final int TYPE_CREATIVE = 1;

    public static final String NBT_CONTROLLER_X = "ControllerX";
    public static final String NBT_CONTROLLER_Y = "ControllerY";
    public static final String NBT_CONTROLLER_Z = "ControllerZ";
    public static final String NBT_DIMENSION_ID = "DimensionID";
    public static final String NBT_SORTING_TYPE = "SortingType";
    public static final String NBT_SORTING_DIRECTION = "SortingDirection";
    public static final String NBT_SEARCH_BOX_MODE = "SearchBoxMode";

    public static final int RANGE = 64;

    public static final int USAGE_OPEN = 30;
    public static final int USAGE_PULL = 3;
    public static final int USAGE_PUSH = 3;

    public ItemWirelessGrid() {
        super(3200);

        addPropertyOverride(new ResourceLocation("connected"), new IItemPropertyGetter() {
            @Override
            public float apply(ItemStack stack, World world, EntityLivingBase entity) {
                return canOpenWirelessGrid(world, entity, stack) ? 1.0f : 0.0f;
            }
        });

        setRegistryName(RefinedStorage.ID, "wireless_grid");
        setMaxDamage(3200);
        setMaxStackSize(1);
        setHasSubtypes(true);
        setCreativeTab(RefinedStorage.TAB);
    }

    @Override
    public boolean isDamageable() {
        return true;
    }

    @Override
    public boolean isRepairable() {
        return false;
    }

    @Override
    public double getDurabilityForDisplay(ItemStack stack) {
        return 1d - ((double) getEnergyStored(stack) / (double) getMaxEnergyStored(stack));
    }

    @Override
    public boolean isDamaged(ItemStack stack) {
        return stack.getItemDamage() != TYPE_CREATIVE;
    }

    @Override
    public void setDamage(ItemStack stack, int damage) {
        // NO OP
    }

    @Override
    public void getSubItems(Item item, CreativeTabs tab, List list) {
        list.add(new ItemStack(item, 1, TYPE_NORMAL));
{'fraction_non_alphanumeric': 0.08323003364618381, 'fraction_numerical': 0.009031344076500797, 'mean_word_length': 3.6333059885151764, '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': '7317332', 'n_tokens_mistral': 1718, 'n_tokens_neox': 1656, 'n_words': 405}