// Path: src/main/java/com/corwinjv/mobtotems/blocks/tiles/base/ModTileEntity.java
// public class ModTileEntity extends TileEntity {
//     public ModTileEntity() {
//         super();
//     }
// 
//     @Override
//     public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
//         return super.writeToNBT(tagCompound);
//     }
// 
//     @Override
//     public void readFromNBT(NBTTagCompound tagCompound) {
//         super.readFromNBT(tagCompound);
//     }
// 
//     @Nonnull
//     @Override
//     public final NBTTagCompound getUpdateTag() {
//         return writeToNBT(super.getUpdateTag());
//     }
// 
//     @Override
//     public SPacketUpdateTileEntity getUpdatePacket() {
//         return new SPacketUpdateTileEntity(pos, 0, getUpdateTag());
//     }
// 
//     @Override
//     public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity packet) {
//         super.onDataPacket(networkManager, packet);
//         readFromNBT(packet.getNbtCompound());
// 
//         final IBlockState state = getWorld().getBlockState(getPos());
//         getWorld().notifyBlockUpdate(getPos(), state, state, 3);
//     }
// 
//     @Override
//     public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) {
//         return (oldState.getBlock() != newState.getBlock());
//     }
// 
//     @Override
//     public void markDirty() {
//         super.markDirty();
//         if (world != null) {
//             world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 3);
//         }
//     }
// }
// 
// Path: src/main/java/com/corwinjv/mobtotems/interfaces/IChargeable.java
// public interface IChargeable {
//     int getChargeLevel(ItemStack stack);
// 
//     void setChargeLevel(ItemStack stack, int chargeLevel);
// 
//     void decrementChargeLevel(ItemStack stack, int amount);
// 
//     void incrementChargeLevel(ItemStack stack, int amount);
// 
//     int getMaxChargeLevel();
// }


import baubles.api.BaublesApi;
import baubles.api.cap.IBaublesItemHandler;
import com.corwinjv.mobtotems.blocks.tiles.base.ModTileEntity;
import com.corwinjv.mobtotems.interfaces.IChargeable;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
            long worldTime = getWorld().getWorldTime();
            if (worldTime % UPDATE_TICKS == 0) {
                performChargeAura();
            }
        } else {
            long worldTime = getWorld().getWorldTime();
            if (worldTime % PARTICLE_UPDATE_TICKS == 0) {
                spawnParticleEffects();
            }
        }
    }

    private void performTTLUpdate() {
        timeLived++;
        if (timeLived > TTL) {
            getWorld().destroyBlock(pos, false);
        }
    }

    private void performChargeAura() {
        final BlockPos targetPos = getPos();
        Predicate<EntityPlayer> playerWithinRangePredicate = input -> input != null
                && input.getPosition().getDistance(targetPos.getX(), targetPos.getY(), targetPos.getZ()) < TMP_MANA_GAIN_DIST;
        List<EntityPlayer> playersWithinRange = getWorld().getEntities(EntityPlayer.class, playerWithinRangePredicate::test);

        for (EntityPlayer player : playersWithinRange) {
            IBaublesItemHandler baublesItemHandler = BaublesApi.getBaublesHandler(player);
            for (int i = 0; i < baublesItemHandler.getSlots(); i++) {
                final ItemStack baubleStack = baublesItemHandler.getStackInSlot(i);
                if (baubleStack != ItemStack.EMPTY
// Path: src/main/java/com/corwinjv/mobtotems/blocks/tiles/base/ModTileEntity.java
// public class ModTileEntity extends TileEntity {
//     public ModTileEntity() {
//         super();
//     }
// 
//     @Override
//     public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
//         return super.writeToNBT(tagCompound);
//     }
// 
//     @Override
//     public void readFromNBT(NBTTagCompound tagCompound) {
//         super.readFromNBT(tagCompound);
//     }
// 
//     @Nonnull
//     @Override
//     public final NBTTagCompound getUpdateTag() {
//         return writeToNBT(super.getUpdateTag());
//     }
// 
//     @Override
//     public SPacketUpdateTileEntity getUpdatePacket() {
//         return new SPacketUpdateTileEntity(pos, 0, getUpdateTag());
//     }
// 
//     @Override
//     public void onDataPacket(NetworkManager networkManager, SPacketUpdateTileEntity packet) {
//         super.onDataPacket(networkManager, packet);
//         readFromNBT(packet.getNbtCompound());
// 
//         final IBlockState state = getWorld().getBlockState(getPos());
//         getWorld().notifyBlockUpdate(getPos(), state, state, 3);
//     }
// 
//     @Override
//     public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) {
//         return (oldState.getBlock() != newState.getBlock());
//     }
// 
//     @Override
//     public void markDirty() {
//         super.markDirty();
//         if (world != null) {
//             world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 3);
//         }
//     }
// }
// 
// Path: src/main/java/com/corwinjv/mobtotems/interfaces/IChargeable.java
// public interface IChargeable {
//     int getChargeLevel(ItemStack stack);
// 
//     void setChargeLevel(ItemStack stack, int chargeLevel);
// 
//     void decrementChargeLevel(ItemStack stack, int amount);
// 
//     void incrementChargeLevel(ItemStack stack, int amount);
// 
//     int getMaxChargeLevel();
// }


// Path: src/main/java/com/corwinjv/mobtotems/blocks/tiles/IncenseKindlingBoxTileEntity.java
import baubles.api.BaublesApi;
import baubles.api.cap.IBaublesItemHandler;
import com.corwinjv.mobtotems.blocks.tiles.base.ModTileEntity;
import com.corwinjv.mobtotems.interfaces.IChargeable;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;

            long worldTime = getWorld().getWorldTime();
            if (worldTime % UPDATE_TICKS == 0) {
                performChargeAura();
            }
        } else {
            long worldTime = getWorld().getWorldTime();
            if (worldTime % PARTICLE_UPDATE_TICKS == 0) {
                spawnParticleEffects();
            }
        }
    }

    private void performTTLUpdate() {
        timeLived++;
        if (timeLived > TTL) {
            getWorld().destroyBlock(pos, false);
        }
    }

    private void performChargeAura() {
        final BlockPos targetPos = getPos();
        Predicate<EntityPlayer> playerWithinRangePredicate = input -> input != null
                && input.getPosition().getDistance(targetPos.getX(), targetPos.getY(), targetPos.getZ()) < TMP_MANA_GAIN_DIST;
        List<EntityPlayer> playersWithinRange = getWorld().getEntities(EntityPlayer.class, playerWithinRangePredicate::test);

        for (EntityPlayer player : playersWithinRange) {
            IBaublesItemHandler baublesItemHandler = BaublesApi.getBaublesHandler(player);
            for (int i = 0; i < baublesItemHandler.getSlots(); i++) {
                final ItemStack baubleStack = baublesItemHandler.getStackInSlot(i);
                if (baubleStack != ItemStack.EMPTY
                        && baubleStack.getItem() instanceof IChargeable) {