<commit_before>package mcjty.immcraft.blocks.furnace;

import mcjty.immcraft.api.handles.OutputInterfaceHandle;
import mcjty.immcraft.api.helpers.NBTHelper;
import mcjty.immcraft.blocks.ModBlocks;
import mcjty.immcraft.blocks.generic.GenericInventoryTE;
import mcjty.immcraft.blocks.generic.handles.FuelInterfaceHandle;
import mcjty.immcraft.blocks.generic.handles.SmeltableInterfaceHandle;
import mcjty.immcraft.config.GeneralConfiguration;
import mcjty.lib.tools.ItemStackTools;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ITickable;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.SidedInvWrapper;

public class FurnaceTE extends GenericInventoryTE implements ITickable {

    public static final int SLOT_FUEL = 0;
    public static final int SLOT_TOBURN = 1;
    public static final int SLOT_OUTPUT = 2;

    public static final int FURNACE_COOKTIME = 200;

    private int burnTime = 0;
    private int cookTime = 0;

    public FurnaceTE() {
        super(3);
        addInterfaceHandle(new FuelInterfaceHandle("fuel").slot(SLOT_FUEL));
        addInterfaceHandle(new SmeltableInterfaceHandle("input").slot(SLOT_TOBURN));
        addInterfaceHandle(new OutputInterfaceHandle("output").slot(SLOT_OUTPUT));
    }

    @Override
    public void update() {
        if (burnTime > 0) {
            markDirtyQuick();
            handleMelt();
            handleBurn();
        }
    }

    @Override
    public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
        super.onDataPacket(net, packet);
        if (getWorld().isRemote) {
            // If needed send a render update.
            // @todo try to check if it is really needed
            getWorld().markBlockRangeForRenderUpdate(getPos(), getPos());
        }
    }

    @Override
    public int[] getSlotsForFace(EnumFacing side) {
        EnumFacing direction = ModBlocks.furnaceBlock.worldToBlockSpace(getWorld(), getPos(), side);
        if (direction == EnumFacing.UP) {
            return new int[]{SLOT_FUEL};
        } else if (direction == EnumFacing.DOWN) {
            return new int[]{SLOT_OUTPUT};
        } else {
            return new int[]{SLOT_TOBURN};
        }
    }<commit_msg>Made facing for the furnace actually correct now<commit_after>package mcjty.immcraft.blocks.furnace;

import mcjty.immcraft.api.handles.OutputInterfaceHandle;
import mcjty.immcraft.api.helpers.NBTHelper;
import mcjty.immcraft.blocks.ModBlocks;
import mcjty.immcraft.blocks.generic.GenericInventoryTE;
import mcjty.immcraft.blocks.generic.handles.FuelInterfaceHandle;
import mcjty.immcraft.blocks.generic.handles.SmeltableInterfaceHandle;
import mcjty.immcraft.config.GeneralConfiguration;
import mcjty.lib.tools.ItemStackTools;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ITickable;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.SidedInvWrapper;

public class FurnaceTE extends GenericInventoryTE implements ITickable {

    public static final int SLOT_FUEL = 0;
    public static final int SLOT_TOBURN = 1;
    public static final int SLOT_OUTPUT = 2;

    public static final int FURNACE_COOKTIME = 200;

    private int burnTime = 0;
    private int cookTime = 0;

    public FurnaceTE() {
        super(3);
        addInterfaceHandle(new FuelInterfaceHandle("fuel").slot(SLOT_FUEL));
        addInterfaceHandle(new SmeltableInterfaceHandle("input").slot(SLOT_TOBURN));
        addInterfaceHandle(new OutputInterfaceHandle("output").slot(SLOT_OUTPUT));
    }

    @Override
    public void update() {
        if (burnTime > 0) {
            markDirtyQuick();
            handleMelt();
            handleBurn();
        }
    }

    @Override
    public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
        super.onDataPacket(net, packet);
        if (getWorld().isRemote) {
            // If needed send a render update.
            // @todo try to check if it is really needed
            getWorld().markBlockRangeForRenderUpdate(getPos(), getPos());
        }
    }

    @Override
    public int[] getSlotsForFace(EnumFacing side) {
        EnumFacing direction = ModBlocks.furnaceBlock.worldToBlockSpace(getWorld(), getPos(), side);
        if (direction == EnumFacing.UP) {
            return new int[]{SLOT_TOBURN};
        } else if (direction == EnumFacing.DOWN) {
            return new int[]{SLOT_OUTPUT};
        } else {
            return new int[]{SLOT_FUEL};
        }
    }
{'fraction_non_alphanumeric': 0.0968390279554175, 'fraction_numerical': 0.0036543029417138682, 'mean_word_length': 3.6311336717428087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5933900', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1630, 'n_words': 329}