<commit_before>package shedar.mods.ic2.nuclearcontrol.crossmod.RF;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
import shedar.mods.ic2.nuclearcontrol.crossmod.EnergyStorageData;
import shedar.mods.ic2.nuclearcontrol.tileentities.TileEntityAverageCounter;
import shedar.mods.ic2.nuclearcontrol.tileentities.TileEntityEnergyCounter;
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.registry.GameRegistry;

public class CrossBuildcraft{
    private boolean _isApiAvailable = false;
    
    public boolean isApiAvailable(){
        return _isApiAvailable;
    }
    
    @SuppressWarnings("unchecked")
    public void registerTileEntity(){
        try{
            GameRegistry.registerTileEntity((Class<? extends TileEntity>)Class.forName("shedar.mods.ic2.nuclearcontrol.crossmod.buildcraft.TileEntityAverageCounterBC"), "IC2NCAverageCounterBC");
            GameRegistry.registerTileEntity((Class<? extends TileEntity>)Class.forName("shedar.mods.ic2.nuclearcontrol.crossmod.buildcraft.TileEntityEnergyCounterBC"), "IC2NCEnergyCounterBC");
        } catch(ClassNotFoundException e){
            e.printStackTrace();
        }
    }
    
    public CrossBuildcraft(){
        try{
            Class.forName("buildcraft.api.power.IPowerReceptor", false, this.getClass().getClassLoader());
            Class.forName("buildcraft.api.power.IPowerEmitter", false, this.getClass().getClassLoader());
            Class.forName("buildcraft.api.power.PowerHandler", false, this.getClass().getClassLoader());
            Class.forName("buildcraft.api.tools.IToolWrench", false, this.getClass().getClassLoader());
            Class.forName("buildcraft.api.transport.IPipeConnection", false, this.getClass().getClassLoader());
            _isApiAvailable = true;
            registerTileEntity();
        } catch (ClassNotFoundException e){
            _isApiAvailable = false;
        }
    }
    
    public void useWrench(ItemStack itemStack, TileEntity target, EntityPlayer player){
        if(_isApiAvailable){
            ((IToolWrench) itemStack.getItem()).wrenchUsed(player, target.xCoord, target.yCoord, target.zCoord);
        }
    }
    
    public boolean isWrench(ItemStack itemStack, TileEntity target, EntityPlayer player){
        return _isApiAvailable && 
                itemStack.getItem() instanceof IToolWrench && 
                ((IToolWrench)itemStack.getItem()).canWrench(player, target.xCoord, target.yCoord, target.zCoord);
    }
    
    public boolean isTankContainer(Object obj){
        return _isApiAvailable && obj instanceof IFluidHandler;
    }


}<commit_msg>Changes to the Buildcraft Cross<commit_after>package shedar.mods.ic2.nuclearcontrol.crossmod.RF;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
import shedar.mods.ic2.nuclearcontrol.crossmod.EnergyStorageData;
import shedar.mods.ic2.nuclearcontrol.tileentities.TileEntityAverageCounter;
import shedar.mods.ic2.nuclearcontrol.tileentities.TileEntityEnergyCounter;
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.registry.GameRegistry;

public class CrossBuildcraft{
    private boolean _isApiAvailable = false;
    
    public boolean isApiAvailable(){
        return _isApiAvailable;
    }
    
    public CrossBuildcraft(){
        try{
            //Class.forName("buildcraft.api.power.IPowerReceptor", false, this.getClass().getClassLoader());
            //Class.forName("buildcraft.api.power.IPowerEmitter", false, this.getClass().getClassLoader());
            //Class.forName("buildcraft.api.power.PowerHandler", false, this.getClass().getClassLoader());
            Class.forName("buildcraft.api.tools.IToolWrench", false, this.getClass().getClassLoader());
            //Class.forName("buildcraft.api.transport.IPipeConnection", false, this.getClass().getClassLoader());
            _isApiAvailable = true;
        } catch (ClassNotFoundException e){
            _isApiAvailable = false;
        }
    }
    
    public void useWrench(ItemStack itemStack, TileEntity target, EntityPlayer player){
        if(_isApiAvailable){
            ((IToolWrench) itemStack.getItem()).wrenchUsed(player, target.xCoord, target.yCoord, target.zCoord);
        }
    }
    
    public boolean isWrench(ItemStack itemStack, TileEntity target, EntityPlayer player){
        return _isApiAvailable && 
                itemStack.getItem() instanceof IToolWrench && 
                ((IToolWrench)itemStack.getItem()).canWrench(player, target.xCoord, target.yCoord, target.zCoord);
    }
    
    public boolean isTankContainer(Object obj){
        return _isApiAvailable && obj instanceof IFluidHandler;
    }


}
{'fraction_non_alphanumeric': 0.10762152430486097, 'fraction_numerical': 0.002400480096019204, 'mean_word_length': 3.668534080298786, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7394546', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1417, 'n_words': 219}