// Path: src/api/java/com/github/atomicblom/shearmadness/api/Capability.java
// public final class Capability {
//     @CapabilityInject(IChiseledSheepCapability.class)
//     public static final net.minecraftforge.common.capabilities.Capability<IChiseledSheepCapability> CHISELED_SHEEP;
// 
//     static {
//         CHISELED_SHEEP = null;
//     }
// }
// 
// Path: src/api/java/com/github/atomicblom/shearmadness/api/capability/IChiseledSheepCapability.java
// public interface IChiseledSheepCapability
// {
//     boolean isChiseled();
// 
//     void unChisel();
// 
//     void chisel(ItemStack itemStack);
// 
//     ItemStack getChiselItemStack();
// 
//     int getItemIdentifier();
// 
//     NBTTagCompound getExtraData();
// }
// 
// Path: src/main/java/com/github/atomicblom/shearmadness/utility/SoundLibrary.java
// @SuppressWarnings("ALL")
// @ObjectHolder(CommonReference.MOD_ID)
// public class SoundLibrary
// {
//     public static SoundEvent sheepchiseled = null;
// }


import com.github.atomicblom.shearmadness.api.Capability;
import com.github.atomicblom.shearmadness.api.capability.IChiseledSheepCapability;
import com.github.atomicblom.shearmadness.utility.SoundLibrary;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.SoundCategory;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
package com.github.atomicblom.shearmadness.networking;


public class SheepChiseledMessageHandler implements IMessageHandler<SheepChiseledMessage, IMessage>
{
    @SuppressWarnings({"ReturnOfNull", "ConstantConditions"})
    @Override
    public IMessage onMessage(SheepChiseledMessage message, MessageContext ctx)
    {
        final int sheepId = message.getSheepId();
        final Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(sheepId);

        if (entity == null)
        {
            return null;
        }
        final IChiseledSheepCapability capability = entity.getCapability(Capability.CHISELED_SHEEP, null);
        if (capability == null)
        {
            return null;
        }
        final boolean chiseled = message.isChiseled();
        if (chiseled) {
            capability.chisel(message.getChiselItemStack());
// Path: src/api/java/com/github/atomicblom/shearmadness/api/Capability.java
// public final class Capability {
//     @CapabilityInject(IChiseledSheepCapability.class)
//     public static final net.minecraftforge.common.capabilities.Capability<IChiseledSheepCapability> CHISELED_SHEEP;
// 
//     static {
//         CHISELED_SHEEP = null;
//     }
// }
// 
// Path: src/api/java/com/github/atomicblom/shearmadness/api/capability/IChiseledSheepCapability.java
// public interface IChiseledSheepCapability
// {
//     boolean isChiseled();
// 
//     void unChisel();
// 
//     void chisel(ItemStack itemStack);
// 
//     ItemStack getChiselItemStack();
// 
//     int getItemIdentifier();
// 
//     NBTTagCompound getExtraData();
// }
// 
// Path: src/main/java/com/github/atomicblom/shearmadness/utility/SoundLibrary.java
// @SuppressWarnings("ALL")
// @ObjectHolder(CommonReference.MOD_ID)
// public class SoundLibrary
// {
//     public static SoundEvent sheepchiseled = null;
// }


// Path: src/main/java/com/github/atomicblom/shearmadness/networking/SheepChiseledMessageHandler.java
import com.github.atomicblom.shearmadness.api.Capability;
import com.github.atomicblom.shearmadness.api.capability.IChiseledSheepCapability;
import com.github.atomicblom.shearmadness.utility.SoundLibrary;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.SoundCategory;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

package com.github.atomicblom.shearmadness.networking;


public class SheepChiseledMessageHandler implements IMessageHandler<SheepChiseledMessage, IMessage>
{
    @SuppressWarnings({"ReturnOfNull", "ConstantConditions"})
    @Override
    public IMessage onMessage(SheepChiseledMessage message, MessageContext ctx)
    {
        final int sheepId = message.getSheepId();
        final Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(sheepId);

        if (entity == null)
        {
            return null;
        }
        final IChiseledSheepCapability capability = entity.getCapability(Capability.CHISELED_SHEEP, null);
        if (capability == null)
        {
            return null;
        }
        final boolean chiseled = message.isChiseled();
        if (chiseled) {
            capability.chisel(message.getChiselItemStack());
            entity.worldObj.playSound(entity.posX, entity.posY, entity.posZ, SoundLibrary.sheepchiseled, SoundCategory.NEUTRAL, 0.5F, 1.0f, true);