<commit_before>package net.blay09.mods.cookingforblockheads.block;

import net.blay09.mods.cookingforblockheads.CookingForBlockheads;
import net.blay09.mods.cookingforblockheads.balyware.ItemUtils;
import net.blay09.mods.cookingforblockheads.network.handler.GuiHandler;
import net.blay09.mods.cookingforblockheads.registry.CookingRegistry;
import net.blay09.mods.cookingforblockheads.tile.TileOven;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemHandlerHelper;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Random;

public class  BlockOven extends BlockKitchen {

    private static final Random random = new Random();

    public BlockOven() {
        super(Material.IRON);

        setRegistryName(CookingForBlockheads.MOD_ID, "oven");
        setUnlocalizedName(getRegistryName().toString());
        setSoundType(SoundType.METAL);
        setHardness(5f);
        setResistance(10f);
    }

    @Override
    public BlockRenderLayer getBlockLayer() {
        return BlockRenderLayer.CUTOUT;
    }

    @Override
    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
        if (heldItem != null && heldItem.getItem() == Items.DYE) {
            if (recolorBlock(world, pos, side, EnumDyeColor.byDyeDamage(heldItem.getItemDamage()))) {
                heldItem.stackSize--;
            }
            return true;
        }
        if(side == EnumFacing.UP) {
            if(CookingRegistry.isToolItem(heldItem)) {
                EnumFacing facing = state.getValue(FACING);
                switch(facing) {
                    case NORTH: hitX = 1f - hitX; hitZ = 1f - hitZ; break;
//                    case SOUTH: hitX = hitX; hitZ = hitZ; break;
                    case WEST: hitZ = 1f - hitX; hitX = hitZ; break;
                    case EAST: hitZ = hitX; hitX = 1f - hitZ; break;
                }
                int index = -1;
                if(hitX < 0.5f && hitZ < 0.5f) {
                    index = 1;
                } else if(hitX >= 0.5f && hitZ < 0.5f) {
                    index = 0;
                } else if(hitX < 0.5f && hitZ >= 0.5f) {
                    index = 3;
                } else if(hitX >= 0.5f && hitZ >= 0.5f) {<commit_msg>Fix in-world tool placement on oven #170<commit_after>package net.blay09.mods.cookingforblockheads.block;

import net.blay09.mods.cookingforblockheads.CookingForBlockheads;
import net.blay09.mods.cookingforblockheads.balyware.ItemUtils;
import net.blay09.mods.cookingforblockheads.network.handler.GuiHandler;
import net.blay09.mods.cookingforblockheads.registry.CookingRegistry;
import net.blay09.mods.cookingforblockheads.tile.TileOven;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemHandlerHelper;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Random;

public class  BlockOven extends BlockKitchen {

    private static final Random random = new Random();

    public BlockOven() {
        super(Material.IRON);

        setRegistryName(CookingForBlockheads.MOD_ID, "oven");
        setUnlocalizedName(getRegistryName().toString());
        setSoundType(SoundType.METAL);
        setHardness(5f);
        setResistance(10f);
    }

    @Override
    public BlockRenderLayer getBlockLayer() {
        return BlockRenderLayer.CUTOUT;
    }

    @Override
    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
        if (heldItem != null && heldItem.getItem() == Items.DYE) {
            if (recolorBlock(world, pos, side, EnumDyeColor.byDyeDamage(heldItem.getItemDamage()))) {
                heldItem.stackSize--;
            }
            return true;
        }
        if(side == EnumFacing.UP) {
            if(CookingRegistry.isToolItem(heldItem)) {
                EnumFacing facing = state.getValue(FACING);
                float hx = hitX;
                float hz = hitZ;
                switch(facing) {
                    case NORTH: hx = 1f - hitX; hz = 1f - hitZ; break;
//                    case SOUTH: hx = hitX; hz = hitZ; break;
                    case WEST: hz = 1f - hitX; hx = hitZ; break;
                    case EAST: hz = hitX; hx = 1f - hitZ; break;
                }
                int index = -1;
                if(hx < 0.5f && hz < 0.5f) {
                    index = 1;
                } else if(hx >= 0.5f && hz < 0.5f) {
                    index = 0;
                } else if(hx < 0.5f && hz >= 0.5f) {
                    index = 3;
                } else if(hx >= 0.5f && hz >= 0.5f) {
{'fraction_non_alphanumeric': 0.10602114294469128, 'fraction_numerical': 0.01302282825187682, 'mean_word_length': 2.76905311778291, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2562900', 'n_tokens_mistral': 2112, 'n_tokens_neox': 2043, 'n_words': 398}