public void onEntityCollidedWithBlock(
      World par1World, int par2, int par3, int par4, Entity par5Entity) {

    if (par1World.isRemote) {
      return;
    } else {
      if (par5Entity instanceof EntityPlayer && !deactivated) {
        par1World.setBlock(par2, par3, par4, mod_SecurityCraft.deactivatedCageTrap);
        par1World.scheduleBlockUpdate(
            par2, par3, par4, mod_SecurityCraft.unbreakableIronBars, 1200);

        par1World.setBlock(par2, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars);
        par1World.scheduleBlockUpdate(
            par2, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars, 1200);

        par1World.setBlock(par2 + 1, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars);
        par1World.scheduleBlockUpdate(
            par2 + 1, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars, 1200);

        par1World.setBlock(par2 - 1, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars);
        par1World.scheduleBlockUpdate(
            par2 - 1, par3 + 4, par4, mod_SecurityCraft.unbreakableIronBars, 1200);

        par1World.setBlock(par2, par3 + 4, par4 + 1, mod_SecurityCraft.unbreakableIronBars);
        par1World.scheduleBlockUpdate(
            par2, par3 + 4, par4 + 1, mod_SecurityCraft.unbreakableIronBars, 1200);

        par1World.setBlock(par2, par3 + 4, par4 - 1, mod_SecurityCraft.unbreakableIronBars);
        par1World.scheduleBlockUpdate(
            par2, par3 + 4, par4 - 1, mod_SecurityCraft.unbreakableIronBars, 1200);

        HelpfulMethods.setBlockInBox(
            par1World, par2, par3, par4, mod_SecurityCraft.unbreakableIronBars);

        par1World.playSoundAtEntity(par5Entity, "random.anvil_use", 3.0F, 1.0F);
        // ChatMessageComponent.createFromText(((EntityPlayer) par5Entity).getCommandSenderName() +
        // " was captured in a trap at" + HelpfulMethods.getFormattedCoordinates(par2, par3, par4))
        MinecraftServer.getServer()
            .getConfigurationManager()
            .sendChatMsg(
                new ChatComponentTranslation(
                    ((EntityPlayer) par5Entity).getCommandSenderName()
                        + " was captured in a trap at"
                        + HelpfulMethods.getFormattedCoordinates(par2, par3, par4)));
      }
    }
  }
 /** Returns the ID of the items to drop on destruction. */
 public Item getItemDropped(int par1, Random par2Random, int par3) {
   return this.deactivated
       ? HelpfulMethods.getItemFromBlock(mod_SecurityCraft.deactivatedCageTrap)
       : HelpfulMethods.getItemFromBlock(this);
 }