<commit_before>package net.darkhax.teslatest.tileentity;

import net.darkhax.tesla.api.InfiniteTeslaConsumer;
import net.darkhax.tesla.capability.TeslaStorage;
import net.darkhax.tesla.lib.TeslaUtils;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraftforge.common.capabilities.Capability;

/**
 * A TileEntity that produces infinite amounts of tesla power.
 */
public class TileEntityCreativePower extends TileEntity implements ITickable {
    
    @Override
    @SuppressWarnings("unchecked")
    public <T> T getCapability (Capability<T> capability, EnumFacing facing) {
        
        if (capability == TeslaStorage.TESLA_HANDLER_CAPABILITY)
            return (T) new InfiniteTeslaConsumer();
            
        return super.getCapability(capability, facing);
    }
    
    @Override
    public boolean hasCapability (Capability<?> capability, EnumFacing facing) {
        
        if (capability == TeslaStorage.TESLA_HANDLER_CAPABILITY)
            return true;
            
        return super.hasCapability(capability, facing);
    }
    
    @Override
    public void update () {
        
        TeslaUtils.distributePowerEqually(this.worldObj, this.pos, 50, false);
    }<commit_msg>Fixed a typo. The CreativePower is a producer, not consumer.<commit_after>package net.darkhax.teslatest.tileentity;

import net.darkhax.tesla.api.InfiniteTeslaProducer;
import net.darkhax.tesla.capability.TeslaStorage;
import net.darkhax.tesla.lib.TeslaUtils;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraftforge.common.capabilities.Capability;

/**
 * A TileEntity that produces infinite amounts of tesla power.
 */
public class TileEntityCreativePower extends TileEntity implements ITickable {
    
    @Override
    @SuppressWarnings("unchecked")
    public <T> T getCapability (Capability<T> capability, EnumFacing facing) {
        
        if (capability == TeslaStorage.TESLA_HANDLER_CAPABILITY)
            return (T) new InfiniteTeslaProducer();
            
        return super.getCapability(capability, facing);
    }
    
    @Override
    public boolean hasCapability (Capability<?> capability, EnumFacing facing) {
        
        if (capability == TeslaStorage.TESLA_HANDLER_CAPABILITY)
            return true;
            
        return super.hasCapability(capability, facing);
    }
    
    @Override
    public void update () {
        
        TeslaUtils.distributePowerEqually(this.worldObj, this.pos, 50, false);
    }
{'fraction_non_alphanumeric': 0.08571428571428572, 'fraction_numerical': 0.0015238095238095239, 'mean_word_length': 3.262987012987013, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '261187', 'n_tokens_mistral': 780, 'n_tokens_neox': 784, 'n_words': 161}